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 342411 - totem locks when finish playing a media with a menu open
totem locks when finish playing a media with a menu open
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: general
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
: 345699 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-05-20 14:31 UTC by Sebastien Bacher
Modified: 2006-06-23 10:45 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
possible fix (1.54 KB, patch)
2006-06-12 17:57 UTC, Tim-Philipp Müller
committed Details | Review

Description Sebastien Bacher 2006-05-20 14:31:49 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/totem/+bug/45730

"Description of the problem:
If the Sound -> Languages menu is open when a media finishes playing then totem will lockup and GNOME will no longer respond to mouse clicks.

Steps to reproduce:
1. Run
totem /usr/share/sounds/login.wav
2. While it is playing but before it is finished go to the Sound -> Languages menu so that Auto and Uncompressed 16-bit PCM audio are displayed.
3. Wait for the login sound to finish playing.

Expected results:
Menu to be closed? Totem and desktop to remain responsive and to redraw themselves.

Actual results:
Part of the desktop stops being redrawn. Applets continue to redraw themselves. Desktop and every application (including applets) stops responding to mouse input, alt tab stops working etc. Only way to recover is to kill totem from a virtual terminal.

Additional information:
The following is printed when totem is launched from a terminal:
(totem:13430): Gtk-CRITICAL **: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

Version information:
totem 1.4.1-0ubuntu2"
Comment 1 Tim-Philipp Müller 2006-06-12 17:57:04 UTC
It seems to me this might be a bug somewhere deeper down the stack (Gtk+ maybe?). 

In any case, the attached patch seems to fix it.
Comment 2 Tim-Philipp Müller 2006-06-12 17:57:43 UTC
Created attachment 67203 [details] [review]
possible fix
Comment 3 Bastien Nocera 2006-06-12 18:16:38 UTC
Comment on attachment 67203 [details] [review]
possible fix

>Index: src/totem-menu.c
>===================================================================
>RCS file: /cvs/gnome/totem/src/totem-menu.c,v
>retrieving revision 1.20
>diff -u -p -r1.20 totem-menu.c
>--- src/totem-menu.c	28 Apr 2006 10:45:07 -0000	1.20
>+++ src/totem-menu.c	12 Jun 2006 17:53:05 -0000
>@@ -334,7 +334,7 @@ totem_sublang_equal_lists (GList *orig, 
> static void
> totem_languages_update (Totem *totem, GList *list)
> {
>-	GtkWidget *item, *submenu;
>+	GtkWidget *item, *submenu, *old_submenu;
> 	GtkWidget *lang_menu;
> 	int current;
> 
>@@ -348,6 +348,13 @@ totem_languages_update (Totem *totem, GL
> 
> 	/* Languages */
> 	item = glade_xml_get_widget (totem->xml, "tmw_languages_menu_item");
>+
>+	old_submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (item));
>+	if (old_submenu != NULL)
>+	{
>+		gtk_menu_popdown (GTK_MENU (old_submenu));
>+	}

Don't need braces when it's only one line.

> 	submenu = glade_xml_get_widget (totem->xml, "tmw_menu_languages");
> 	if (lang_menu == NULL)
> 	{
>@@ -365,7 +372,7 @@ totem_languages_update (Totem *totem, GL
> static void
> totem_subtitles_update (Totem *totem, GList *list)
> {
>-	GtkWidget *item, *submenu;
>+	GtkWidget *item, *submenu, *old_submenu;
> 	GtkWidget *sub_menu;
> 	int current;
> 
>@@ -379,6 +386,13 @@ totem_subtitles_update (Totem *totem, GL
> 
> 	/* Subtitles */
> 	item = glade_xml_get_widget (totem->xml, "tmw_subtitles_menu_item");
>+
>+	old_submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (item));
>+	if (old_submenu != NULL)
>+	{
>+		gtk_menu_popdown (GTK_MENU (old_submenu));
>+	}

Same here.

Rest looks good to go. Please commit to gnome-2-14 and HEAD.
Comment 4 Tim-Philipp Müller 2006-06-13 09:30:57 UTC
Thanks, committed (minus those braces):

 2006-06-13  Tim-Philipp Müller  <tim at centricular dot net>

       * src/totem-menu.c: (totem_languages_update),
       (totem_subtitles_update):
         Pop down language/subtitle menus before replacing them
         with a different one, otherwise the session might lock
         up hard if a menu is replaced while being open (#342411).

Comment 5 Bastien Nocera 2006-06-23 10:45:55 UTC
*** Bug 345699 has been marked as a duplicate of this bug. ***