[metacity] frames: fix pressed state of menu button
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] frames: fix pressed state of menu button
- Date: Thu, 18 Aug 2016 13:34:52 +0000 (UTC)
commit dfa271fab6c2af18e7f0a320062fecb9a2bcb66c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Aug 18 16:33:02 2016 +0300
frames: fix pressed state of menu button
https://bugzilla.gnome.org/show_bug.cgi?id=394787
src/ui/frames.c | 12 ++++++++++++
src/ui/frames.h | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 7c25b2c..3274142 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -774,6 +774,7 @@ meta_frames_manage_window (MetaFrames *frames,
frame->title = NULL;
frame->expose_delayed = FALSE;
frame->shape_applied = FALSE;
+ frame->ignore_leave_notify = FALSE;
frame->prelit_control = META_FRAME_CONTROL_NONE;
frame->prelit_x = 0;
frame->prelit_y = 0;
@@ -1829,6 +1830,7 @@ meta_frames_button_press_event (GtkWidget *widget,
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
dx += rect.width;
+ frame->ignore_leave_notify = TRUE;
meta_core_show_window_menu (frames->xdisplay,
frame->xwindow,
rect.x + dx,
@@ -2712,6 +2714,8 @@ meta_frames_enter_notify_event (GtkWidget *widget,
if (frame == NULL)
return FALSE;
+ frame->ignore_leave_notify = FALSE;
+
control = get_control (frames, frame, event->x, event->y);
update_prelit_control (frames, frame, control, event->x, event->y);
@@ -2724,6 +2728,7 @@ meta_frames_leave_notify_event (GtkWidget *widget,
{
MetaUIFrame *frame;
MetaFrames *frames;
+ MetaGrabOp grab_op;
frames = META_FRAMES (widget);
@@ -2731,6 +2736,13 @@ meta_frames_leave_notify_event (GtkWidget *widget,
if (frame == NULL)
return FALSE;
+ grab_op = meta_core_get_grab_op (frames->xdisplay);
+ frame->ignore_leave_notify = frame->ignore_leave_notify &&
+ grab_op == META_GRAB_OP_CLICKING_MENU;
+
+ if (frame->ignore_leave_notify)
+ return FALSE;
+
update_prelit_control (frames, frame, META_FRAME_CONTROL_NONE,
event->x, event->y);
diff --git a/src/ui/frames.h b/src/ui/frames.h
index 5d30c9a..c86ffb6 100644
--- a/src/ui/frames.h
+++ b/src/ui/frames.h
@@ -71,6 +71,7 @@ struct _MetaUIFrame
gchar *title;
guint expose_delayed : 1;
guint shape_applied : 1;
+ guint ignore_leave_notify : 1;
/* FIXME get rid of this, it can just be in the MetaFrames struct */
MetaFrameControl prelit_control;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]