all repos — openbox @ 1aa0bc66eb45ba466d1d071d0e6c13631331e091

openbox fork - make it a bit more like ryudo

improved ICCCM compliance!
  a) send ConfigureNotify back to the client as required by the ICCCM in all sitatuations.
  b) send the corrent coords in the ConfigureNotify, including the border width
  c) remove the WM_STATE property when unmanaging a window
Dana Jansens danakj@orodu.net
commit

1aa0bc66eb45ba466d1d071d0e6c13631331e091

parent

b8ba52fabc8d696d7c9e6abb285a4781a6e7aed6

3 files changed, 33 insertions(+), 28 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -249,10 +249,6 @@ client_apply_startup_state(self);

grab_server(FALSE); - /* add to client list/map */ - client_list = g_list_append(client_list, self); - g_hash_table_insert(window_map, &self->window, self); - /* update the focus lists */ focus_order_add_new(self);

@@ -322,6 +318,10 @@ /* update the list hints */

client_set_list(); dispatch_client(Event_Client_Mapped, self, 0, 0); + + /* add to client list/map */ + client_list = g_list_append(client_list, self); + g_hash_table_insert(window_map, &self->window, self); ob_debug("Managed window 0x%lx (%s)\n", window, self->class); }

@@ -427,6 +427,7 @@ /* these values should not be persisted across a window

unmapping/mapping */ PROP_ERASE(self->window, net_wm_desktop); PROP_ERASE(self->window, net_wm_state); + PROP_ERASE(self->window, wm_state); } else { /* if we're left in an iconic state, the client wont be mapped. this is bad, since we will no longer be managing the window on restart */

@@ -1346,11 +1347,8 @@

if (!PROP_GETA32(self->window, net_wm_strut, cardinal, &data, &num)) { STRUT_SET(self->strut, 0, 0, 0, 0); } else { - if (num == 4) { - g_message("new strut: %d %d %d %d", - data[0], data[2], data[1], data[3]); + if (num == 4) STRUT_SET(self->strut, data[0], data[2], data[1], data[3]); - } else STRUT_SET(self->strut, 0, 0, 0, 0); g_free(data);

@@ -1656,9 +1654,10 @@ below

*/ } -void client_configure(ObClient *self, ObCorner anchor, - int x, int y, int w, int h, - gboolean user, gboolean final) +void client_configure_full(ObClient *self, ObCorner anchor, + int x, int y, int w, int h, + gboolean user, gboolean final, + gboolean force_reply) { gboolean moved = FALSE, resized = FALSE;

@@ -1850,20 +1849,19 @@

if (moved || resized) frame_adjust_area(self->frame, moved, resized); - /* If you send this and the client hasn't changed you end up with buggy - clients (emacs) freaking out, cuz they send back a configure every - time they receive this event, which resends them this event... etc. - */ - if ((!user && moved) || (user && final)) { + if (force_reply || (!resized && ((!user && moved) || (user && final)))) + { XEvent event; event.type = ConfigureNotify; event.xconfigure.display = ob_display; event.xconfigure.event = self->window; event.xconfigure.window = self->window; - + /* root window real coords */ - event.xconfigure.x = self->frame->area.x + self->frame->size.left; - event.xconfigure.y = self->frame->area.y + self->frame->size.top; + event.xconfigure.x = self->frame->area.x + self->frame->size.left - + self->border_width; + event.xconfigure.y = self->frame->area.y + self->frame->size.top - + self->border_width; event.xconfigure.width = w; event.xconfigure.height = h;
M openbox/client.hopenbox/client.h

@@ -263,6 +263,9 @@

/* Returns if the window is focused */ gboolean client_focused(ObClient *self); +#define client_configure(self, anchor, x, y, w, h, user, final) \ + client_configure_full(self, anchor, x, y, w, h, user, final, FALSE) + /*! Move and/or resize the window. This also maintains things like the client's minsize, and size increments. @param anchor The corner to keep in the same position when resizing.

@@ -277,10 +280,13 @@ @param final If user is true, then this should specify if this is a final

configuration. e.g. Final should be FALSE if doing an interactive move/resize, and then be TRUE for the last call only. + @param force_reply Send a ConfigureNotify to the client regardless of if + the position changed. */ -void client_configure(ObClient *self, ObCorner anchor, - int x, int y, int w, int h, - gboolean user, gboolean final); +void client_configure_full(ObClient *self, ObCorner anchor, + int x, int y, int w, int h, + gboolean user, gboolean final, + gboolean force_reply); void client_reconfigure(ObClient *self);
M openbox/event.copenbox/event.c

@@ -758,14 +758,15 @@

/* if we are iconic (or shaded (fvwm does this)) ignore the event */ if (client->iconic || client->shaded) return; - if (e->xconfigurerequest.value_mask & CWBorderWidth) - client->border_width = e->xconfigurerequest.border_width; - /* resize, then move, as specified in the EWMH section 7.7 */ if (e->xconfigurerequest.value_mask & (CWWidth | CWHeight | - CWX | CWY)) { + CWX | CWY | + CWBorderWidth)) { int x, y, w, h; ObCorner corner; + + if (e->xconfigurerequest.value_mask & CWBorderWidth) + client->border_width = e->xconfigurerequest.border_width; x = (e->xconfigurerequest.value_mask & CWX) ? e->xconfigurerequest.x : client->area.x;

@@ -802,7 +803,8 @@ default: /* NorthWest, Static, etc */

corner = OB_CORNER_TOPLEFT; } - client_configure(client, corner, x, y, w, h, FALSE, TRUE); + client_configure_full(client, corner, x, y, w, h, FALSE, TRUE, + TRUE); } if (e->xconfigurerequest.value_mask & CWStackMode) {

@@ -1032,7 +1034,6 @@ client_update_protocols(client);

client_setup_decor_and_functions(client); } else if (msgtype == prop_atoms.net_wm_strut) { - g_message("strut change"); client_update_strut(client); } else if (msgtype == prop_atoms.net_wm_icon ||