diff options
Diffstat (limited to 'GLX.hs')
-rw-r--r-- | GLX.hs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -13,7 +13,7 @@ import Graphics.X11.Types import Graphics.X11.Xlib.Atom (internAtom) import Graphics.X11.Xlib.Display (defaultScreen, openDisplay, rootWindow) import Graphics.X11.Xlib.Event (XEventPtr, allocaXEvent, nextEvent, get_Window, get_EventType, pending) -import Graphics.X11.Xlib.Extras (ClassHint(..), getEvent, ev_event_type, ev_keycode, ev_data) +import Graphics.X11.Xlib.Extras (ClassHint(..), getEvent, ev_event_type, ev_width, ev_height, ev_keycode, ev_data) import Graphics.X11.Xlib.Misc (keycodeToKeysym, setWMProtocols) import Graphics.X11.Xlib.Types import Graphics.X11.Xlib.Window (destroyWindow, mapWindow, storeName) @@ -112,12 +112,14 @@ handleEvent glx disp xevent = do event <- getEvent xevent let evtype = ev_event_type event case () of - _ | evtype == keyPress -> do + _ | evtype == configureNotify -> do + return $ Just $ SomeEvent $ ResizeEvent (fromIntegral . ev_width $ event) (fromIntegral . ev_height $ event) + | evtype == keyPress -> do keysym <- keycodeToKeysym disp (ev_keycode event) 0 case () of _ | keysym == xK_Escape -> return $ Just $ SomeEvent QuitEvent | otherwise -> return Nothing - | evtype == clientMessage -> do + | evtype == clientMessage -> do if ((glxDeleteWindow glx) == (fromIntegral . head . ev_data $ event)) then return $ Just $ SomeEvent QuitEvent |