Bug 471250 - Rapid window switching in XFCE when multiple windows open
Summary: Rapid window switching in XFCE when multiple windows open
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-06-28 20:34 EDT by Pierce Hanley CLA
Modified: 2018-08-30 15:16 EDT (History)
3 users (show)

See Also:


Attachments
"xev" output for two rapidly-switching windows (49.75 KB, application/gzip)
2015-06-28 20:34 EDT, Pierce Hanley CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierce Hanley CLA 2015-06-28 20:34:31 EDT
Created attachment 254789 [details]
"xev" output for two rapidly-switching windows

In the XFCE window manager, loading a workspace with multiple windows will cause them to rapidly and repeatedly switch to the foreground. In real-life use this can happen many times, making the desktop unusable for several minutes since each switch steals the window manager focus.

Here's the most straightforward environment and minimal test case with which I've been able to reproduce this:
1) Run the Linux Mint 17.1 XFCE edition ISO in VirtualBox.
2) Download and extract the Eclipse platform runtime binary (eclipse-platform-4.5-linux-gtk-x86_64.tar.gz).
3) Launch Eclipse, and create a new workspace at some location (I just made a directory in /tmp).
4) Click "Workspace" to close the welcome screen.
5) Close every view except one (doesn't seem to matter which, but I chose "Tasks").
6) Go to Window → New Window.
7) Close every view in the new window.
8) Go to File → Exit (important: you must do this in the second window, the one that does *not* have any views).
9) Relaunch Eclipse, loading the same workspace.

If your experience is the same as mine, you'll see the two windows rapidly switch to the foreground a few dozen times.

I can reproduce the problem with the following variations (can't confirm whether or not it also occurs with others):
* Eclipse Mars or Luna
* XFCE 4.10 or 4.12
* Ubuntu 12.04, or Mint 16 or 17.1
* OpenJDK 7 or 8
* Using the default eclipse.ini settings, or setting launcher.GTK_version to 2

I was able to grab some X event data from two of the windows using xev, in case that helps. I've attached the logs. The switching has already started at the beginning of the log.

Additional notes/observations:

Minimizing all the views appears to be equivalent to closing them, for the purposes of this bug; what matters is whether they're actually visible.

Minimizing the "Shared Area" and/or hiding the toolbar do not seem to affect whether the bug occurs (though I can't say whether they influence the number of times the windows switch).

I have not been able to reproduce the bug in the MATE window manager, nor on Windows 8.1.

The number of workspace windows, whether or not they contain a view, and which window you exit from all seem to be important variables:
* In the case described above, the rapid switching will not occur if you exit from the window that *does* have a view in it. However, the window with no views will be in the foreground when Eclipse has finished launching even though you'd expect that the session remembered which window was active.
* The switching will occur if you have more than two windows, even if none of them contain a view.
* However, it appears that the window you exited from in the previous session will sometimes be excluded from the rapid switching (in other words, it won't be brought to the front). I can't figure out the exact parameters for this; it seems to be consistent as long as *none* of the other windows have a view in them, but inconsistent when any of the other windows has a view.

I don't know much about X internals, but the xev logs seem to show a lot of repetitive "_NET_WM_ICON_GEOMETRY" events. Pure speculation,  but maybe something about the view UI (e.g. the close/minimize/maximize tab buttons) is incorrectly or excessively triggering window events, or something (whether it's Eclipse or XFCE) is responding to the events incorrectly.
Comment 1 Eric Williams CLA 2018-08-30 15:16:14 EDT
GTK2 issues aren't being fixed, as GTK2 support is ending in 4.10.