# HG changeset patch # User John Lindgren # Date 1241277383 14400 # Node ID a522493de76e487dca3f68ee80d47410ec4495f2 # Parent 5a11abf0075c4b4153bb5e914f19d32e52d9cf27 Set up a hook_call for showing the main menu, since it's implemented in a plugin now (fixes #38). diff -r 5a11abf0075c -r a522493de76e src/skins/ui_main.c --- a/src/skins/ui_main.c Fri May 01 12:28:48 2009 -0500 +++ b/src/skins/ui_main.c Sat May 02 11:16:23 2009 -0400 @@ -329,9 +329,16 @@ return TRUE; } +static void show_main_menu (GdkEventButton * event, void * unused) +{ + ui_manager_popup_menu_show ((GtkMenu *) mainwin_general_menu, event->x_root, + event->y_root, event->button, event->time); +} + static void mainwin_destroy(GtkWidget * widget, gpointer data) { + aud_hook_dissociate ("show main menu", (HookFunction) show_main_menu); mainwin_quit_cb(); } @@ -2367,6 +2374,7 @@ gtk_window_add_accel_group( GTK_WINDOW(mainwin) , ui_manager_get_accel_group() ); mainwin_create_widgets(); + aud_hook_associate ("show main menu", (HookFunction) show_main_menu, 0); } gboolean @@ -2795,12 +2803,3 @@ { mainwin_quit_cb(); } - -void -util_menu_main_show( gint x , gint y , guint button , guint time ) -{ - /* convenience function that shows the main popup menu wherever requested */ - ui_manager_popup_menu_show( GTK_MENU(mainwin_general_menu), - x , y , button , time ); - return; -} diff -r 5a11abf0075c -r a522493de76e src/skins/ui_main.h --- a/src/skins/ui_main.h Fri May 01 12:28:48 2009 -0500 +++ b/src/skins/ui_main.h Sat May 02 11:16:23 2009 -0400 @@ -51,7 +51,7 @@ enum { MAINWIN_GENERAL_ABOUT, - + MAINWIN_GENERAL_PLAYFILE, MAINWIN_GENERAL_PLAYLOCATION, @@ -188,6 +188,4 @@ void ui_main_check_theme_engine(void); -void util_menu_main_show( gint x , gint y , guint button , guint time ); - #endif /* AUDACIOUS_UI_MAIN_H */ diff -r 5a11abf0075c -r a522493de76e src/statusicon/si_ui.c --- a/src/statusicon/si_ui.c Fri May 01 12:28:48 2009 -0500 +++ b/src/statusicon/si_ui.c Sat May 02 11:16:23 2009 -0400 @@ -102,8 +102,7 @@ break; case SI_CFG_RCLICK_MENU_AUD: default: - if(audacious_menu_main_show != NULL) - audacious_menu_main_show ( event->x_root , event->y_root , 3 , event->time ); + aud_hook_call ("show main menu", event); break; } break; @@ -133,7 +132,7 @@ } break; } - + case GDK_SCROLL_DOWN: { switch ( si_cfg.scroll_action ) @@ -340,7 +339,7 @@ GdkPixbuf *si_pixbuf, *si_scaled_pixbuf; gint size = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(image) , "size" )); static gchar *wmname = NULL; - + AUDDBG("WM reported proposed icon size: %d\n", size); /* sometimes, KDE won't give the correct size-allocation; workaround this */ @@ -360,7 +359,7 @@ const gchar *path; gboolean scalable = FALSE; gboolean catch = FALSE; - + theme = gtk_icon_theme_get_default (); array = gtk_icon_theme_get_icon_sizes (theme, "audacious"); if (array[0] != 0) { @@ -380,7 +379,7 @@ info = gtk_icon_theme_lookup_icon (theme, "audacious", -1, GTK_ICON_LOOKUP_FORCE_SVG); path = gtk_icon_info_get_filename (info); si_pixbuf = gdk_pixbuf_new_from_file (path, NULL); - + } else { si_pixbuf = gdk_pixbuf_new_from_file (DATA_DIR "/images/audacious_player.xpm", NULL); } @@ -405,7 +404,7 @@ size = allocation->height; else size = allocation->width;*/ - + size = MAX(allocation->height, allocation->width); /* some WMs doesn't report orientation correctly --asphyx */ if ( prev_size != size )