以下にリストされている小さなアプリケーションがあります。これは、x ウィンドウとその中に小さなウィンドウを作成するだけです。後で、すべてのツールバーとメニューがサブウィンドウであり、それらを管理したいウィンドウ マネージャーを選択できる実験的な IDE を作成する予定です。
私がやりたいのは、xmonad インスタンスを起動し、ルート ウィンドウからウィンドウを再親化して制御するのではなく、アプリケーションのウィンドウ内でウィンドウを再親化して制御することです。
これは可能ですか?
PS アプリはこちらです。
module Main where
import Graphics.X11.Xlib
y f = w where w = f w
main = do
display <- openDisplay ""
let screen = defaultScreen display
root <- rootWindow display screen
mainWindow <- createSimpleWindow
display
root
0 0 100 100
1
(blackPixel display screen)
(whitePixel display screen)
setTextProperty display mainWindow "Subwindows" wM_NAME
subWindow <- createSimpleWindow
display
mainWindow
0 0 100 100
1
(whitePixel display screen)
(blackPixel display screen)
mapWindow display subWindow
mapWindow display mainWindow
y $ \loop -> allocaXEvent $ \eventPointer -> do
nextEvent display eventPointer
event <- get_EventType eventPointer
case () of
_ | event == expose -> loop
| otherwise -> return ()