GNOME Bugzilla – Bug 647165
Open chat with contact should put chat window in focus
Last modified: 2011-04-13 06:53:49 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.
+1 I have the same problem in Arch Linux.
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?
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 ***
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.
Thanks for the patch Ken, but it looks a bit hacky. I'd rather do things the right way and fix WM when needed.
Agreed, it is a hack. But not everyone agrees that compiz's focus steal prevention wasn't doing the right thing.
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)).
Ken: any chance you could try the patch solving bug #647275 and see if that works with Compiz as well?