From aaabb13c0a1c41b6b20ea75df707671569fb08ab Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 11 Mar 2007 05:00:56 +0000 Subject: [PATCH] add _NET_WM_FULL_PLACEMENT, cuz openbox does do placement, even tho it can be sucky right now, lol. but it's good for dialogs and stuff, which is what this is talking about. also add _NET_WM_MOVERESIZE_CANCEL. --- openbox/event.c | 6 +++++- openbox/prop.c | 3 +++ openbox/prop.h | 5 ++++- openbox/screen.c | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/openbox/event.c b/openbox/event.c index 1988f108..6d1fa8dc 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1009,7 +1009,8 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xclient.data.l[0] == 2), e->xclient.data.l[1]); } else if (msgtype == prop_atoms.net_wm_moveresize) { - ob_debug("net_wm_moveresize for 0x%lx\n", client->window); + ob_debug("net_wm_moveresize for 0x%lx direction %d\n", + client->window, e->xclient.data.l[2]); if ((Atom)e->xclient.data.l[2] == prop_atoms.net_wm_moveresize_size_topleft || (Atom)e->xclient.data.l[2] == @@ -1039,6 +1040,9 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xclient.data.l[1], e->xclient.data.l[3], e->xclient.data.l[2]); } + else if ((Atom)e->xclient.data.l[2] == + prop_atoms.net_wm_moveresize_cancel) + moveresize_end(TRUE); } else if (msgtype == prop_atoms.net_moveresize_window) { gint oldg = client->gravity; gint tmpg, x, y, w, h; diff --git a/openbox/prop.c b/openbox/prop.c index 686404d4..91dca5cb 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -52,6 +52,8 @@ void prop_startup() CREATE(sm_client_id, "SM_CLIENT_ID"); + CREATE(net_wm_full_placement, "_NET_WM_FULL_PLACEMENT"); + CREATE(net_supported, "_NET_SUPPORTED"); CREATE(net_client_list, "_NET_CLIENT_LIST"); CREATE(net_client_list_stacking, "_NET_CLIENT_LIST_STACKING"); @@ -109,6 +111,7 @@ void prop_startup() prop_atoms.net_wm_moveresize_move = 8; prop_atoms.net_wm_moveresize_size_keyboard = 9; prop_atoms.net_wm_moveresize_move_keyboard = 10; + prop_atoms.net_wm_moveresize_cancel = 11; CREATE(net_wm_action_move, "_NET_WM_ACTION_MOVE"); CREATE(net_wm_action_resize, "_NET_WM_ACTION_RESIZE"); diff --git a/openbox/prop.h b/openbox/prop.h index 1931cb65..08aa83bb 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -56,7 +56,9 @@ typedef struct Atoms { Atom sm_client_id; /* NETWM atoms */ - + + Atom net_wm_full_placement; + /* root window properties */ Atom net_supported; Atom net_client_list; @@ -118,6 +120,7 @@ typedef struct Atoms { Atom net_wm_moveresize_move; Atom net_wm_moveresize_size_keyboard; Atom net_wm_moveresize_move_keyboard; + Atom net_wm_moveresize_cancel; Atom net_wm_action_move; Atom net_wm_action_resize; diff --git a/openbox/screen.c b/openbox/screen.c index a4dfb76e..ca3e1273 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -204,9 +204,10 @@ gboolean screen_annex() window, screen_support_win); /* set the _NET_SUPPORTED_ATOMS hint */ - num_support = 54; + num_support = 55; i = 0; supported = g_new(gulong, num_support); + supported[i++] = prop_atoms.net_wm_full_placement; supported[i++] = prop_atoms.net_current_desktop; supported[i++] = prop_atoms.net_number_of_desktops; supported[i++] = prop_atoms.net_desktop_geometry; -- 2.45.2