summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Black <blackc@speakeasy.net>2002-08-07 05:26:20 +0000
committerCraig Black <blackc@src.gnome.org>2002-08-07 05:26:20 +0000
commit1e0d6c33461048be2361d765fc088918eaef6447 (patch)
treeee8180fbb5460ea4c64ff7b374a2ca0d9a0af01e /src
parentff652ff4078cc5237a382a700a65f32a2be5c76a (diff)
downloadmetacity-1e0d6c33461048be2361d765fc088918eaef6447.tar.gz
metacity-1e0d6c33461048be2361d765fc088918eaef6447.tar.bz2
implement _NET_WM_MOVERESIZE enhancements, see #90077.
2002-08-06 Craig Black <blackc@speakeasy.net> * src/window.c: (meta_window_client_message): implement _NET_WM_MOVERESIZE enhancements, see #90077.
Diffstat (limited to 'src')
-rw-r--r--src/window.c88
1 files changed, 59 insertions, 29 deletions
diff --git a/src/window.c b/src/window.c
index c446591..5bd6522 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3167,6 +3167,8 @@ meta_window_property_notify (MetaWindow *window,
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
#define _NET_WM_MOVERESIZE_MOVE 8
+#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9
+#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10
gboolean
meta_window_client_message (MetaWindow *window,
@@ -3347,15 +3349,17 @@ meta_window_client_message (MetaWindow *window,
int y_root;
int action;
MetaGrabOp op;
+ int button;
x_root = event->xclient.data.l[0];
y_root = event->xclient.data.l[1];
action = event->xclient.data.l[2];
+ button = event->xclient.data.l[3];
meta_topic (META_DEBUG_WINDOW_OPS,
- "Received _NET_WM_MOVERESIZE message on %s, %d,%d action = %d\n",
+ "Received _NET_WM_MOVERESIZE message on %s, %d,%d action = %d, button %d\n",
window->desc,
- x_root, y_root, action);
+ x_root, y_root, action, button);
op = META_GRAB_OP_NONE;
switch (action)
@@ -3387,40 +3391,66 @@ meta_window_client_message (MetaWindow *window,
case _NET_WM_MOVERESIZE_MOVE:
op = META_GRAB_OP_MOVING;
break;
+ case _NET_WM_MOVERESIZE_SIZE_KEYBOARD:
+ op = META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN;
+ break;
+ case _NET_WM_MOVERESIZE_MOVE_KEYBOARD:
+ op = META_GRAB_OP_KEYBOARD_MOVING;
+ break;
default:
break;
}
if (op != META_GRAB_OP_NONE &&
- ((window->has_move_func && op == META_GRAB_OP_MOVING) ||
- (window->has_resize_func && op != META_GRAB_OP_MOVING)))
+ ((window->has_move_func && op == META_GRAB_OP_KEYBOARD_MOVING) ||
+ (window->has_resize_func && op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN)))
{
- int x, y, query_root_x, query_root_y;
- Window root, child;
- guint mask;
- int button;
-
- /* The race conditions in this _NET_WM_MOVERESIZE thing
- * are mind-boggling
+ meta_window_raise (window);
+ meta_display_begin_grab_op (window->display,
+ window->screen,
+ window,
+ op,
+ FALSE, 0, 0,
+ meta_display_get_current_time (window->display),
+ 0, 0);
+ }
+ else if (op != META_GRAB_OP_NONE &&
+ ((window->has_move_func && op == META_GRAB_OP_MOVING) ||
+ (window->has_resize_func &&
+ (op != META_GRAB_OP_MOVING &&
+ op != META_GRAB_OP_KEYBOARD_MOVING))))
+ {
+ /*
+ * the button SHOULD already be included in the message
*/
- mask = 0;
- meta_error_trap_push (window->display);
- XQueryPointer (window->display->xdisplay,
- window->xwindow,
- &root, &child,
- &query_root_x, &query_root_y,
- &x, &y,
- &mask);
- meta_error_trap_pop (window->display);
-
- if (mask & Button1Mask)
- button = 1;
- else if (mask & Button2Mask)
- button = 2;
- else if (mask & Button3Mask)
- button = 3;
- else
- button = 0;
+ if (button == 0)
+ {
+ int x, y, query_root_x, query_root_y;
+ Window root, child;
+ guint mask;
+
+ /* The race conditions in this _NET_WM_MOVERESIZE thing
+ * are mind-boggling
+ */
+ mask = 0;
+ meta_error_trap_push (window->display);
+ XQueryPointer (window->display->xdisplay,
+ window->xwindow,
+ &root, &child,
+ &query_root_x, &query_root_y,
+ &x, &y,
+ &mask);
+ meta_error_trap_pop (window->display);
+
+ if (mask & Button1Mask)
+ button = 1;
+ else if (mask & Button2Mask)
+ button = 2;
+ else if (mask & Button3Mask)
+ button = 3;
+ else
+ button = 0;
+ }
if (button != 0)
{