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 150271 - timestamp issue, alt+F2 dialog doesn't get the focus with the new metacity
timestamp issue, alt+F2 dialog doesn't get the focus with the new metacity
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
2.7.x
Other Linux
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks: 149028
 
 
Reported: 2004-08-16 16:54 UTC by Sebastien Bacher
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which fixes the problem (6.11 KB, patch)
2004-08-18 03:31 UTC, Elijah Newren
needs-work Details | Review
Fixed up gnome-panel-alt-f2.patch (6.95 KB, patch)
2004-08-18 16:15 UTC, Elijah Newren
none Details | Review

Description Sebastien Bacher 2004-08-16 16:54:52 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.
Comment 1 Vincent Untz 2004-08-17 07:59:56 UTC
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?
Comment 2 Elijah Newren 2004-08-17 14:12:17 UTC
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.
Comment 3 Elijah Newren 2004-08-18 03:31:19 UTC
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.
Comment 4 Mark McLoughlin 2004-08-18 06:46:32 UTC
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
Comment 5 Elijah Newren 2004-08-18 16:15:36 UTC
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.