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 647165 - Open chat with contact should put chat window in focus
Open chat with contact should put chat window in focus
Status: RESOLVED DUPLICATE of bug 647275
Product: gnome-shell
Classification: Core
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-08 12:57 UTC by Andrew Overholt
Modified: 2011-04-13 06:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use the timestamp from GDK to really raise the window (2.73 KB, patch)
2011-04-11 14:57 UTC, Ken VanDine
none Details | Review

Description Andrew Overholt 2011-04-08 12:57:10 UTC
I'm using empathy-3.0.0-1.fc15.x86_64 (Fedora 15 pre-release).  If I double-click on a contact in my list to open a chat with that person, the newly-created chat window should be in focus by default.  Instead, I start typing, thinking that it's going to that window but instead it goes to the search field in the contact list.
Comment 1 Andreas Wallberg 2011-04-09 14:33:37 UTC
+1 I have the same problem in Arch Linux.
Comment 2 Guillaume Desmottes 2011-04-11 08:13:34 UTC
I suspect this may be a Shell/Mutter bug as, I think, Empathy is doing the right thing:

When requesting a chat, "empathy" does some D-Bus magic which will result in "empathy-chat" being asked to open a chat window. empathy passes the timestamp of the user event (gtk_get_current_event_time ()) so empathy-chat calls gtk_window_present_with_time() with this timestamp.


Can a Shell people (or something knowing about WM) can check that's the right thing to do?
Comment 3 Dan Winship 2011-04-11 13:46:15 UTC
there seems to be some sort of bug in gnome-shell/mutter that results in focus-stealing-prevention triggering when it shouldn't

*** This bug has been marked as a duplicate of bug 647275 ***
Comment 4 Ken VanDine 2011-04-11 14:57:26 UTC
Created attachment 185707 [details] [review]
Use the timestamp from GDK to really raise the window

I've had a patch to work around this problem in Ubuntu ever since we added libindicate support.  We have the same problem getting it to raise based on the dbus event, both with mutter and compiz.

I haven't been able to test this in gnome-shell yet, but I bet it will work around it for you as well.
Comment 5 Guillaume Desmottes 2011-04-11 15:11:39 UTC
Thanks for the patch Ken, but it looks a bit hacky. I'd rather do things the right way and fix WM when needed.
Comment 6 Ken VanDine 2011-04-11 15:23:17 UTC
Agreed, it is a hack.  But not everyone agrees that compiz's focus steal prevention wasn't doing the right thing.
Comment 7 Owen Taylor 2011-04-11 15:51:43 UTC
The problem to me appears that when Empathy reshows the chat window, it still has the timestamp from last time it was shown and the timestamp isn't updated. From Mutter logging in a pop-under case:

WINDOW_STATE: Showing window 0x34000c3 (Jonathan B), shaded: 0 iconic: 0 placed: 1
STARTUP: COMPARISON:
  net_wm_user_time_set : 1
  net_wm_user_time     : 564453264
  initial_timestamp_set: 0
  initial_timestamp    : 0
STARTUP: COMPARISON (continued):
  focus_window             : 0x2400003 (Contact Li)
  fw->net_wm_user_time_set : 1
  fw->net_wm_user_time     : 564488581
STARTUP: window 0x34000c3 (Jonathan B) focus prevented by other activity; 564453264 < 564488581
WINDOW_STATE: Window 0x34000c3 (Jonathan B) does not focus on map, and does not place on top on map.
STACK: Setting stack position of window 0x34000c3 (Jonathan B) to 4 (making it below window 0x2400003 (Contact Li)).
Comment 8 Guillaume Desmottes 2011-04-13 06:53:49 UTC
Ken: any chance you could try the patch solving bug #647275 and see if that works with Compiz as well?