From 11061a23b1a7dc85784749d9059b0f9e99807c5a Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 31 Mar 2010 22:34:02 +0200 Subject: [PATCH] Fix build with gcc 4.5 Based on patch by Dominique Leuenberger https://bugzilla.gnome.org/show_bug.cgi?id=606719 --- src/core/core.c | 3 +++ src/core/window.c | 13 ++++++------- src/include/common.h | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/core.c b/src/core/core.c index 049b1f129..3fd49746e 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -526,6 +526,9 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op, switch (menu_op) { + case META_MENU_OP_NONE: + name = "none"; + break; case META_MENU_OP_DELETE: name = "close"; break; diff --git a/src/core/window.c b/src/core/window.c index 2d12d5357..3c544332f 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -7067,9 +7067,12 @@ menu_callback (MetaWindowMenu *menu, { meta_verbose ("Menu op %u on %s\n", op, window->desc); - /* op can be 0 for none */ switch (op) { + case META_MENU_OP_NONE: + /* nothing */ + break; + case META_MENU_OP_DELETE: meta_window_delete (window, timestamp); break; @@ -7157,10 +7160,6 @@ menu_callback (MetaWindowMenu *menu, meta_window_shove_titlebar_onscreen (window); break; - case 0: - /* nothing */ - break; - default: meta_warning (G_STRLOC": Unknown window op\n"); break; @@ -7213,8 +7212,8 @@ meta_window_show_menu (MetaWindow *window, window->display->window_with_menu = NULL; } - ops = 0; - insensitive = 0; + ops = META_MENU_OP_NONE; + insensitive = META_MENU_OP_NONE; ops |= (META_MENU_OP_DELETE | META_MENU_OP_MINIMIZE | META_MENU_OP_MOVE | META_MENU_OP_RESIZE); diff --git a/src/include/common.h b/src/include/common.h index d614542b4..66814824e 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -52,6 +52,7 @@ typedef enum typedef enum { + META_MENU_OP_NONE = 0, META_MENU_OP_DELETE = 1 << 0, META_MENU_OP_MINIMIZE = 1 << 1, META_MENU_OP_UNMAXIMIZE = 1 << 2,