Fullscreen windows - weird behaviour

Andreas Falkenhahn andreas at airsoftsoftwair.de
Mon May 17 07:17:22 PDT 2010


> Andreas Falkenhahn wrote:
>> Hi,
>>
>> I have the following setup:
>>
>> 1) An entirely black shielding window whose size is always set to the
>> dimensions of the current screen. _NET_WM_STATE is set to
>> _NET_WM_STATE_FULLSCREEN for this window. This window is used to cover
>> the
>> standard parts of the desktop like the task bar at the bottom and
>> possibly
>> a menu bar at the top.
>>
>> 2) On top of this shielding window is my main window which is usually a
>> little bit smaller than the shielding window. The main window is
>> centered
>> above the shielding window. To make sure that the shielding window never
>> gets in front of my main window, I'm also setting the transient for hint
>> like this:
>>
>> XSetTransientForHint(display, main_window, shielding_window);
>>
>> This is all working fine except in one case: When I change the screen
>> mode
>> using XF86VidModeSwitchToMode(). In that case, the taskbar suddenly pops
>> up when clicking a little bit at the bottom area of the shielding
>> window.
>> This is very weird because the area is clearly occupied by my shielding
>> window and mouse clicks shouldn't be passed through to the any other
>> window!? How does it come that the task bar suddenly gets notified
>> although I'm clearly clicking on the shielding window?
>>
>> Is there any way to change this behaviour? I also tried to do an
>> XGrabPointer() on my main window but this still doesn't prevent the task
>> bar from popping up when clicking in the bottom area of the shielding
>> window! Why is that? And why is it only when I change the screen mode
>> using XF86VidModeSwitchToMode()? If I don't change the screen mode,
>> there
>> is no way to bring up the task bar by clicking on the shielding window.
>> But as soon as I change the screen mode, the task bar can be accessed by
>> clicking several times on the bottom of the shielding window! Anybody
>> got
>> a clue what's going on there?
>
> You could add test code that uses XQueryTree() to find out why.
>
> http://tronche.com/gui/x/xlib/window-information/XQueryTree.html

Hmm, I'm not sure if this would help. What is really confusing me is the
fact that even when I call XGrabPointer() on my main window (mode set to
GrabModeAsync), I can still get the task bar to pop up. How can this
happen? Isn't XGrabPointer() supposed to intercept delivery of all mouse
events excepting the window specified in XGrabPointer()?

When I call XGrabPointer() without changing the screen mode using
XF86VidModeSwitchToMode() it works exactly like that: Everything on the
desktop except my window seems frozen. Clicking on the taskbar doesn't
trigger any action. It's completely dead. However, when calling
XGrabPointer() after XF86VidModeSwitchToMode(), it's possible to pop the
task bar to the front. It's pretty weird because I thought that after
XGrabPointer() the mouse would be completely mine until I call
XUngrabPointer().

Andreas



More information about the xorg mailing list