! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Weird window focus behavior with xfwm4 ( and borderless urxvt


Description Yi Qiang 2006-05-30 20:22:37 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060504 Firefox/
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060504 Firefox/

I'm using the svn builds of xfce4 and ran across a strange problem with urxvt when it is run borderless.  There appears to be no way of getting the focus on the new urxvt window.  This behavior does not happen on xfwm4  Here is the xfwm4 --version output on the problematic box:

yi@veritas:~/ > xfwm4 --version
	This is xfwm4 version (revision 21877) for Xfce
	Released under the terms of the GNU General Public License.
	Compiled against GTK+-2.8.17, using GTK+-2.8.18.

	Build configuration and supported features:
	- Startup notification support:                 Yes
	- Render support:                               Yes
	- Xrandr support:                               Yes
	- Embedded compositor:                          Yes
	- KDE systray proxy (deprecated):               No

Let me know if there is any other information you need to debug.  

Reproducible: Always
Comment 1 Olivier Fourdan editbugs 2006-05-30 20:34:44 CEST
can you do an xprop on the window and post the results please?
Comment 2 Yi Qiang 2006-05-30 20:36:52 CEST
Sure thing, here it is:

WM_CLASS(STRING) = "urxvt", "URxvt"
                Client accepts input or input focus: True
                Initial state is Normal State.
                window id # of group leader: 0x2200004
                program specified minimum size: 7 by 15
                program specified resize increment: 7 by 15
                program specified base size: 0 by 0
                window gravity: NorthWest
WM_COMMAND(STRING) = { "urxvt" }
_NET_WM_ICON_NAME(UTF8_STRING) = 0x79, 0x69, 0x40, 0x76, 0x65, 0x72, 0x69, 0x74, 0x61, 0x73, 0x20, 0x7e, 0x20, 0x70, 0x74, 0x73, 0x2f, 0x36
WM_ICON_NAME(STRING) = "yi@veritas ~ pts/6"
_NET_WM_NAME(UTF8_STRING) = 0x79, 0x69, 0x40, 0x76, 0x65, 0x72, 0x69, 0x74, 0x61, 0x73, 0x20, 0x7e, 0x20, 0x70, 0x74, 0x73, 0x2f, 0x36
WM_NAME(STRING) = "yi@veritas ~ pts/6"

Also, this windows is "sticky", it appears in all virtual desktops. 
Comment 3 Olivier Fourdan editbugs 2006-05-30 20:45:35 CEST
What params do you use to run rxvt?
Comment 4 Yi Qiang 2006-05-30 20:46:49 CEST
Here is my .Xdefaults

! ~./Xdefaults

Xft.dpi: 111
Rxvt.color2:    rgb:67/b4/7e
Rxvt.color10:   rgb:78/ed/97

Rxvt.color4:    rgb:33/66/99
Rxvt.color12:   rgb:55/55/ff

Rxvt.color5:    rgb:ba/ab/cc
Rxvt.color13:   rgb:c1/b3/d1

Rxvt.color6:    rgb:62/b3/e1
Rxvt.color14:   rgb:6f/c0/c0

Rxvt.color7:    rgb:c6/dd/f1
Rxvt.color15:   rgb:f4/fa/ff

Rxvt.color1:    rgb:e5/95/95
Rxvt.color9:    rgb:f2/66/66

Rxvt.color11:   gold

urxvt.scrollBar: false
urxvt.foreground: black
urxvt.background: white
urxvt.cursorColor: black
urxvt.cursorColor2: black
urxvt.loginShell: false
urxvt.externalBorder: 2
urxvt.internalBorder: 0
urxvt.font:xft:Bitstream Vera Sans Mono:size=8
urxvt.scrollTtyOutput: false 
urxvt.borderLess: true
Comment 5 Yi Qiang 2006-05-30 20:47:11 CEST
So, no additional parameters besides what's in Xdefaults. 
Comment 6 Olivier Fourdan editbugs 2006-05-30 20:49:05 CEST
ok, can you do an xwininfo on the window and post the result?
Comment 7 Yi Qiang 2006-05-30 20:53:05 CEST
xwininfo: Window id: 0x2c00004 "yi@veritas ~ pts/10"

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 560
  Height: 360
  Depth: 24
  Visual Class: TrueColor
  Border width: 2
  Class: InputOutput
  Colormap: 0x3d (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: yes
  Corners:  +0+0  -708+0  -708-632  +0-632
  -geometry 80x24+0+0
Comment 8 Olivier Fourdan editbugs 2006-05-30 21:07:46 CEST
You have the answer here :

  Override Redirect State: yes

Override redirect windows are not managed by the WM, so it cannot be a bug in the window manager. Metacity and kwin behaves exactly the same way and do not focus rxvt-unicode when it sets its state to "override redirect".

That's a bug in rxvt-unicode. rxvt should not use override redirect to get borderless window, it's not the right to do things. Override redirect should only be used for short-lived temporary windows, such as popup menus or tooltips.
Comment 9 Olivier Fourdan editbugs 2006-05-30 21:27:05 CEST
Humm; Now it works. Odd things are happening, I reopen the bug for further investigations.
Comment 10 Olivier Fourdan editbugs 2006-05-30 22:23:14 CEST
Can you try with revision 21917 (or later)? Seems to work for me here.
Comment 11 Yi Qiang 2006-05-30 22:24:17 CEST
Do I just need to upgrade xfwm4?  I am using someone elses svn builds of xfce4.  If it's just that one package, then I can upgrade it without a problem.  
Comment 12 Olivier Fourdan editbugs 2006-06-01 20:52:42 CEST
It's just xfwm4 from SVN trhunk. BTW, I can't reproduce the issue with current xfwm4.
Comment 13 Yi Qiang 2006-06-01 20:54:52 CEST
	This is xfwm4 version (revision 21935) for Xfce
	Released under the terms of the GNU General Public License.
	Compiled against GTK+-2.8.18, using GTK+-2.8.18.

Ok, it seems to work fine on my local computer, however the behavior is broken when I try to access my desktop via nxclient.  If you would like to try it yourself, I am using the free implementation freenx.  
Comment 14 Olivier Fourdan editbugs 2006-06-02 17:04:59 CEST
Humm, I don't particularly feel like installing non free software just to reproduce bugs in a third party application ;)

Did you try with other window managers such as metacity or kwin? Here, the problem showed in all window managers I tried so I'm not really sure that problem in related to xfce.
Comment 15 Olivier Fourdan editbugs 2006-06-03 06:55:21 CEST
Okay... I did try again, and the problem randomly appears in all the environments I tried so it's not related to either xfce or freeNX (which is not a proprietary software as I stated earlier, my bad, sorry), so my first initial analysis of the problem was correct and this bug should be resolved as invalid.

Anyway, I looked a bit at rxvt-unicode source code and that patch to rxvt-unicode mlight help (I think it's an initialization bug in the override-redirect property).

--- init.C.orig  2006-06-03 08:48:02.000000000 +0200
+++ init.C      2006-06-03 08:47:13.000000000 +0200
@@ -895,7 +895,7 @@

   parent = display->root;

-  attributes.override_redirect = !!OPTION (Opt_override_redirect);
+  attributes.override_redirect = (!!OPTION (Opt_override_redirect) ? True : False);

   if (OPTION (Opt_borderLess))
Comment 16 Olivier Fourdan editbugs 2006-06-03 07:52:55 CEST
Ah! Found out! rxvt is testing for the _MOTIF_WM_INFO atom to be present and if not, it sets the window to be override redirect (bad idea).

As the WM doesn't create this atom (why should it, the atom used for decorations is _MOTIF_WM_HINTS), rxvt creates an override redirect window.

Once at least one real Motif app has been launched, the atom gets created and rxvt behaves correctly. That's why I found that the problem was randomly showing.
Comment 17 Olivier Fourdan editbugs 2006-06-03 07:55:46 CEST
Ok, so create that _MOTIF_WM_INFO atom from xfwm4 to make rxvt happy.

Bug #1877

Reported by:
Yi Qiang
Reported on: 2006-05-30
Last modified on: 2009-07-14


Olivier Fourdan
CC List:
0 users



Additional information