summaryrefslogtreecommitdiff
path: root/src/ui/frames.c
diff options
context:
space:
mode:
authorAlberts Muktupāvels <[email protected]>2014-10-07 05:37:23 +0300
committerVictor Kareh <[email protected]>2018-08-28 18:53:42 -0400
commitc49f361a93752ffb53d99fd55fa7e8db2ac660c5 (patch)
treef5c02fb0bbb261f96900f09ec170c72ba5e8cc07 /src/ui/frames.c
parentcb9a1be4e7d324be0ec58b1783f72783e1a8f576 (diff)
downloadmarco-c49f361a93752ffb53d99fd55fa7e8db2ac660c5.tar.bz2
marco-c49f361a93752ffb53d99fd55fa7e8db2ac660c5.tar.xz
add support for app-menu button in theme
Add app-menu button support in themes. This is done only to support metacity theme format 3.5 version. Marco will not show this button! Based on metacity commit: https://gitlab.gnome.org/GNOME/metacity/commit/6a2cc159
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r--src/ui/frames.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index a8cb96fa..c0ad3ede 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -1116,6 +1116,9 @@ show_tip_now (MetaFrames *frames)
case META_FRAME_CONTROL_MENU:
tiptext = _("Window Menu");
break;
+ case META_FRAME_CONTROL_APPMENU:
+ tiptext = _("Window App Menu");
+ break;
case META_FRAME_CONTROL_MINIMIZE:
tiptext = _("Minimize Window");
break;
@@ -1466,6 +1469,9 @@ meta_frames_button_press_event (GtkWidget *widget,
case META_FRAME_CONTROL_MENU:
op = META_GRAB_OP_CLICKING_MENU;
break;
+ case META_FRAME_CONTROL_APPMENU:
+ op = META_GRAB_OP_CLICKING_APPMENU;
+ break;
case META_FRAME_CONTROL_SHADE:
op = META_GRAB_OP_CLICKING_SHADE;
break;
@@ -1730,6 +1736,7 @@ meta_frames_button_release_event (GtkWidget *widget,
break;
case META_GRAB_OP_CLICKING_MENU:
+ case META_GRAB_OP_CLICKING_APPMENU:
meta_core_end_grab_op (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), event->time);
break;
@@ -1816,6 +1823,8 @@ meta_frames_update_prelit_control (MetaFrames *frames,
break;
case META_FRAME_CONTROL_MENU:
break;
+ case META_FRAME_CONTROL_APPMENU:
+ break;
case META_FRAME_CONTROL_MINIMIZE:
break;
case META_FRAME_CONTROL_MAXIMIZE:
@@ -1868,6 +1877,7 @@ meta_frames_update_prelit_control (MetaFrames *frames,
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:
@@ -1921,6 +1931,7 @@ meta_frames_motion_notify_event (GtkWidget *widget,
switch (grab_op)
{
case META_GRAB_OP_CLICKING_MENU:
+ case META_GRAB_OP_CLICKING_APPMENU:
case META_GRAB_OP_CLICKING_DELETE:
case META_GRAB_OP_CLICKING_MINIMIZE:
case META_GRAB_OP_CLICKING_MAXIMIZE:
@@ -1951,6 +1962,8 @@ meta_frames_motion_notify_event (GtkWidget *widget,
control = get_control (frames, frame, x, y);
if (! ((control == META_FRAME_CONTROL_MENU &&
grab_op == META_GRAB_OP_CLICKING_MENU) ||
+ (control == META_FRAME_CONTROL_APPMENU &&
+ grab_op == META_GRAB_OP_CLICKING_APPMENU) ||
(control == META_FRAME_CONTROL_DELETE &&
grab_op == META_GRAB_OP_CLICKING_DELETE) ||
(control == META_FRAME_CONTROL_MINIMIZE &&
@@ -2352,6 +2365,12 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
else
button_states[META_BUTTON_TYPE_MENU] = META_BUTTON_STATE_PRELIGHT;
break;
+ case META_FRAME_CONTROL_APPMENU:
+ if (grab_op == META_GRAB_OP_CLICKING_MENU)
+ button_states[META_BUTTON_TYPE_APPMENU] = META_BUTTON_STATE_PRESSED;
+ else
+ button_states[META_BUTTON_TYPE_APPMENU] = META_BUTTON_STATE_PRELIGHT;
+ break;
case META_FRAME_CONTROL_MINIMIZE:
if (grab_op == META_GRAB_OP_CLICKING_MINIMIZE)
button_states[META_BUTTON_TYPE_MINIMIZE] = META_BUTTON_STATE_PRESSED;
@@ -2549,6 +2568,9 @@ 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;
@@ -2635,6 +2657,9 @@ get_control (MetaFrames *frames,
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;
+
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_END);