GNOME Bugzilla – Bug 676076
policykit-gnome authentication dialog doesn't always focus with metacity
Last modified: 2019-02-23 02:45:04 UTC
Created attachment 214065 [details] [review] Patch to circumvent some window manager's focus-stealing prevention policykit-gnome's authentication dialog doesn't consistently get focused using metacity. One side effect of when the dialog doesn't get focused is that passwords can get mistakenly typed in plain sight into other windows, e.g., terminals. Here is the relevant launchpad bug: https://bugs.launchpad.net/ubuntu/+source/policykit-gnome/+bug/946171 I believe that this is related to metacity's focus-stealing prevention and the use of gtk_window_present() vs. gtk_window_present_with_time(). The function gtk_window_present() seems to use X11 server times from the last X timestamp received from some X event, which can be stale, and in the case of the first call to gtk_window_present(), 0 is used! metacity's output: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0xc00003 (Authentica) Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed. I've attached a patch with a proposed fix passing fresh X11 time stamps from gdk_x11_get_server_time() to gtk_window_present_with_time().
policykit-gnome is not under active development anymore. Its codebase has been archived: https://gitlab.gnome.org/Archive/policykit-gnome/commits/master Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather reactivate the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.