summaryrefslogtreecommitdiff
path: root/src/frames.c
diff options
context:
space:
mode:
authorrhp <rhp>2001-07-04 02:10:54 +0000
committerrhp <rhp>2001-07-04 02:10:54 +0000
commitec00c9852d57b812a78d242fffe1d1d52f272427 (patch)
tree1babb9b6ec440f600b5db113b067afce65ff8732 /src/frames.c
parent3650c23055d613c7660b64f60f841f2649c5fa3a (diff)
downloadmetacity-ec00c9852d57b812a78d242fffe1d1d52f272427.tar.gz
metacity-ec00c9852d57b812a78d242fffe1d1d52f272427.tar.bz2
...
Diffstat (limited to 'src/frames.c')
-rw-r--r--src/frames.c77
1 files changed, 54 insertions, 23 deletions
diff --git a/src/frames.c b/src/frames.c
index f7d5825..354484a 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -709,28 +709,42 @@ meta_frames_manage_window (MetaFrames *frames,
gdk_window_set_user_data (frame->window, frames);
-#if 0
- /* Add events in frame.c */
- gdk_window_set_events (frame->window,
- GDK_EXPOSURE_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_STRUCTURE_MASK);
-
- /* This shouldn't be required if we don't select for button
- * press in frame.c?
+ /* Don't set event mask here, it's in frame.c */
+
+ /* Grab Alt + button1 and Alt + button2 for moving window,
+ * and Alt + button3 for popping up window menu.
*/
- XGrabButton (gdk_display, AnyButton, AnyModifier,
- xwindow, False,
- ButtonPressMask | ButtonReleaseMask |
- PointerMotionMask | PointerMotionHintMask,
- GrabModeAsync, GrabModeAsync,
- False, None);
-
- XFlush (gdk_display);
+ {
+ int i = 1;
+ while (i < 4)
+ {
+ if (XGrabButton (gdk_display, i, Mod1Mask,
+ xwindow, False,
+ ButtonPressMask | ButtonReleaseMask |
+ PointerMotionMask | PointerMotionHintMask,
+ GrabModeAsync, GrabModeAsync,
+ False, None) != Success)
+ meta_warning ("Failed to grab button %d with Mod1Mask for frame 0x%lx\n",
+ i, xwindow);
+
+#if 0
+ /* This is just for debugging, since I end up moving
+ * the Xnest otherwise ;-)
+ */
+ if (XGrabButton (gdk_display, i, ControlMask,
+ xwindow, False,
+ ButtonPressMask | ButtonReleaseMask |
+ PointerMotionMask | PointerMotionHintMask,
+ GrabModeAsync, GrabModeAsync,
+ False, None) != Success)
+ meta_warning ("Failed to grab button %d with ControlMask for frame 0x%lx\n",
+ i, xwindow);
+
#endif
+
+ ++i;
+ }
+ }
frame->xwindow = xwindow;
frame->layout = NULL;
@@ -1362,14 +1376,12 @@ meta_frames_button_press_event (GtkWidget *widget,
break;
}
- g_assert (status != META_FRAME_STATUS_NORMAL);
-
meta_frames_begin_grab (frames, frame,
status,
event->button,
0, 0, 0, 0, 0, 0, /* not needed */
event->time);
-
+
redraw_control (frames, frame, control);
if (status == META_FRAME_STATUS_CLICKING_MENU)
@@ -1487,6 +1499,15 @@ meta_frames_button_press_event (GtkWidget *widget,
event->time);
}
}
+ else if (event->button == 3)
+ {
+ meta_core_show_window_menu (gdk_display,
+ frame->xwindow,
+ event->x_root,
+ event->y_root,
+ event->button,
+ event->time);
+ }
return TRUE;
}
@@ -2411,3 +2432,13 @@ get_control (MetaFrames *frames,
return META_FRAME_CONTROL_NONE;
}
+
+Window
+meta_frames_get_moving_frame (MetaFrames *frames)
+{
+ if (frames->grab_frame &&
+ frames->grab_status == META_FRAME_STATUS_MOVING)
+ return frames->grab_frame->xwindow;
+ else
+ return None;
+}