From e633606ca951bd73164b289b899aff283fd72a96 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 17 Jul 2013 23:10:18 -0400 Subject: [PATCH] menu: Remove support for icon items from the window menu We don't show these by default, and it uses deprecated API. This also removes our only use of the stock icons, so remove those as well. https://bugzilla.gnome.org/show_bug.cgi?id=704437 --- .gitignore | 1 - src/Makefile.am | 13 +--------- src/stock_delete.png | Bin 220 -> 0 bytes src/stock_maximize.png | Bin 166 -> 0 bytes src/stock_minimize.png | Bin 145 -> 0 bytes src/ui/menu.c | 55 ++++++++++++++++------------------------- src/ui/menu.h | 5 ---- src/ui/ui.c | 48 ----------------------------------- 8 files changed, 22 insertions(+), 100 deletions(-) delete mode 100644 src/stock_delete.png delete mode 100644 src/stock_maximize.png delete mode 100644 src/stock_minimize.png diff --git a/.gitignore b/.gitignore index 298177b7e..0c8cddf85 100644 --- a/.gitignore +++ b/.gitignore @@ -46,7 +46,6 @@ POTFILES po/*.pot 50-metacity-desktop-key.xml 50-metacity-key.xml -inlinepixbufs.h libmutter.pc mutter mutter-theme-viewer diff --git a/src/Makefile.am b/src/Makefile.am index e2cec915e..22cce625a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -139,7 +139,6 @@ libmutter_la_SOURCES = \ meta/common.h \ core/core.h \ ui/ui.h \ - inlinepixbufs.h \ ui/frames.c \ ui/frames.h \ ui/menu.c \ @@ -284,14 +283,7 @@ gsettings_SCHEMAS = org.gnome.mutter.gschema.xml convertdir = $(datadir)/GConf/gsettings convert_DATA = mutter-schemas.convert -IMAGES=stock_maximize.png stock_minimize.png stock_delete.png -VARIABLES=stock_maximize_data $(srcdir)/stock_maximize.png \ - stock_minimize_data $(srcdir)/stock_minimize.png \ - stock_delete_data $(srcdir)/stock_delete.png - -BUILT_SOURCES = inlinepixbufs.h CLEANFILES = \ - inlinepixbufs.h \ mutter.desktop \ mutter-wm.desktop \ org.gnome.mutter.gschema.xml \ @@ -300,9 +292,6 @@ CLEANFILES = \ $(typelib_DATA) \ $(gir_DATA) -inlinepixbufs.h: $(IMAGES) - $(GDK_PIXBUF_CSOURCE) --raw --build-list $(VARIABLES) >$(srcdir)/inlinepixbufs.h - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libmutter.pc mutter-plugins.pc @@ -320,7 +309,7 @@ EXTRA_DIST=$(desktopfiles_files) \ mutter-enum-types.h.in \ mutter-enum-types.c.in -BUILT_SOURCES += $(mutter_built_sources) +BUILT_SOURCES = $(mutter_built_sources) MUTTER_STAMP_FILES = stamp-mutter-enum-types.h CLEANFILES += $(MUTTER_STAMP_FILES) diff --git a/src/stock_delete.png b/src/stock_delete.png deleted file mode 100644 index 429401cb7ba316e6286cafd58ac0de20c8e0c603..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPmhmeSlXs-b4I-rnjiEBiObAE1aYF-J0b5UwyNotBh zd1gt5LP$ocg1e`0!21-{JfK1cPZ!4!i_^&o5@iqUMTB+Fx40`BCh_#Jh!{N*JeiBAoJz5nNj)cQ=> z)sVy-ae-CNc31m5T@eNKlSHhw>3V9@ZW#e|1}LHItKXd7FSE>Jszr>mdKI;Vst E0OCI|fdBvi diff --git a/src/stock_minimize.png b/src/stock_minimize.png deleted file mode 100644 index a22e3c45b0fa870ce093aff2726a7ab9f97360b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G^tAk28_ZrvZCAbW|YuPgf{R(U=)?iuTPEP+CDo-U3d6?2jkBv=type == MENU_ITEM_IMAGE) - { - GtkWidget *image; - - image = gtk_image_new_from_stock (menuitem->stock_id, GTK_ICON_SIZE_MENU); - mi = gtk_image_menu_item_new (); - - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), image); - gtk_widget_show (image); - } else if (menuitem->type == MENU_ITEM_CHECKBOX) { mi = gtk_check_menu_item_new (); @@ -392,8 +380,7 @@ meta_window_menu_new (MetaFrames *frames, int j; MenuItem to_another_workspace = { - 0, MENU_ITEM_NORMAL, - NULL, FALSE, + 0, MENU_ITEM_NORMAL, FALSE, N_("Move to Another _Workspace") }; diff --git a/src/ui/menu.h b/src/ui/menu.h index c6e8dde4d..adcf32813 100644 --- a/src/ui/menu.h +++ b/src/ui/menu.h @@ -27,11 +27,6 @@ #include #include "frames.h" -/* Stock icons */ -#define METACITY_STOCK_DELETE "metacity-delete" -#define METACITY_STOCK_MINIMIZE "metacity-minimize" -#define METACITY_STOCK_MAXIMIZE "metacity-maximize" - struct _MetaWindowMenu { MetaFrames *frames; diff --git a/src/ui/ui.c b/src/ui/ui.c index c0c819e68..265ecfcca 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -4,7 +4,6 @@ /* * Copyright (C) 2002 Havoc Pennington - * stock icon code Copyright (C) 2002 Jorn Baayen * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -31,13 +30,10 @@ #include "core.h" #include "theme-private.h" -#include "inlinepixbufs.h" - #include #include #include -static void meta_stock_icons_init (void); static void meta_ui_accelerator_parse (const char *accel, guint *keysym, guint *keycode, @@ -62,8 +58,6 @@ meta_ui_init (void) { if (!gtk_init_check (NULL, NULL)) meta_fatal ("Unable to open X display %s\n", XDisplayName (NULL)); - - meta_stock_icons_init (); } Display* @@ -998,48 +992,6 @@ meta_ui_window_is_widget (MetaUI *ui, return FALSE; } -/* stock icon code Copyright (C) 2002 Jorn Baayen */ -typedef struct -{ - char *stock_id; - const guint8 *icon_data; -} MetaStockIcon; - -static void -meta_stock_icons_init (void) -{ - GtkIconFactory *factory; - int i; - - MetaStockIcon items[] = - { - { METACITY_STOCK_DELETE, stock_delete_data }, - { METACITY_STOCK_MINIMIZE, stock_minimize_data }, - { METACITY_STOCK_MAXIMIZE, stock_maximize_data } - }; - - factory = gtk_icon_factory_new (); - gtk_icon_factory_add_default (factory); - - for (i = 0; i < (gint) G_N_ELEMENTS (items); i++) - { - GtkIconSet *icon_set; - GdkPixbuf *pixbuf; - - pixbuf = gdk_pixbuf_new_from_inline (-1, items[i].icon_data, - FALSE, - NULL); - - icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); - gtk_icon_factory_add (factory, items[i].stock_id, icon_set); - gtk_icon_set_unref (icon_set); - - g_object_unref (G_OBJECT (pixbuf)); - } - - g_object_unref (G_OBJECT (factory)); -} - int meta_ui_get_drag_threshold (MetaUI *ui) {