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 644936 - Don't update Contact menu on a focus-in
Don't update Contact menu on a focus-in
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
2.91.x
Other Linux
: Normal minor
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-03-16 17:11 UTC by Michael Terry
Modified: 2011-03-17 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (3.32 KB, patch)
2011-03-16 17:11 UTC, Michael Terry
reviewed Details | Review

Description Michael Terry 2011-03-16 17:11:28 UTC
Created attachment 183553 [details] [review]
Proposed patch

I discovered this issue while investigating why Ubuntu's new global menu caused empathy's Contact menu to not work.  (https://launchpad.net/bugs/729191)

Basically, chat windows like to refresh themselves on lots of different events (contact messages us, focus-in, contact is typing).  Part of that refresh is to update the Contact menu to be current.  This involves swapping out the submenu of the Contact toplevel menu item.

This isn't normally a problem, but imagine an external global menu system like indicator-appmenu or gnome2-globalmenu or some such.  You focus out to interact with the menu, and when you click an item, you focus back in to empathy.  Depending on how the global menu is implemented, there may have issues when empathy swaps out the menu.

In indicator-appmenu's case, there was a race condition between the focus-in event and the dbus message that a menu item was activated.  By the time the activation message arrived to empathy, it had usually already thrown out the menu item associated with the click.  So nothing would happen.

Long story short, empathy should never have to replace the Contact menu just on a focus-in (it'll be the same as when the user left the window, all else being equal) and it would help global menu implementations if it didn't pull the rug out.

Here's a patch to avoid it.
Comment 1 Guillaume Desmottes 2011-03-17 12:26:07 UTC
Review of attachment 183553 [details] [review]:

I'll make this trivial change myself and merge the patch; thanks !

::: src/empathy-chat-window.c
@@ +150,3 @@
 };
 
+static void chat_window_update (EmpathyChatWindow *window, gboolean via_focus_in);

I'd name it "update_contact_menu" instead; via_focus_in makes things the other way around.
Comment 2 Guillaume Desmottes 2011-03-17 12:33:14 UTC
Merged to 2.34 and master.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.