Commit 0162de44 authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/gui/gtk/gtk_callbacks.c: fixed a bug that caused crashes when

    doing fullscreen or volume up from the popup menu.
parent b8afd5b8
......@@ -2,7 +2,7 @@
* display.c: Gtk+ tools for main interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: display.c,v 1.8 2003/01/27 17:41:01 ipkiss Exp $
* $Id: display.c,v 1.9 2003/02/05 22:11:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -214,7 +214,7 @@ gint E_(GtkModeManage)( intf_thread_t * p_intf )
FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"),
FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_language"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"),
FALSE );
}
......
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.9 2003/01/31 09:51:57 sam Exp $
* $Id: gnome.c,v 1.10 2003/02/05 22:11:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -252,6 +252,12 @@ static void Run( intf_thread_t *p_intf )
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( gtk_object_get_data(
GTK_OBJECT(p_intf->p_sys->p_popup),
"popup_audio" ) ), "p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( gtk_object_get_data(
GTK_OBJECT(p_intf->p_sys->p_popup),
"popup_video" ) ), "p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playwin ),
"p_intf", p_intf );
......
......@@ -1259,17 +1259,17 @@
<widget>
<class>GtkMenuItem</class>
<name>audio1</name>
<name>popup_audio</name>
<label>Audio</label>
<right_justify>False</right_justify>
<widget>
<class>GtkMenu</class>
<name>audio1_menu</name>
<name>popup_audio_menu</name>
<widget>
<class>GtkPixmapMenuItem</class>
<name>popup_audio</name>
<name>popup_language</name>
<sensitive>False</sensitive>
<tooltip>Select audio channel</tooltip>
<label>_Language</label>
......@@ -1343,13 +1343,13 @@
<widget>
<class>GtkMenuItem</class>
<name>video1</name>
<name>popup_video</name>
<label>Video</label>
<right_justify>False</right_justify>
<widget>
<class>GtkMenu</class>
<name>video1_menu</name>
<name>popup_video_menu</name>
<widget>
<class>GtkPixmapMenuItem</class>
......
......@@ -936,7 +936,7 @@ create_intf_window (void)
return intf_window;
}
static GnomeUIInfo audio1_menu_uiinfo[] =
static GnomeUIInfo popup_audio_menu_uiinfo[] =
{
{
GNOME_APP_UI_ITEM, N_("_Language"),
......@@ -985,7 +985,7 @@ static GnomeUIInfo audio1_menu_uiinfo[] =
GNOMEUIINFO_END
};
static GnomeUIInfo video1_menu_uiinfo[] =
static GnomeUIInfo popup_video_menu_uiinfo[] =
{
{
GNOME_APP_UI_ITEM, N_("_Subtitles"),
......@@ -1132,14 +1132,14 @@ static GnomeUIInfo intf_popup_uiinfo[] =
{
GNOME_APP_UI_SUBTREE, N_("Audio"),
NULL,
audio1_menu_uiinfo, NULL, NULL,
popup_audio_menu_uiinfo, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_SUBTREE, N_("Video"),
NULL,
video1_menu_uiinfo, NULL, NULL,
popup_video_menu_uiinfo, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
......@@ -1244,85 +1244,85 @@ create_intf_popup (void)
gtk_widget_set_sensitive (intf_popup_uiinfo[12].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[13].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "audio1",
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio",
intf_popup_uiinfo[13].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (audio1_menu_uiinfo[0].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio",
audio1_menu_uiinfo[0].widget,
gtk_widget_ref (popup_audio_menu_uiinfo[0].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_language",
popup_audio_menu_uiinfo[0].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (audio1_menu_uiinfo[0].widget, FALSE);
gtk_widget_set_sensitive (popup_audio_menu_uiinfo[0].widget, FALSE);
gtk_widget_ref (audio1_menu_uiinfo[1].widget);
gtk_widget_ref (popup_audio_menu_uiinfo[1].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator20",
audio1_menu_uiinfo[1].widget,
popup_audio_menu_uiinfo[1].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (audio1_menu_uiinfo[2].widget);
gtk_widget_ref (popup_audio_menu_uiinfo[2].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_volume_up",
audio1_menu_uiinfo[2].widget,
popup_audio_menu_uiinfo[2].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (audio1_menu_uiinfo[3].widget);
gtk_widget_ref (popup_audio_menu_uiinfo[3].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_volume_down",
audio1_menu_uiinfo[3].widget,
popup_audio_menu_uiinfo[3].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (audio1_menu_uiinfo[4].widget);
gtk_widget_ref (popup_audio_menu_uiinfo[4].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_volume_mute",
audio1_menu_uiinfo[4].widget,
popup_audio_menu_uiinfo[4].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (audio1_menu_uiinfo[5].widget);
gtk_widget_ref (popup_audio_menu_uiinfo[5].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator21",
audio1_menu_uiinfo[5].widget,
popup_audio_menu_uiinfo[5].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (audio1_menu_uiinfo[6].widget);
gtk_widget_ref (popup_audio_menu_uiinfo[6].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio_channels",
audio1_menu_uiinfo[6].widget,
popup_audio_menu_uiinfo[6].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (audio1_menu_uiinfo[7].widget);
gtk_widget_ref (popup_audio_menu_uiinfo[7].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio_device",
audio1_menu_uiinfo[7].widget,
popup_audio_menu_uiinfo[7].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[14].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "video1",
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_video",
intf_popup_uiinfo[14].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (video1_menu_uiinfo[0].widget);
gtk_widget_ref (popup_video_menu_uiinfo[0].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subpictures",
video1_menu_uiinfo[0].widget,
popup_video_menu_uiinfo[0].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (video1_menu_uiinfo[0].widget, FALSE);
gtk_widget_set_sensitive (popup_video_menu_uiinfo[0].widget, FALSE);
gtk_widget_ref (video1_menu_uiinfo[1].widget);
gtk_widget_ref (popup_video_menu_uiinfo[1].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator18",
video1_menu_uiinfo[1].widget,
popup_video_menu_uiinfo[1].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (video1_menu_uiinfo[2].widget);
gtk_widget_ref (popup_video_menu_uiinfo[2].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_fullscreen",
video1_menu_uiinfo[2].widget,
popup_video_menu_uiinfo[2].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (video1_menu_uiinfo[3].widget);
gtk_widget_ref (popup_video_menu_uiinfo[3].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator19",
video1_menu_uiinfo[3].widget,
popup_video_menu_uiinfo[3].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (video1_menu_uiinfo[4].widget);
gtk_widget_ref (popup_video_menu_uiinfo[4].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_deinterlace",
video1_menu_uiinfo[4].widget,
popup_video_menu_uiinfo[4].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (video1_menu_uiinfo[5].widget);
gtk_widget_ref (popup_video_menu_uiinfo[5].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_video_device",
video1_menu_uiinfo[5].widget,
popup_video_menu_uiinfo[5].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[15].widget);
......
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: gtk.c,v 1.14 2003/01/31 09:51:57 sam Exp $
* $Id: gtk.c,v 1.15 2003/02/05 22:11:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -258,6 +258,12 @@ static void Run( intf_thread_t *p_intf )
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( gtk_object_get_data(
GTK_OBJECT(p_intf->p_sys->p_popup),
"popup_audio" ) ), "p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( gtk_object_get_data(
GTK_OBJECT(p_intf->p_sys->p_popup),
"popup_video" ) ), "p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playwin ),
"p_intf", p_intf );
......
......@@ -1249,17 +1249,17 @@
<widget>
<class>GtkMenuItem</class>
<name>audio1</name>
<name>popup_audio</name>
<label>Audio</label>
<right_justify>False</right_justify>
<widget>
<class>GtkMenu</class>
<name>audio1_menu</name>
<name>popup_audio_menu</name>
<widget>
<class>GtkMenuItem</class>
<name>popup_audio</name>
<name>popup_language</name>
<sensitive>False</sensitive>
<label>_Language</label>
<right_justify>False</right_justify>
......@@ -1331,13 +1331,13 @@
<widget>
<class>GtkMenuItem</class>
<name>video1</name>
<name>popup_video</name>
<label>Video</label>
<right_justify>False</right_justify>
<widget>
<class>GtkMenu</class>
<name>video1_menu</name>
<name>popup_video_menu</name>
<widget>
<class>GtkMenuItem</class>
......
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.11 2003/01/31 10:54:07 sam Exp $
* $Id: gtk_callbacks.c,v 1.12 2003/02/05 22:11:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -72,11 +72,15 @@ void * E_(__GtkGetIntf)( GtkWidget * widget )
/* Otherwise, the parent widget has it */
widget = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
if( p_data )
{
return p_data;
}
}
/* We look for the top widget */
widget = gtk_widget_get_toplevel( GTK_WIDGET( widget ) );
p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
return p_data;
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: menu.c,v 1.7 2003/01/28 12:30:44 gbazin Exp $
* $Id: menu.c,v 1.8 2003/02/05 22:11:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -113,7 +113,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf );
void GtkMenubarAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GTKLANGTOGGLE( p_popup, "popup_audio", AUDIO_ES,
GTKLANGTOGGLE( p_popup, "popup_language", AUDIO_ES,
GtkPopupAudioToggle, b_audio_update );
}
......@@ -1416,7 +1416,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
p_intf->p_sys->p_window ), "menubar_audio" ) );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_audio" ) );
p_intf->p_sys->p_popup ), "popup_language" ) );
p_intf->p_sys->b_audio_update = VLC_TRUE;
GtkLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment