aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-03-09 17:25:10 +0100
committerDon Stewart <dons@cse.unsw.edu.au>2007-03-09 17:25:10 +0100
commite37a864f65682a05e80de51aab8ea7969798078d (patch)
treefa6b8d06e37046c8af1ccdd636b2103e0da7e68a
parent4b74875d710b8a0a6cdded02b6ff8ed85a88ecd3 (diff)
downloadxmonad-e37a864f65682a05e80de51aab8ea7969798078d.tar.gz
xmonad-e37a864f65682a05e80de51aab8ea7969798078d.tar.xz
xmonad-e37a864f65682a05e80de51aab8ea7969798078d.zip
notes on the firefox bug
basically we have to set focus ourselves. This means when we start managing a window, and when an XCrossingEvent occurs (which we don't handle). On Manage/Enter, we set focus. on Leave we set focus to root. See event.c and focus.c in dwm for more details. darcs-hash:20070309162510-9c5c1-142ded89f618d4234b7ad79265f63e9f5fd9f42f.gz
-rw-r--r--Main.hs20
1 files changed, 16 insertions, 4 deletions
diff --git a/Main.hs b/Main.hs
index 0d7569f..1f4ec0e 100644
--- a/Main.hs
+++ b/Main.hs
@@ -72,9 +72,9 @@ main = do
r <- io $ rootWindow dpy dflt
io $ sync dpy False
io $ selectInput dpy r $ substructureRedirectMask
- .|. substructureNotifyMask
- .|. enterWindowMask
- .|. leaveWindowMask
+ .|. substructureNotifyMask
+ .|. enterWindowMask
+ .|. leaveWindowMask
grabKeys dpy r
@@ -115,6 +115,11 @@ grabKeys dpy r = do
-- [LeaveNotify] = leavenotify,
-- [Expose] = expose,
-- [PropertyNotify] = propertynotify,
+--
+-- on EnterNotify we should SetFocus to the window we're entering,
+-- on LeaveNotify, we set it back to root.
+--
+-- Needs XCrossing support
--
handle :: Event -> W ()
@@ -199,11 +204,18 @@ windows f = do
-- | manage. Add a new window to be managed in the current workspace. Bring it into focus.
-- If the window is already under management, it is just raised.
+--
+-- When we start to manage a window, it gains focus.
+--
manage :: Window -> W ()
manage w = do
- withDisplay $ io . flip mapWindow w
+ withDisplay $ \d -> io $ do
+ mapWindow d w
+ -- setInputFocus d w revertToPointerRoot 0 -- CurrentTime
windows $ W.push w
+
+
-- | unmanage. A window no longer exists, remove it from the window
-- list, on whatever workspace it is.
unmanage :: Window -> W ()