Issue 462 in xmonad: Ewmh desktop handle event doesn't correctly handle _NET_WM_DESKTOP message type

Status: New Owner: ---- New issue 462 by punitagr...@gmail.com: Ewmh desktop handle event doesn't correctly handle _NET_WM_DESKTOP message type http://code.google.com/p/xmonad/issues/detail?id=462 In xmonad-contrib source package, in the folder XMonad/Hooks/EwmhDesktops.hs in the "handle" function when processing "_NET_WM_DESKTOP" message type the argument n is checked for 0 <= n <= length ws. The specification at http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507080 states that when n is 0xffffffff the window is requesting to be placed on all desktops. Instead xmonad logs an error to .xsession-errors file. This bug triggered for me when trying to use xmonad as the window manager within kde. On launching krunner using "Windows-P" combination from kde4Config krunner doesn't appear. I am using ver 0.9.1 of xmonad on Kde 4.5.5 in Ubuntu 10.10. I had a quick look at the code to see if there was an easy fix but my Haskell is quite poor to attempt any changes. I'll be glad to test a fix though. Thanks, Punit Attachments: xmonad.hs.bak 2.2 KB

Updates: Owner: vogt.a...@gmail.com Cc: nome...@gmail.com Labels: Component-Contrib Comment #1 on issue 462 by vogt.a...@gmail.com: Ewmh desktop handle event doesn't correctly handle _NET_WM_DESKTOP message type http://code.google.com/p/xmonad/issues/detail?id=462 Sounds like a good idea. The following handleEventHook (based on the one in EwmhDesktops) should do that: import Control.Monad; import Data.Monoid; import XMonad; import qualified XMonad.StackSet as W import XMonad.Actions.CopyWindow; import XMonad.Util.WorkspaceCompare ewmhCopyWindow :: Event -> X All ewmhCopyWindow ClientMessageEvent { ev_window = w, ev_message_type = mt, ev_data = 0xffffffff : _ } = withWindowSet $ \s -> do a_cd <- getAtom "_NET_CURRENT_DESKTOP" when (mt == a_cd) $ do sort' <- getSortByIndex let ws = map W.tag $ sort' $ W.workspaces s windows $ foldr (.) id (map (copyWindow w) ws) return (All True) ewmhCopyWindow _ = return (All True) Then just add where you previously had: handleEventHook = ewmhDesktopsEventHook handleEventHook = ewmhDesktopsEventHook `mappend` ewmhCopyWindow This ewmhCopyWindow behaviour should probably be added to EwmhDesktops.

Excerpts from codesite-noreply's message of Sun Jul 17 21:45:00 -0600 2011:
Updates: .... Comment #1 on issue 462 by vogt.a...@gmail.com: Ewmh desktop handle event doesn't correctly handle _NET_WM_DESKTOP message type http://code.google.com/p/xmonad/issues/detail?id=462
Sounds like a good idea. The following handleEventHook (based on the one in EwmhDesktops) should do that:
.... ewmhCopyWindow :: Event -> X All ewmhCopyWindow ClientMessageEvent { ev_window = w, ev_message_type = mt, ev_data = 0xffffffff : _ } = withWindowSet $ \s -> do a_cd <- getAtom "_NET_CURRENT_DESKTOP" when (mt == a_cd) $ do sort' <- getSortByIndex let ws = map W.tag $ sort' $ W.workspaces s windows $ foldr (.) id (map (copyWindow w) ws) return (All True) ewmhCopyWindow _ = return (All True) .... This ewmhCopyWindow behaviour should probably be added to EwmhDesktops.
One thing to note is copyWindow doesn't act as expected with more than one screen. It is only able to map the copied window on one workspace. This causes flickering focus problems with at least some driver/X combinations. At its best it shows the copied window on the inactive rather than the active workspace, resulting in a frustrating inability to focus the copied window if that's needed. I did a little searching for "pinned window" code in other window managers, hoping for some clues as to how to better implement copyWindow, but haven't found anything yet. -- wmw
participants (2)
-
codesite-noreply@google.com
-
Wirt Wolff