Comment 55 for bug 35876

Revision history for this message
Loye Young (loyeyoung) wrote : Re: [Bug 35876] Re: 'Downloading package information' and 'building dependency tree' progress dialogs steal focus

[banging head on desk]

Update-manager doesn't get focus randomly. It has to ask for it. The
window manager (metacity) just does what it's told to do. Anything the
window manager does to prevent focus-stealing is a sub-optimal
solution, but it's a necessary one when applications are written
egocentrically. (By this, I'm not talking about the developer's mental
health issues: we're all egocentric. An egocentric application means
an application written as if the application is either the only
application running or the most important application to the user at
the time)

"Obviously, it's not a small, simple fix."

Contrary to Sarah's assertion, setting "focus_on_map" to "false" in
every instance it appears in update-manager *fixes* update-manager:
Update-manager ceases to steal focus when that's done.

Here are the files affected:
./data/glade/UpdateManager.glade
./AutoUpgradeTester/DistUpgrade/DistUpgrade.glade
./DistUpgrade/DistUpgrade.glade
./debian/update-manager/usr/share/update-manager/glade/UpdateManager.glade
./debian/update-manager/usr/share/update-manager/glade/DistUpgrade.glade
./debian/tmp/usr/share/update-manager/glade/UpdateManager.glade
./debian/tmp/usr/share/update-manager/glade/DistUpgrade.glade

Unfortunately, it doesn't fix gkdebconf or debconf's frontends, which
ALSO have the same bug. Here's how to fix those:

gkdebconf (I'm using version 1.2.64ubuntu1 to test):
Insert the following line 101 in ./src/interface.c:
<code>
gtk_window_set_focus_on_map (GTK_WINDOW(win), FALSE);
</code>
and recompile.

debconf (I'm using version 1.5.20):
Insert the following line 70 to /usr/share/perl5/Debconf/FrontEnd/Gnome.pm:
<code>
$this->win->set_focus_on_map(0);
</code>
Fixing the other frontends (e.g., KDE) are left as an exercise.

Caveat: The changes to update-manager described above need to be fine
tuned. It's a Good Thing (tm) to allow the GtkWindow to get focus when
the user fires up Update-Manager the first time. I just didn't have
the patience to figure where in the code that is.

Happy Trails,

Loye Young
Isaac & Young Computer Company
Laredo, Texas
http://www.iycc.net