Scratchpad should match on class not on title

Hy, the scratchpad has a big problem: As soon as some console-applications (like mutt, mocp) change the title of the terminal xmonad looses the scratchpad and starts a new one. This is because XMonad tries to find the scratchpad using the title which is imho not a good idea for reasons mentioned above. I tried to change this by using "-name" instead of "-title" as parameter for the terminal. This also adds a new WM_CLASS to the window named like the parameter. This Class doesnt change if a application changes the title so xmonad could match on this. I tried both urxvt and xterm, they both behave the same way: if you supply "-name scratchpad" on the comandline a new WM_CLASS named "scratchpad" is added to the window. I tried to change it on my own by changing the commandline (this worked without a problem) and then exchange the "scratchpadQuery" with scratchpadQuery = className =? "scratchpad" This doesnt work, the managehook doesnt find the window, so something is wrong. As I got no haskell knowledge debugging is difficult, so perhaps somebody can help me. I checked the scratchpad-window using xprop and i DOES have the scratchpad-class, so the Query is somehow wrong. Who can help me? Thanks -- Dominik Bruhn mailto: dominik@dbruhn.de

On 2008 Jun 22, at 8:43, Dominik Bruhn wrote:
I tried to change this by using "-name" instead of "-title" as parameter for the terminal. This also adds a new WM_CLASS to the window named like the parameter. This Class doesnt change if a application changes the title so xmonad could match on this. I tried both urxvt and xterm, they both behave the same way: if you supply "-name scratchpad" on the comandline a new WM_CLASS named "scratchpad" is added to the window.
I tried to change it on my own by changing the commandline (this worked without a problem) and then exchange the "scratchpadQuery" with scratchpadQuery = className =? "scratchpad"
You are (as is common) being confused by the fact that WM_CLASS is an array, and the *second* element is "className". The first element (- name) is "resourceName". (This and the fact that the title is WM_NAME are easily the most confusing parts of working with X11.) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Brandon S. Allbery KF8NH wrote:
On 2008 Jun 22, at 8:43, Dominik Bruhn wrote:
I tried to change this by using "-name" instead of "-title" as parameter for the terminal. This also adds a new WM_CLASS to the window named like the parameter. This Class doesnt change if a application changes the title so xmonad could match on this. I tried both urxvt and xterm, they both behave the same way: if you supply "-name scratchpad" on the comandline a new WM_CLASS named "scratchpad" is added to the window.
I tried to change it on my own by changing the commandline (this worked without a problem) and then exchange the "scratchpadQuery" with scratchpadQuery = className =? "scratchpad"
You are (as is common) being confused by the fact that WM_CLASS is an array, and the *second* element is "className". The first element (-name) is "resourceName". (This and the fact that the title is WM_NAME are easily the most confusing parts of working with X11.)
Brandon is right. I actually made this patch on request from a user on #xmonad, because he was having this problem. I never pushed the patch since I wasn't sure it would work for all terminals, and the -title based solution had worked so far. I've pushed this patch to the repository, a darcs pull should have it matching on the resource name. Braden Shepherdson shepheb

On Sun, Jun 22, 2008 at 02:44:36PM -0400, Braden Shepherdson wrote:
Brandon is right. I actually made this patch on request from a user on #xmonad, because he was having this problem. I never pushed the patch since I wasn't sure it would work for all terminals, and the -title based solution had worked so far.
Wouldn't it be possible to do it in a surefire way via XChangeProperty or some such?

On 2008 Jun 22, at 17:10, Devin Mullins wrote:
On Sun, Jun 22, 2008 at 02:44:36PM -0400, Braden Shepherdson wrote:
Brandon is right. I actually made this patch on request from a user on #xmonad, because he was having this problem. I never pushed the patch since I wasn't sure it would work for all terminals, and the -title based solution had worked so far.
Wouldn't it be possible to do it in a surefire way via XChangeProperty or some such?
There are severe restrictions on XChangeProperty applied to the ICCCM properties. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (4)
-
Braden Shepherdson
-
Brandon S. Allbery KF8NH
-
Devin Mullins
-
Dominik Bruhn