GNOME Bugzilla – Bug 107347
gtk_window_move() after showing window keeps the window from being focused on map
Last modified: 2004-12-28 06:03:35 UTC
See #107301 filed under gtk+ 2. I am using the default WM settings on a RedHat Phoebe 3, not mouse focus.
*** Bug 107301 has been marked as a duplicate of this bug. ***
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?
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 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.
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 on attachment 35248 [details] [review] Add showing_for_first_time flag Simple enough, thanks.
committed.