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 107347 - gtk_window_move() after showing window keeps the window from being focused on map
gtk_window_move() after showing window keeps the window from being focused on...
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: High normal
: METACITY2.6.x
Assigned To: Metacity maintainers list
Metacity maintainers list
: 107301 (view as bug list)
Depends on:
Blocks: 155450
 
 
Reported: 2003-03-01 20:00 UTC by Yao Zhang
Modified: 2004-12-28 06:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Windows that manually position themselves should be focused too (1.70 KB, patch)
2004-12-24 20:20 UTC, Elijah Newren
needs-work Details | Review
Add showing_for_first_time flag (1.67 KB, patch)
2004-12-28 02:58 UTC, Elijah Newren
accepted-commit_now Details | Review

Description Yao Zhang 2003-03-01 20:00:24 UTC
See #107301 filed under gtk+ 2.

I am using the default WM settings on a RedHat Phoebe 3, not mouse
focus.
Comment 1 Owen Taylor 2003-04-21 22:52:54 UTC
*** Bug 107301 has been marked as a duplicate of this bug. ***
Comment 2 Havoc Pennington 2003-09-25 03:11:58 UTC
Possible causes to investigate:
 - do we do initial window focus during placement and skip 
   placement if a position is set?
 - is it just that with mouse focus the window isn't coming 
   up under the pointer?
Comment 3 Elijah Newren 2004-12-24 20:20:44 UTC
Created attachment 35193 [details] [review]
Windows that manually position themselves should be focused too

The code looks (roughly) like this:

  if (did_placement)
    if (takes_focus_on_map)
     meta_window_focus (window,
	 meta_display_get_current_time_roundtrip(window->display));

where did_placement means "did metacity do the placement?".  Since the
application did the placement, this variable is false and thus everything else
is ignored.  I remember staring at the "if (did_placement)" for quite a while
when I was working on focus stealing prevention and wondering why in the world
it would possibly be there.  I couldn't find a single good reason for it, but
on the other hand I didn't have a good reason to remove it, so I didn't.  But
now we do have a good reason to get rid of it...
Comment 4 Havoc Pennington 2004-12-25 06:41:05 UTC
Comment on attachment 35193 [details] [review]
Windows that manually position themselves should be focused too

I think the idea of did_placement was to focus new windows, but not focus old
windows that are being re-shown.
In other words, to avoid focusing in all cases from inside implement_showing()

The trivial alternate patch would add a "shown for first time" flag to
MetaWindow, but perhaps we can think of something more elegant, I don't know.
Comment 5 Elijah Newren 2004-12-28 02:58:06 UTC
Created attachment 35248 [details] [review]
Add showing_for_first_time flag

I tried looking through the various flags we already had in window.h to see if
we had anything that would provide the information we wanted.  I couldn't see
anything, so I just went with the showing_for_first_time flag as you suggested.
Comment 6 Havoc Pennington 2004-12-28 05:22:15 UTC
Comment on attachment 35248 [details] [review]
Add showing_for_first_time flag

Simple enough, thanks.
Comment 7 Elijah Newren 2004-12-28 06:03:35 UTC
committed.