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 149276 - new windows don't get the first plan, focus is removed -> 2.8.2 is not usable
new windows don't get the first plan, focus is removed -> 2.8.2 is not usable
Status: RESOLVED DUPLICATE of bug 149028
Product: metacity
Classification: Other
Component: general
2.8.x
Other Linux
: High major
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2004-08-04 11:43 UTC by Sebastien Bacher
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
disable the prevention of focus stealing logic (728 bytes, patch)
2004-08-04 15:58 UTC, Elijah Newren
none Details | Review
Disable focus-stealing logic for specific applications (1.33 KB, patch)
2004-08-16 02:31 UTC, Elijah Newren
none Details | Review

Description Sebastien Bacher 2004-08-04 11:43:08 UTC
* Open a window and maximize it (say a gnome-terminal)
* Start an app (launcher on the panel, alt+f2...)
* You loose the focus on the window you were using and don't see the app you
have just launched in fact the app is hidden behind the current one.

There are 2 severes issue here:
* the new window should be displayed on the first plan, you don't even now that
it has been opened if you don't look on the window_list applet in the current
state, really annoying
* the current app or the new open one should get the focus ... if I'm using a
gnome-terminal and I open a new one you just loose what you are entering (it's
not in the first and not in the second)
Comment 1 Vincent Noel 2004-08-04 13:08:51 UTC
I have metacity 2.8.2 and it works as expected here...
I think you need to upgrade libwnck and gnome-panel as well (they need to
interact somehow for the good focus to be set)
Comment 2 Sebastien Bacher 2004-08-04 13:44:40 UTC
I'm using libwnck 2.7.90 and gnome-panel 2.7.4.1 which are the last releases ...
Comment 3 Vincent Noel 2004-08-04 14:41:22 UTC
I bet you also have startup-notification 0.7 ? I'm trying to understand how it
could work as expected on my setup...
Comment 4 Elijah Newren 2004-08-04 15:16:15 UTC
This sounds like the behavior that would happen with the new metacity before bug
136278 and bug 144897 were fixed/worked-around.  Did you update gtk+ &
gnome-desktop & startup-notification & gnome-panel & nautilus & libwnck, in
addition to metacity?  (Things won't work correctly unless ALL of those have
been updated).  I believe releases have been made of all of those, but I could
be wrong.

If you have updated all of those, please provide the exact tarball numbers so
that I can try it, because it works fine for me on a HEAD build.

One final question: Do you interact with the maximized window after launching
the other app but before that other app appears?  If so, this is NOTABUG.  If
not, we'll track down the problem.
Comment 5 Sebastien Bacher 2004-08-04 15:29:24 UTC
The versions I'm using:

gtk+ 2.4.4
gnome-desktop 2.7.90
libstartup-notification 0.7
gnome-panel 2.7.4.1
libwnck 2.7.90
nautilus 2.7.2

I've an epiphany maximized here. If I click on my gnome-terminal launcher in the
panel it opens it behind the epiphany window. 

Apparently the problem doesn't happen with all the app (I've just noticed it).
With totem/rhythmbox/gedit/gnumeric/devhelp it works fine, but if I start
epiphany or gnome-terminal I've the problem
Comment 6 Elijah Newren 2004-08-04 15:58:15 UTC
Created attachment 30208 [details] [review]
disable the prevention of focus stealing logic

Ah, yes, that's the "we need to do startup-notification-timestamp-forwarding"
problem.  Sorry for the inconvenience.	We're working on it.  Here's a patch
that will disable the prevention of focus stealing logic until we can get it
fixed.
Comment 7 Elijah Newren 2004-08-04 16:04:37 UTC

*** This bug has been marked as a duplicate of 149028 ***
Comment 8 Sebastien Bacher 2004-08-04 16:37:42 UTC
thanks for the patch, it fixes the issue
Comment 9 Sebastien Bacher 2004-08-15 21:45:21 UTC
the patch doesn't apply with 2.8.3 anymore and the problem is still here ... any
solution ?
Comment 10 Rob Adams 2004-08-15 21:51:02 UTC
Please see Bug 149028
Comment 11 Elijah Newren 2004-08-16 02:31:56 UTC
Created attachment 30575 [details] [review]
Disable focus-stealing logic for specific applications

Here's a different way to avoid the focus-stealing bugs.  This patch turns of
the focus-stealing stuff _only_ for the apps that it appears to be breaking on.
 It'll apply against Metacity 2.8.3 and CVS HEAD.
Comment 12 Elijah Newren 2004-08-16 03:23:02 UTC
Actually, let me clarify that.  The patch from comment 11 only turns off
focusing-stealing-prevention for apps that focus-stealing-prevention appears to
be breaking on *when _NET_WM_USER_TIME is already set* (i.e. for the second or
later window of the app).  There's no reason to turn it off for the first window
since that already works.
Comment 13 Havoc Pennington 2004-08-16 14:01:31 UTC
I think I had a bug open once for a blacklist/whitelist feature... hardcoding it
in the WM is pretty bad, you really want to load a directory full of files
(including a systemwide dir and a per-user dir, may as well use freedesktop.org
basedir spec).

The reason it needs to be files is that you can then give customers and
individual users the ability to work around local problems.

I don't really think we should do this hack, if we can't fix the apps let's just
turn off the feature for 2.8.

Anyway, my basic idea on the black/whitelist feature is to have a bunch of flags
for each app:
 <define wmclass="foo" title="bar"> <!-- this is a match rule that can have 
                                         various attributes -->
    <flag name="net_wm_user_time_broken"/>
    <flag name="needs_alt_key_passed_through"/>
 </define>

Then in metacity we would have:
 if (meta_bwlist_window_has_flag (window, "net_wm_user_time_broken"))
    /* blah blah */ ;

Anyway, this design discussion probably belongs on a separate bug.
Comment 14 Elijah Newren 2004-08-16 16:22:49 UTC
Yeah, I think turning it off altogether would be better, but I was hoping that
by providing this hack people might report other problems we were previously
unaware of instead of just turning focus-stealing-prevention off.

The whitelist/blacklist files sound like an interesting job...for someone else
to do.  ;-)