import Graphics.UI.Gtk
import Control.Monad (when)
import Control.Monad.Trans (liftIO)

maximumWindowDimensions :: IO ()
maximumWindowDimensions = do
    
    initGUI
    
    window <- windowNew
    
    on window objectDestroy mainQuit
    
    on window configureEvent printSize
    
    screen <- windowGetScreen window
    
    x <- screenGetWidth screen
    y <- screenGetHeight screen
    
    putStrLn ("The screen is " ++ show x ++ " pixels wide and " ++
        show y ++ " pixels tall for an undecorated fullscreen window.")
    
    windowMaximize window
    widgetShowAll window
    
    
    mainGUI











printSize :: EventM EConfigure Bool
printSize = do
    
    w <- eventWindow
    
    s <- liftIO $ drawWindowGetState w
    when (WindowStateMaximized `elem` s) $ do
        
        (x, y) <- eventSize
        
        liftIO $ putStrLn ("The inner window region is now " ++ show x ++
            " pixels wide and " ++ show y ++ " pixels tall.")
    return True