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 766243 - Improve handling of tracking the old focused window during restart
Improve handling of tracking the old focused window during restart
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-05-10 21:42 UTC by Owen Taylor
Modified: 2016-07-20 10:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improve handling of tracking the old focused window during restart (4.06 KB, patch)
2016-05-10 21:42 UTC, Owen Taylor
accepted-commit_now Details | Review

Description Owen Taylor 2016-05-10 21:42:50 UTC
When restarting (X compositor only, obviously), we want to keep
the same window focused. There is code that tries to do this by
calling XGetInputFocus() but the previously focused window will
almost certainly not still be focused by the time we get to the
point where we call XGetInputFocus(), and in fact, probably was
no longer correct after the previous window manager exited, so
the net result is that we tend to focus no window on restart.

A better approach is to leave the _NET_ACTIVE_WINDOW property
set on the root window during exit, and if we find it set when
starting, use that to initialize focus.
Comment 1 Owen Taylor 2016-05-10 21:42:53 UTC
Created attachment 327616 [details] [review]
Improve handling of tracking the old focused window during restart
Comment 2 Rui Matos 2016-05-11 17:02:25 UTC
Review of attachment 327616 [details] [review]:

great, this has always bothered me a bit

::: src/core/display.c
@@ -931,3 @@
-    meta_error_trap_push (display);
-
-    /* FIXME: This is totally broken; see comment 9 of bug 88194 about this */

yay for getting rid of something totally broken!
Comment 3 Florian Müllner 2016-07-20 10:21:19 UTC
This landed, closing.