aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorSpencer Janssen <spencerjanssen@gmail.com>2008-10-22 00:00:59 +0200
committerSpencer Janssen <spencerjanssen@gmail.com>2008-10-22 00:00:59 +0200
commit92d7fd5a58ef27216b416617001b73e7f5ce969e (patch)
tree89ce03de9145c5bae69ab33d018ecf7401056077 /XMonad
parentdccc7f3654ba5f3e9e6c2d56f121059957b438b6 (diff)
downloadxmonad-92d7fd5a58ef27216b416617001b73e7f5ce969e.tar.gz
xmonad-92d7fd5a58ef27216b416617001b73e7f5ce969e.tar.xz
xmonad-92d7fd5a58ef27216b416617001b73e7f5ce969e.zip
Fix #192.
darcs-hash:20081021220059-25a6b-11b9b480bec9d902626f1c0c281333470e76e245.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Main.hsc19
1 files changed, 12 insertions, 7 deletions
diff --git a/XMonad/Main.hsc b/XMonad/Main.hsc
index 945c5ea..454a3e6 100644
--- a/XMonad/Main.hsc
+++ b/XMonad/Main.hsc
@@ -65,6 +65,18 @@ xmonad initxmc = do
let dflt = defaultScreen dpy
rootw <- rootWindow dpy dflt
+
+ -- If another WM is running, a BadAccess error will be returned. The
+ -- default error handler will write the exception to stderr and exit with
+ -- an error.
+ selectInput dpy rootw $ substructureRedirectMask .|. substructureNotifyMask
+ .|. enterWindowMask .|. leaveWindowMask .|. structureNotifyMask
+ sync dpy False -- sync to ensure all outstanding errors are delivered
+
+ -- turn off the default handler in favor of one that ignores all errors
+ -- (ugly, I know)
+ xSetErrorHandler -- in C, I'm too lazy to write the binding: dons
+
xinesc <- getCleanedScreenInfo dpy
nbc <- do v <- initColor dpy $ normalBorderColor xmc
~(Just nbc_) <- initColor dpy $ normalBorderColor Default.defaultConfig
@@ -107,13 +119,6 @@ xmonad initxmc = do
, waitingUnmap = M.empty
, dragging = Nothing }
- xSetErrorHandler -- in C, I'm too lazy to write the binding: dons
-
- -- setup initial X environment
- sync dpy False
- selectInput dpy rootw $ substructureRedirectMask .|. substructureNotifyMask
- .|. enterWindowMask .|. leaveWindowMask .|. structureNotifyMask
-
allocaXEvent $ \e ->
runX cf st $ do