GNOME Bugzilla – Bug 150271
timestamp issue, alt+F2 dialog doesn't get the focus with the new metacity
Last modified: 2004-12-22 21:47:04 UTC
This problem is due to the new focus mode in metacity, details are here in #149028 Apparently the panel is not setting its timestamp right.
The run dialog is not a new application (it's gnome-panel too). Elijah: should we set _NET_WM_USER_TIME for the run dialog? Is that all?
All windows that are mapped should either have a TIMESTAMP (comes from startup-notification and is only for the first mapped window of an app), or a _NET_WM_USER_TIME. Gtk+ will set _NET_WM_USER_TIME for windows beyond the first to the timestamp of the last user interaction with any window of the app when they are initially created. The _NET_WM_USER_TIME of that window is then updated by gtk+ whenever the user clicks on or types in that window. So, the problem is that when the user presses Alt+F2, they've interacted with another app more recently than gnome-panel...and the _NET_WM_USER_TIME field for the run dialog isn't updated to the timestamp corresponding to when Alt+F2 is pressed. This may actually be an interaction issue between metacity and gnome-panel if metacity isn't passing a timestamp to gnome-panel when it handles the Alt+F2 keybinding.
Created attachment 30686 [details] [review] Patch which fixes the problem So, getting this right does require metacity to send the correct timestamp, but metacity was already doing that (metacity/src/keybindings.c, function handle_panel_keybinding). gnome-panel was just ignoring the timestamp that was being passed. This patch makes gnome-panel use the timestamp and set it on the run dialog just before showing the window. It's my first gnome-panel patch, so let me know what problems you see. In particular, you may not like a certain function name that I added (basically copy and pasted without renaming), and you may not like my use of g_assert's. I do, but I'm weird.
The patch looks fine apart from ... Yeah, you're weird and no, I don't like them :-) Introducing an intentional namespace clash like this just doesn't work. What if I want to use gnome-panel 2.8 with gtk+ 2.6? And a lot of people will want to do that. Just call it panel_gdk_x11_ and log to remind us that it should be removed in GNOME 2.9 As for changing the g_return_val_if_fail - its not a terrible idea, in this specific case they would only be triggered by programming error, but I'd be much happier just leaving the function exactly as it is in gtk+. Also, please move it to panel-xutils.[ch] Anyway, feel free to commit when you've that done
Created attachment 30706 [details] [review] Fixed up gnome-panel-alt-f2.patch Okay, I made the changes you requested and committed as you said. Here is the final version of the patch for reference. However, to respond to one of your comments... Note that the extra function cannot be /exactly/ as it is in gtk+, because the gtk+ version has two extra lines to set an internal gtk+ variable (which variable does exist in gtk+-2.4.x with x>=1), but which we don't have access to.