@@ -93,16 +93,20 @@ intMkVty kvar fend t = do
9393 let inner_update in_pic = do
9494 b <- display_bounds t
9595 let DisplayRegion w h = b
96− Cursor x y = pic_cursor in_pic
97− x' = case x of
98− _ | x >= 0x80000000 -> 0
99− | x >= w -> w - 1
100− | otherwise -> x
101− y' = case y of
102− _ | y >= 0x80000000 -> 0
103− | y >= h -> h - 1
104− | otherwise -> y
105− in_pic' = in_pic { pic_cursor = Cursor x' y' }
96+ cursor = pic_cursor in_pic
97+ in_pic' = case cursor of
98+ Cursor x y ->
99+ let
100+ x' = case x of
101+ _ | x >= 0x80000000 -> 0
102+ | x >= w -> w - 1
103+ | otherwise -> x
104+ y' = case y of
105+ _ | y >= 0x80000000 -> 0
106+ | y >= h -> h - 1
107+ | otherwise -> y
108+ in in_pic { pic_cursor = Cursor x' y' }
109+ _ -> in_pic
106110 mlast_update <- readIORef last_update_ref
107111 update_data <- case mlast_update of
108112 Nothing -> do