codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

ManageDocks should check for multi window types in _NET_WM_WINDOW_TYPE #450

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
According to the spec:

_NET_WM_WINDOW_TYPE

_NET_WM_WINDOW_TYPE, ATOM[]/32

This SHOULD be set by the Client before mapping to a list of atoms indicating 
the functional type of the window. This property SHOULD be used by the window 
manager in determining the decoration, stacking position and other behavior of 
the window. The Client SHOULD specify window types in order of preference (the 
first being most preferable) but MUST include at least one of the basic window 
type atoms from the list below. This is to allow for extension of the list of 
types whilst providing default behavior for Window Managers that do not 
recognize the extensions.

http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html

What steps will reproduce the problem?

1. Launch a program with multiple window types like DOCK and NORMAL (tested 
with unity-2d panel and launcher)

What is the expected output? What do you see instead?

The window should be ignored and a gap must be created to accommodate it. 
Instead the window is treated normally.

What version of the product are you using? On what operating system?

0.9

Are you using an xmonad.hs?  Please attach it and the output of "xmonad
--recompile".

Any config with ManageDocks (tested with desktopConfig and manual ManageDocks) 
will do.

Please provide any additional information below.

I think checkDock function should be in a more generic place like 
Hooks/ManageHelpers that are currently using the isInProperty function to check 
for property values.

Original issue reported on code.google.com by icarnales on 7 May 2011 at 4:14

GoogleCodeExporter commented 8 years ago
Here's a simple patch which works for unity-2d-panel (from ubuntu)
It's probably not the best way to do it, I'm really new to haskell

diff -rN -u old-XMonadContrib/XMonad/Hooks/ManageDocks.hs 
new-XMonadContrib/XMonad/Hooks/ManageDocks.hs
--- old-XMonadContrib/XMonad/Hooks/ManageDocks.hs   2012-02-07 11:58:41.000000000 
+0100
+++ new-XMonadContrib/XMonad/Hooks/ManageDocks.hs   2012-02-07 11:58:41.000000000 
+0100
@@ -111,7 +111,7 @@
     desk <- getAtom "_NET_WM_WINDOW_TYPE_DESKTOP"
     mbr <- getProp32s "_NET_WM_WINDOW_TYPE" w
     case mbr of
-        Just [r] -> return $ elem (fromIntegral r) [dock, desk]
+        Just l   -> return $ any (\x -> elem (fromIntegral x) [dock, desk]) l
         _        -> return False

 -- | Whenever a new dock appears, refresh the layout immediately to avoid the

Original comment by max.thou...@gmail.com on 7 Feb 2012 at 11:02