! 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 !
QEMU emulator (AVD) window grabs focus and prevents me from switching workspace
Status:
RESOLVED: FIXED

Comments

Description Martin Edlman 2015-09-10 09:29:39 CEST
Hello,

When I start Android Virtual Device (AVD) which is actually QEMU, its windows grabs focus when I want to switch workspace.

I open XFCE menu - Settings - Window Manager Tweaks - Focus.

Scenarios:

* "When a windows raises itself" set to "Switch to windows's workspace".

- single AVD window on workspace 3
  Press hotkey to go to another workspace, the AVD window grabs the focus, raises itself and WM switches me back to workspace 3. I have to press the hotkey twice fast to go to another workspace.

- two AVDs on workspace 3
  There is no way to switch to another workspace, both windows grab focus.

- single or multiple ADVs minimized or rolled up
  It works as expected.

* "When a windows raises itself" set to "Do nothing"

- not focused single AVD window on workspace 3 
  It works. In this case the AVD windows stay on the workspace 3. But window name is displayed in "Windows buttons" on XFCE panel even on other workspaces.

- focused (raised) single AVD window on workspace 3 
  It works and the window name is NOT displayed in the "Window buttons" on other workspaces. 

- two AVDs on workspace 3 (same for focused or unfocused)
  It works but both windows names are displayed in the "Window buttons" on other workspaces.

The XFCE panel "Window buttons" is set to display only windows from current workspace.

Sometimes I need to be aware of other windows raising themselves so I would like to keep the setting on "Switch to windows's workspace".

AVD is running as 
/opt/android-sdk-linux/tools/emulator64-x86 -avd ICS_Google_SDK_x86_API15 -scale 0.35

Its window has these props (from xprop)
_NET_WM_ICON_GEOMETRY(CARDINAL) = 0, 61, 64, 25
_NET_WM_ICON(CARDINAL) = 	Icon (128 x 128):
... icon data ...
_NET_FRAME_EXTENTS(CARDINAL) = 4, 4, 48, 4
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MOVE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_STICK
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x69d33600
_NET_WM_DESKTOP(CARDINAL) = 2
_NET_WM_STATE(ATOM) = _NET_WM_STATE_DEMANDS_ATTENTION
_NET_WM_NAME(UTF8_STRING) = "5554:ICS_Google_SDK_x86_API15"
WM_NAME(STRING) = "5554:ICS_Google_SDK_x86_API15"
XdndAware(ATOM) = BITMAP
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 1
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 4951
WM_LOCALE_NAME(STRING) = "C"
WM_CLASS(STRING) = "emulator64-x86", "emulator64-x86"
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified location: 987, 0
		program specified minimum size: 333 by 299
		program specified maximum size: 333 by 299
WM_CLIENT_MACHINE(STRING) = "ntb-edas"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0, 0x195f4d0, 0xff, 0x195f4d0, 0x5e0000b, 0x2ad2930
Comment 1 Olivier Fourdan editbugs 2015-09-10 09:54:06 CEST
Not sure I understand.

If the the app grabs the keyboard (not the focus) then all events wil lgo to the app, so that is normal.

QEMU has a key combo to release the grab for this purpose.

If an app grabs the keyboard, there is nothing the window manager can do, that's a weakness (or a feature, depends what you expect) in X11.
Comment 2 Martin Edlman 2015-09-10 23:01:32 CEST
No the app doesn't have keyboard and mouse grabbed. Another window (e.g. Eclipse IDE) can be focused and receiving kbd and mouse events. 
I press Alt+F2 to switch to workspace 2, AVD windows gets focus and raises itself. When the AVD window is minimized or rolled up, it works fine.
Comment 3 Git Bot editbugs 2018-08-01 23:22:49 CEST
Olivier Fourdan referenced this bugreport in commit 95f6f7f85c04221794dcf66a4e1f312b7ce121f2

transients: Search for both client and window frame

https://git.xfce.org/xfce/xfwm4/commit?id=95f6f7f85c04221794dcf66a4e1f312b7ce121f2
Comment 4 Git Bot editbugs 2018-08-01 23:22:53 CEST
Olivier Fourdan referenced this bugreport in commit 1bb0aa4bf40d2bdd73d2966c001530731adcdef7

clients: Mark a client raising itself as from application

https://git.xfce.org/xfce/xfwm4/commit?id=1bb0aa4bf40d2bdd73d2966c001530731adcdef7

Bug #12206

Reported by:
Martin Edlman
Reported on: 2015-09-10
Last modified on: 2020-05-28

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Version:
4.12.0

Attachments

Additional information