After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580572 - Windows don't open with focus
Windows don't open with focus
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-04-28 09:56 UTC by Mike Bursell
Modified: 2009-05-01 23:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Avoid clobbering the root window event mask (2.19 KB, patch)
2009-05-01 22:43 UTC, Owen Taylor
none Details | Review

Description Mike Bursell 2009-04-28 09:56:51 UTC
Please describe the problem:
When opening a new window via an application, I'd expect it to have focus, but this seems not to be the case.  The only app I use regularly that opens new windows is Evolution, but it's reproducable on this every time.

Steps to reproduce:
1. Open evolution.
2. If you have several accounts, password prompt windows pop up, one after the other
3. Normal behaviour is that focus will pass to the next one whenever you close the previous one (by entering a password and pressing "Return" or clicking "OK").
4. Focus stays with the same window.
5. Same behaviour when you double click to open a message window.
6. Same behaviour when you right click on the message in the list and choose "Move to folder...".  This is where it becomes most annoying, as I have several hundred folders, and rely on keyboard completion to choose one, but if I have to click on the window to give it focus, it's missing the point.


Actual results:
Each window pops up without focus, which stays with the main application.

Expected results:
I'd expect each new window to open with focus.

Does this happen every time?
Yes.

Other information:
Comment 1 Owen Taylor 2009-05-01 22:43:22 UTC
Created attachment 133765 [details] [review]
Avoid clobbering the root window event mask

Calling gdk_window_get_events() then gdk_window_set_events() will
remove "exotic" X event masks that GDK doesn't know about like
SubstructureRedirectMask. A window manager that doesn't select
for SubstructureRedirectMask on the root window is no longer
really a window manager, so various Bad Things were happening.

We can just piggy-back on Mutter selecting for PropertyNotify
events on the root window, so removing the code works fine.

http://bugzilla.gnome.org/show_bug.cgi?id=580572 (reported by Mike Bursell)
Comment 2 Owen Taylor 2009-05-01 23:41:09 UTC
Pushed with some comment improvements suggested by Marina.