From ad18c2792b855254013b7d7fcb69768ecddc6508 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Dec 2005 15:58:52 +0000 Subject: [PATCH] Fix popup menu problems: GTK cannot get a grab while the button is down, so show it on button release instead of button press. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17088 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Gui/mplayer/mw.c | 2 +- Gui/mplayer/pb.c | 2 +- Gui/mplayer/sw.c | 2 +- Gui/mplayer/widgets.c | 8 -------- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Gui/mplayer/mw.c b/Gui/mplayer/mw.c index c48eb56613..be623488e9 100644 --- a/Gui/mplayer/mw.c +++ b/Gui/mplayer/mw.c @@ -443,7 +443,7 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY ) itemtype=0; break; - case wsPRMouseButton: + case wsRRMouseButton: gtkShow( evShowPopUpMenu,NULL ); break; diff --git a/Gui/mplayer/pb.c b/Gui/mplayer/pb.c index 644729e660..c5c9fa7b0c 100644 --- a/Gui/mplayer/pb.c +++ b/Gui/mplayer/pb.c @@ -121,7 +121,7 @@ void mplPBMouseHandle( int Button,int X,int Y,int RX,int RY ) case wsRMMouseButton: mplHideMenu( RX,RY,0 ); break; - case wsPRMouseButton: + case wsRRMouseButton: gtkShow( evShowPopUpMenu,NULL ); break; // --- diff --git a/Gui/mplayer/sw.c b/Gui/mplayer/sw.c index 55693ec345..ed14e6455f 100644 --- a/Gui/mplayer/sw.c +++ b/Gui/mplayer/sw.c @@ -47,7 +47,7 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) switch( Button ) { - case wsPRMouseButton: + case wsRRMouseButton: gtkShow( evShowPopUpMenu,NULL ); break; case wsPMMouseButton: diff --git a/Gui/mplayer/widgets.c b/Gui/mplayer/widgets.c index 281db06726..907e7c990c 100644 --- a/Gui/mplayer/widgets.c +++ b/Gui/mplayer/widgets.c @@ -217,15 +217,7 @@ void gtkShow( int type,char * param ) gtk_widget_destroy( PopUpMenu ); } PopUpMenu=create_PopUpMenu(); -#ifdef HAVE_GTK2_GUI - // Ugly hack, but we don't want to loose events - while(!GTK_WIDGET_VISIBLE(PopUpMenu)) { - gtk_menu_popup(GTK_MENU(PopUpMenu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); - gtk_main_iteration(); - } -#else gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 ); -#endif //HAVE_GTK2_GUI break; case evHidePopUpMenu: if ( PopUpMenu )