mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
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.
This commit is contained in:
parent
ff652ff407
commit
1e0d6c3346
@ -1,3 +1,8 @@
|
|||||||
|
2002-08-06 Craig Black <blackc@speakeasy.net>
|
||||||
|
|
||||||
|
* src/window.c: (meta_window_client_message): implement
|
||||||
|
_NET_WM_MOVERESIZE enhancements, see #90077.
|
||||||
|
|
||||||
2002-08-06 Havoc Pennington <hp@redhat.com>
|
2002-08-06 Havoc Pennington <hp@redhat.com>
|
||||||
|
|
||||||
* configure.in: 2.4.0 (this version number has no special
|
* configure.in: 2.4.0 (this version number has no special
|
||||||
|
38
src/window.c
38
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_BOTTOMLEFT 6
|
||||||
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
|
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
|
||||||
#define _NET_WM_MOVERESIZE_MOVE 8
|
#define _NET_WM_MOVERESIZE_MOVE 8
|
||||||
|
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9
|
||||||
|
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_window_client_message (MetaWindow *window,
|
meta_window_client_message (MetaWindow *window,
|
||||||
@ -3347,15 +3349,17 @@ meta_window_client_message (MetaWindow *window,
|
|||||||
int y_root;
|
int y_root;
|
||||||
int action;
|
int action;
|
||||||
MetaGrabOp op;
|
MetaGrabOp op;
|
||||||
|
int button;
|
||||||
|
|
||||||
x_root = event->xclient.data.l[0];
|
x_root = event->xclient.data.l[0];
|
||||||
y_root = event->xclient.data.l[1];
|
y_root = event->xclient.data.l[1];
|
||||||
action = event->xclient.data.l[2];
|
action = event->xclient.data.l[2];
|
||||||
|
button = event->xclient.data.l[3];
|
||||||
|
|
||||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
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,
|
window->desc,
|
||||||
x_root, y_root, action);
|
x_root, y_root, action, button);
|
||||||
|
|
||||||
op = META_GRAB_OP_NONE;
|
op = META_GRAB_OP_NONE;
|
||||||
switch (action)
|
switch (action)
|
||||||
@ -3387,18 +3391,43 @@ meta_window_client_message (MetaWindow *window,
|
|||||||
case _NET_WM_MOVERESIZE_MOVE:
|
case _NET_WM_MOVERESIZE_MOVE:
|
||||||
op = META_GRAB_OP_MOVING;
|
op = META_GRAB_OP_MOVING;
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op != META_GRAB_OP_NONE &&
|
if (op != META_GRAB_OP_NONE &&
|
||||||
|
((window->has_move_func && op == META_GRAB_OP_KEYBOARD_MOVING) ||
|
||||||
|
(window->has_resize_func && op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN)))
|
||||||
|
{
|
||||||
|
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_move_func && op == META_GRAB_OP_MOVING) ||
|
||||||
(window->has_resize_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
|
||||||
|
*/
|
||||||
|
if (button == 0)
|
||||||
{
|
{
|
||||||
int x, y, query_root_x, query_root_y;
|
int x, y, query_root_x, query_root_y;
|
||||||
Window root, child;
|
Window root, child;
|
||||||
guint mask;
|
guint mask;
|
||||||
int button;
|
|
||||||
|
|
||||||
/* The race conditions in this _NET_WM_MOVERESIZE thing
|
/* The race conditions in this _NET_WM_MOVERESIZE thing
|
||||||
* are mind-boggling
|
* are mind-boggling
|
||||||
@ -3421,6 +3450,7 @@ meta_window_client_message (MetaWindow *window,
|
|||||||
button = 3;
|
button = 3;
|
||||||
else
|
else
|
||||||
button = 0;
|
button = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (button != 0)
|
if (button != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user