all repos — openbox @ ba2de2d512de0a2f19081ed76c550382e5af7294

openbox fork - make it a bit more like ryudo

give the client a 0 border again.
Dana Jansens danakj@orodu.net
commit

ba2de2d512de0a2f19081ed76c550382e5af7294

parent

56b01b73a808ccf51991a0aeb5362d5eb6bbfaaa

5 files changed, 49 insertions(+), 69 deletions(-)

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

@@ -358,6 +358,9 @@ {

activate = TRUE; } + /* remove the client's border */ + XSetWindowBorderWidth(ob_display, self->window, 0); + /* adjust the frame to the client's size before showing or placing the window */ frame_adjust_area(self->frame, FALSE, TRUE, FALSE);

@@ -713,6 +716,9 @@ /* let it be moved and resized no matter what */

self->functions = OB_CLIENT_FUNC_MOVE | OB_CLIENT_FUNC_RESIZE; self->decorations = 0; /* unmanaged windows have no decor */ + /* give the client its border back */ + XSetWindowBorderWidth(ob_display, self->window, self->border_width); + client_move_resize(self, a.x, a.y, a.width, a.height); }

@@ -1810,7 +1816,7 @@ void client_reconfigure(ObClient *self)

{ client_configure(self, self->area.x, self->area.y, self->area.width, self->area.height, - self->border_width, FALSE, TRUE); + FALSE, TRUE); } void client_update_wmhints(ObClient *self)

@@ -2568,7 +2574,7 @@

do this before applying the states so they have the correct pre-max/pre-fullscreen values */ - client_configure(self, x, y, w, h, self->border_width, FALSE, TRUE); + client_configure(self, x, y, w, h, FALSE, TRUE); ob_debug("placed window 0x%x at %d, %d with size %d x %d\n", self->window, self->area.x, self->area.y, self->area.width, self->area.height);

@@ -2818,7 +2824,7 @@ g_assert(*h > 0);

} -void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b, +void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gboolean user, gboolean final) { gint oldw, oldh;

@@ -2839,13 +2845,11 @@ SIZE_SET(self->logical_size, logicalw, logicalh);

/* figure out if we moved or resized or what */ moved = x != self->area.x || y != self->area.y; - resized = w != self->area.width || h != self->area.height || - b != self->border_width; + resized = w != self->area.width || h != self->area.height; oldw = self->area.width; oldh = self->area.height; RECT_SET(self->area, x, y, w, h); - self->border_width = b; /* for app-requested resizes, always resize if 'resized' is true. for user-requested ones, only resize if final is true, or when

@@ -2856,16 +2860,7 @@ (resized && config_resize_redraw))));

/* if the client is enlarging, then resize the client before the frame */ if (send_resize_client && (w > oldw || h > oldh)) { - XWindowChanges changes; - changes.x = self->frame->size.left - self->border_width; - changes.y = self->frame->size.top -self->border_width; - changes.width = MAX(w, oldw); - changes.height = MAX(h, oldh); - changes.border_width = self->border_width; - XConfigureWindow(ob_display, self->window, - CWX|CWY|CWWidth|CWHeight|CWBorderWidth, - &changes); - + XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh)); frame_adjust_client_area(self->frame); }

@@ -2918,18 +2913,8 @@ }

/* if the client is shrinking, then resize the frame before the client */ if (send_resize_client && (w <= oldw && h <= oldh)) { - XWindowChanges changes; - frame_adjust_client_area(self->frame); - - changes.x = self->frame->size.left - self->border_width; - changes.y = self->frame->size.top -self->border_width; - changes.width = w; - changes.height = h; - changes.border_width = self->border_width; - XConfigureWindow(ob_display, self->window, - CWX|CWY|CWWidth|CWHeight|CWBorderWidth, - &changes); + XResizeWindow(ob_display, self->window, w, h); } XFlush(ob_display);
M openbox/client.hopenbox/client.h

@@ -386,13 +386,11 @@ gint *x, gint *y,

gint w, gint h); #define client_move(self, x, y) \ - client_configure(self, x, y, self->area.width, self->area.height, \ - self->border_width, TRUE, TRUE) + client_configure(self, x, y, self->area.width, self->area.height, TRUE, TRUE) #define client_resize(self, w, h) \ - client_configure(self, self->area.x, self->area.y, w, h, \ - self->border_width, TRUE, TRUE) + client_configure(self, self->area.x, self->area.y, w, h, TRUE, TRUE) #define client_move_resize(self, x, y, w, h) \ - client_configure(self, x, y, w, h, self->border_width, TRUE, TRUE) + client_configure(self, x, y, w, h, TRUE, TRUE) /*! Figure out where a window will end up and what size it will be if you told it to move/resize to these coordinates.

@@ -433,7 +431,7 @@ only.

@param force_reply Send a ConfigureNotify to the client regardless of if the position changed. */ -void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b, +void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gboolean user, gboolean final); void client_reconfigure(ObClient *self);
M openbox/event.copenbox/event.c

