help needed: window focus bugs



Hi,

A new feature in 2.7 is "focus stealing prevention," an implementation
of part of the extended window manager hints. KDE already implements
this feature.

Those of you running 2.7 have no doubt noticed there are some bugs left
;-) many of these require modifications to applications. It would be
very helpful if maintainers of applications that aren't getting focused
appropriately could help fix their applications.

If we can't get this working nicely by 2.8, disabling the feature
totally is a 1-line metacity patch (to unconditionally focus new
windows). But we should keep fixing and trying to get the feature in
until the last minute.

Before testing/fixing, be sure you have latest startup-notification,
metacity, libwnck, gtk+, and gnome-panel.

Roughly how the feature works: each time you interact with a window, a
hint called _NET_WM_USER_TIME is updated with the timestamp of the
interaction.

New windows can also have this timestamp; and a timestamp can be
associated with an application launch sequence using startup
notification.

For a new window, if the timestamp is not present (e.g. a legacy app not
using GTK+) or if the timestamp is newer than the last interaction with
the active window, the window will be focused.

However, if you've interacted with the active window, the new window
will not steal focus. So e.g. if you launch an app, and then start
typing a password, the app should not get focus since the launch
timestamp is older than the latest interaction.

Apps may also explicitly set the timestamp to 0, which means to never
focus that new window. e.g. an IM client might use this.

When does it break: the most common problem right now is launching new
windows for existing apps. e.g. clicking the Epiphany launcher while
Epiphany is already running. In this case, the timestamp from the
startup notification does not get forwarded to the new Epiphany window;
instead the timestamp from the last interaction with Epiphany is used.
So it's likely that the new window won't be focused.

A possible global fix is to change GTK+, but I'm not sure that's right.

Even if that fix goes in, the truly correct change is for epiphany to
forward the timestamp (and the startup notification ID) to the new
window from the launch sequence. gnome-terminal has an example of doing
this for startup notification ID.

The bug is: http://bugzilla.gnome.org/show_bug.cgi?id=149028

If I screwed this up, Elijah or Rob please correct me.

Havoc





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]