summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2018-10-04 22:09:15 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-01-30 18:39:42 +0000
commitde76074336b64b23411d3ffcb107daaaabfdd1a6 (patch)
treee0f82c99abd9f961adf9f9500c7912001d9734e9 /src/ui
parentf63b69bb238eddb17623107df44ddac729e13f76 (diff)
downloadmutter-de76074336b64b23411d3ffcb107daaaabfdd1a6.tar.gz
ui: Remove fallback app menu
The app menu is in the process of being retired[0], and the shell stopped displaying it while applications are in the process of dropping it. It therefore doesn't make sense to always show a fallback menu in server-side decorations, applications that still set the menu can rely on GTK+'s own fallback instead. [0] https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/frames.c22
-rw-r--r--src/ui/frames.h1
-rw-r--r--src/ui/theme-private.h4
-rw-r--r--src/ui/theme.c18
4 files changed, 3 insertions, 42 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 77f4eb77d..dce5a4f73 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -1027,19 +1027,16 @@ meta_frame_left_click_event (MetaUIFrame *frame,
case META_FRAME_CONTROL_MINIMIZE:
case META_FRAME_CONTROL_DELETE:
case META_FRAME_CONTROL_MENU:
- case META_FRAME_CONTROL_APPMENU:
frame->grab_button = get_button_number (event);
frame->button_state = META_BUTTON_STATE_PRESSED;
frame->prelit_control = control;
redraw_control (frame, control);
- if (control == META_FRAME_CONTROL_MENU ||
- control == META_FRAME_CONTROL_APPMENU)
+ if (control == META_FRAME_CONTROL_MENU)
{
MetaFrameGeometry fgeom;
GdkRectangle *rect;
MetaRectangle root_rect;
- MetaWindowMenuType menu;
int win_x, win_y;
meta_ui_frame_calc_geometry (frame, &fgeom);
@@ -1053,9 +1050,6 @@ meta_frame_left_click_event (MetaUIFrame *frame,
root_rect.width = rect->width;
root_rect.height = rect->height;
- menu = control == META_FRAME_CONTROL_MENU ? META_WINDOW_MENU_WM
- : META_WINDOW_MENU_APP;
-
/* if the compositor takes a grab for showing the menu, we will
* get a LeaveNotify event we want to ignore, to keep the pressed
* button state while the menu is open
@@ -1063,7 +1057,7 @@ meta_frame_left_click_event (MetaUIFrame *frame,
frame->maybe_ignore_leave_notify = TRUE;
meta_core_show_window_menu_for_rect (display,
frame->xwindow,
- menu,
+ META_WINDOW_MENU_WM,
&root_rect,
evtime);
}
@@ -1260,8 +1254,6 @@ meta_ui_frame_update_prelit_control (MetaUIFrame *frame,
break;
case META_FRAME_CONTROL_MENU:
break;
- case META_FRAME_CONTROL_APPMENU:
- break;
case META_FRAME_CONTROL_MINIMIZE:
break;
case META_FRAME_CONTROL_MAXIMIZE:
@@ -1302,7 +1294,6 @@ meta_ui_frame_update_prelit_control (MetaUIFrame *frame,
switch (control)
{
case META_FRAME_CONTROL_MENU:
- case META_FRAME_CONTROL_APPMENU:
case META_FRAME_CONTROL_MINIMIZE:
case META_FRAME_CONTROL_MAXIMIZE:
case META_FRAME_CONTROL_DELETE:
@@ -1535,9 +1526,6 @@ meta_ui_frame_paint (MetaUIFrame *frame,
case META_FRAME_CONTROL_MENU:
button_type = META_BUTTON_TYPE_MENU;
break;
- case META_FRAME_CONTROL_APPMENU:
- button_type = META_BUTTON_TYPE_APPMENU;
- break;
case META_FRAME_CONTROL_MINIMIZE:
button_type = META_BUTTON_TYPE_MINIMIZE;
break;
@@ -1693,9 +1681,6 @@ control_rect (MetaFrameControl control,
case META_FRAME_CONTROL_MENU:
rect = &fgeom->menu_rect.visible;
break;
- case META_FRAME_CONTROL_APPMENU:
- rect = &fgeom->appmenu_rect.visible;
- break;
case META_FRAME_CONTROL_MINIMIZE:
rect = &fgeom->min_rect.visible;
break;
@@ -1761,9 +1746,6 @@ get_control (MetaUIFrame *frame, int root_x, int root_y)
if (POINT_IN_RECT (x, y, fgeom.menu_rect.clickable))
return META_FRAME_CONTROL_MENU;
- if (POINT_IN_RECT (x, y, fgeom.appmenu_rect.clickable))
- return META_FRAME_CONTROL_APPMENU;
-
flags = meta_frame_get_flags (frame->meta_window->frame);
type = meta_window_get_frame_type (frame->meta_window);
diff --git a/src/ui/frames.h b/src/ui/frames.h
index fc69d2c78..cc6316b3e 100644
--- a/src/ui/frames.h
+++ b/src/ui/frames.h
@@ -36,7 +36,6 @@ typedef enum
META_FRAME_CONTROL_TITLE,
META_FRAME_CONTROL_DELETE,
META_FRAME_CONTROL_MENU,
- META_FRAME_CONTROL_APPMENU,
META_FRAME_CONTROL_MINIMIZE,
META_FRAME_CONTROL_MAXIMIZE,
META_FRAME_CONTROL_UNMAXIMIZE,
diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h
index 1e88ba596..269dbe867 100644
--- a/src/ui/theme-private.h
+++ b/src/ui/theme-private.h
@@ -128,14 +128,13 @@ struct _MetaFrameGeometry
/* used for a memset hack */
#define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
-#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, appmenu_rect) + sizeof (MetaButtonSpace) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
+#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, menu_rect) + sizeof (MetaButtonSpace) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
/* The button rects (if changed adjust memset hack) */
MetaButtonSpace close_rect;
MetaButtonSpace max_rect;
MetaButtonSpace min_rect;
MetaButtonSpace menu_rect;
- MetaButtonSpace appmenu_rect;
/* End of button rects (if changed adjust memset hack) */
/* Saved button layout */
@@ -164,7 +163,6 @@ typedef enum
META_BUTTON_TYPE_MAXIMIZE,
META_BUTTON_TYPE_MINIMIZE,
META_BUTTON_TYPE_MENU,
- META_BUTTON_TYPE_APPMENU,
META_BUTTON_TYPE_LAST
} MetaButtonType;
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 223bc04ae..53d7ef555 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -169,11 +169,6 @@ rect_for_function (MetaFrameGeometry *fgeom,
return &fgeom->menu_rect;
else
return NULL;
- case META_BUTTON_FUNCTION_APPMENU:
- if (flags & META_FRAME_ALLOWS_APPMENU)
- return &fgeom->appmenu_rect;
- else
- return NULL;
case META_BUTTON_FUNCTION_MINIMIZE:
if (flags & META_FRAME_ALLOWS_MINIMIZE)
return &fgeom->min_rect;
@@ -522,10 +517,6 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
continue;
else if (strip_button (left_func_rects, &n_left, &fgeom->menu_rect))
continue;
- else if (strip_button (right_func_rects, &n_right, &fgeom->appmenu_rect))
- continue;
- else if (strip_button (left_func_rects, &n_left, &fgeom->appmenu_rect))
- continue;
else
{
meta_bug ("Could not find a button to strip. n_left = %d n_right = %d\n",
@@ -693,10 +684,6 @@ get_button_rect (MetaButtonType type,
*rect = fgeom->menu_rect.visible;
break;
- case META_BUTTON_TYPE_APPMENU:
- *rect = fgeom->appmenu_rect.visible;
- break;
-
default:
case META_BUTTON_TYPE_LAST:
g_assert_not_reached ();
@@ -715,8 +702,6 @@ get_class_from_button_type (MetaButtonType type)
return "maximize";
case META_BUTTON_TYPE_MINIMIZE:
return "minimize";
- case META_BUTTON_TYPE_APPMENU:
- return "appmenu";
default:
return NULL;
}
@@ -871,9 +856,6 @@ meta_frame_layout_draw_with_style (MetaFrameLayout *layout,
case META_BUTTON_TYPE_MENU:
icon_name = "open-menu-symbolic";
break;
- case META_BUTTON_TYPE_APPMENU:
- surface = cairo_surface_reference (mini_icon);
- break;
default:
icon_name = NULL;
break;