@@ -1009,26 +1009,30 @@ do to the window).

also you can't compress stacking events */ - gint x, y, w, h, b; + gint x, y, w, h; gboolean move = FALSE; gboolean resize = FALSE; - gboolean border = FALSE; /* get the current area */ RECT_TO_DIMS(client->area, x, y, w, h); - b = client->border_width; ob_debug("ConfigureRequest for \"%s\" desktop %d wmstate %d " "visibile %d\n" " x %d y %d w %d h %d b %d\n", client->title, screen_desktop, client->wmstate, client->frame->visible, - x, y, w, h, b); + x, y, w, h, client->border_width); if (e->xconfigurerequest.value_mask & CWBorderWidth) if (client->border_width != e->xconfigurerequest.border_width) { - b = e->xconfigurerequest.border_width; - border = TRUE; + client->border_width = e->xconfigurerequest.border_width; + + /* if the border width is changing then that is the same + as requesting a resize, but we don't actually change + the client's border, so it will change their root + coordiantes (since they include the border width) and + we need to a notify then */ + move = TRUE; }

@@ -1118,35 +1122,31 @@ /* they still requested a move, so don't change whether a

notify is sent or not */ } - if (move || resize || border) { + if (move || resize) { gint lw,lh; - if (move || resize) { - client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE); + client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE); - /* if x was not given, then use gravity to figure out the new - x. the reference point should not be moved */ - if ((e->xconfigurerequest.value_mask & CWWidth && - !(e->xconfigurerequest.value_mask & CWX))) - client_gravity_resize_w(client, &x, client->area.width, w); - /* if y was not given, then use gravity to figure out the new - y. the reference point should not be moved */ - if ((e->xconfigurerequest.value_mask & CWHeight && - !(e->xconfigurerequest.value_mask & CWY))) - client_gravity_resize_h(client, &y, client->area.height,h); + /* if x was not given, then use gravity to figure out the new + x. the reference point should not be moved */ + if ((e->xconfigurerequest.value_mask & CWWidth && + !(e->xconfigurerequest.value_mask & CWX))) + client_gravity_resize_w(client, &x, client->area.width, w); + /* if y was not given, then use gravity to figure out the new + y. the reference point should not be moved */ + if ((e->xconfigurerequest.value_mask & CWHeight && + !(e->xconfigurerequest.value_mask & CWY))) + client_gravity_resize_h(client, &y, client->area.height,h); - client_find_onscreen(client, &x, &y, w, h, FALSE); - } + client_find_onscreen(client, &x, &y, w, h, FALSE); + /* if they requested something that moves the window, or if the window is actually being changed then configure it and send a configure notify to them */ - if (move || !RECT_EQUAL_DIMS(client->area, x, y, w, h) || - border) - { - ob_debug("Granting ConfigureRequest x %d y %d w %d h %d " - "b %d\n", - x, y, w, h, b); - client_configure(client, x, y, w, h, b, FALSE, TRUE); + if (move || !RECT_EQUAL_DIMS(client->area, x, y, w, h)) { + ob_debug("Granting ConfigureRequest x %d y %d w %d h %d\n", + x, y, w, h); + client_configure(client, x, y, w, h, FALSE, TRUE); } /* ignore enter events caused by these like ob actions do */

@@ -1351,8 +1351,7 @@ client->gravity);

client_find_onscreen(client, &x, &y, w, h, FALSE); - client_configure(client, x, y, w, h, client->border_width, - FALSE, TRUE); + client_configure(client, x, y, w, h, FALSE, TRUE); client->gravity = ograv;
M openbox/frame.copenbox/frame.c

@@ -719,8 +719,7 @@ self->client->area.height);

/* when the client has StaticGravity, it likes to move around. */ XMoveWindow(ob_display, self->client->window, - self->size.left - self->client->border_width, - self->size.top - self->client->border_width); + self->size.left, self->size.top); } }
M openbox/moveresize.copenbox/moveresize.c

@@ -298,7 +298,7 @@ get_resize_position(&x, &y, cancel);

client_configure(moveresize_client, x, y, (cancel ? start_cw : cur_x), (cancel ? start_ch : cur_y), - moveresize_client->border_width, TRUE, TRUE); + TRUE, TRUE); } moveresize_in_progress = FALSE;

@@ -318,7 +318,7 @@

client_configure(moveresize_client, cur_x, cur_y, moveresize_client->area.width, moveresize_client->area.height, - moveresize_client->border_width, TRUE, FALSE); + TRUE, FALSE); if (config_resize_popup_show == 2) /* == "Always" */ popup_coords(moveresize_client, "%d x %d", moveresize_client->frame->area.x,

@@ -376,8 +376,7 @@ }

#endif get_resize_position(&x, &y, FALSE); - client_configure(moveresize_client, x, y, cur_x, cur_y, - moveresize_client->border_width, TRUE, FALSE); + client_configure(moveresize_client, x, y, cur_x, cur_y, TRUE, FALSE); /* this would be better with a fixed width font ... XXX can do it better if there are 2 text boxes */