summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-10-14 04:11:42 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-10-14 04:11:42 +0000
commit282b52d6b7c5675d49e113073af3f66bbaadd8b8 (patch)
tree30cdf333af0b8a552fd7b95dddcbafd6951b28ea /src
parent9c8824542e8402a38f6746a1fe99a38dcdca5ae9 (diff)
downloadmetacity-282b52d6b7c5675d49e113073af3f66bbaadd8b8.tar.gz
metacity-282b52d6b7c5675d49e113073af3f66bbaadd8b8.tar.bz2
only handle events here if the modmask from our button grab is active.
2001-10-14 Havoc Pennington <hp@pobox.com> * src/display.c (event_callback): only handle events here if the modmask from our button grab is active. i.e. only the Alt-click is handled here. * src/frames.c: add check for whether button presses are in the frame client area before handling them, so we don't weirdly let you move a frame by clicking in its client area if the client hasn't selected button press events.
Diffstat (limited to 'src')
-rw-r--r--src/display.c23
-rw-r--r--src/frames.c21
-rw-r--r--src/frames.h3
3 files changed, 39 insertions, 8 deletions
diff --git a/src/display.c b/src/display.c
index c3e80e8..de548c7 100644
--- a/src/display.c
+++ b/src/display.c
@@ -693,15 +693,25 @@ event_callback (XEvent *event,
else if (window && display->grab_op == META_GRAB_OP_NONE)
{
gboolean begin_move = FALSE;
+ guint grab_mask;
+
+ grab_mask = Mod1Mask;
+ if (g_getenv ("METACITY_DEBUG_BUTTON_GRABS"))
+ grab_mask |= ControlMask;
- if (event->xbutton.button == 1)
+ if ((event->xbutton.state & grab_mask) == 0)
+ {
+ ; /* nothing, not getting event from our button grabs,
+ * rather from a client that just let button presses
+ * pass through to our frame
+ */
+ }
+ else if (event->xbutton.button == 1)
{
meta_window_raise (window);
meta_window_focus (window, event->xbutton.time);
- /* frames.c handles it if frame was receiver */
- if (!frame_was_receiver)
- begin_move = TRUE;
+ begin_move = TRUE;
}
else if (event->xbutton.button == 2)
{
@@ -1600,6 +1610,11 @@ meta_display_grab_window_buttons (MetaDisplay *display,
{
int result;
+ /* Note: changing the modifier for this keybinding also
+ * requires a change to the button press handling
+ * in the display event handler
+ */
+
meta_error_trap_push (display);
XGrabButton (display->xdisplay, i, Mod1Mask,
xwindow, False,
diff --git a/src/frames.c b/src/frames.c
index 6af4ecd..7e1c38b 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -81,7 +81,7 @@ struct _MetaFrameGeometry
GdkRectangle min_rect;
GdkRectangle spacer_rect;
GdkRectangle menu_rect;
- GdkRectangle title_rect;
+ GdkRectangle title_rect;
};
static void meta_frames_class_init (MetaFramesClass *klass);
@@ -496,6 +496,12 @@ meta_frames_calc_geometry (MetaFrames *frames,
props = *(frames->props);
+ /* FIXME this is totally broken - the w/h here are the size of the
+ * frame xwindow, which is computed from the size the frame wants to
+ * be, which we are currently computing - stuff just happens to work
+ * now because we always go through this codepath twice, or don't
+ * really use these values, or something.
+ */
meta_core_get_frame_size (gdk_display, frame->xwindow,
&width, &height);
@@ -910,7 +916,9 @@ show_tip_now (MetaFrames *frames)
break;
case META_FRAME_CONTROL_RESIZE_E:
break;
- case META_FRAME_CONTROL_NONE:
+ case META_FRAME_CONTROL_NONE:
+ break;
+ case META_FRAME_CONTROL_CLIENT_AREA:
break;
}
@@ -1015,6 +1023,9 @@ meta_frames_button_press_event (GtkWidget *widget,
control = get_control (frames, frame, event->x, event->y);
+ if (control == META_FRAME_CONTROL_CLIENT_AREA)
+ return FALSE; /* not on the frame, just passed through from client */
+
/* We want to shade even if we have a GrabOp, since we'll have a move grab
* if we double click the titlebar.
*/
@@ -1357,6 +1368,8 @@ meta_frames_motion_notify_event (GtkWidget *widget,
switch (control)
{
+ case META_FRAME_CONTROL_CLIENT_AREA:
+ break;
case META_FRAME_CONTROL_NONE:
break;
case META_FRAME_CONTROL_TITLE:
@@ -2151,6 +2164,8 @@ control_rect (MetaFrameControl control,
break;
case META_FRAME_CONTROL_NONE:
break;
+ case META_FRAME_CONTROL_CLIENT_AREA:
+ break;
}
return rect;
@@ -2181,7 +2196,7 @@ get_control (MetaFrames *frames,
client.height = fgeom.height - fgeom.top_height - fgeom.bottom_height;
if (POINT_IN_RECT (x, y, client))
- return META_FRAME_CONTROL_NONE;
+ return META_FRAME_CONTROL_CLIENT_AREA;
if (POINT_IN_RECT (x, y, fgeom.close_rect))
return META_FRAME_CONTROL_DELETE;
diff --git a/src/frames.h b/src/frames.h
index b3ee7c6..8cfa310 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -42,7 +42,8 @@ typedef enum
META_FRAME_CONTROL_RESIZE_NE,
META_FRAME_CONTROL_RESIZE_NW,
META_FRAME_CONTROL_RESIZE_W,
- META_FRAME_CONTROL_RESIZE_E
+ META_FRAME_CONTROL_RESIZE_E,
+ META_FRAME_CONTROL_CLIENT_AREA
} MetaFrameControl;
/* This is one widget that manages all the window frames