give the client a 0 border again.
This commit is contained in:
parent
56b01b73a8
commit
ba2de2d512
5 changed files with 49 additions and 69 deletions
|
@ -358,6 +358,9 @@ void client_manage(Window window)
|
||||||
activate = TRUE;
|
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
|
/* adjust the frame to the client's size before showing or placing
|
||||||
the window */
|
the window */
|
||||||
frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
|
frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
|
||||||
|
@ -713,6 +716,9 @@ void client_unmanage(ObClient *self)
|
||||||
self->functions = OB_CLIENT_FUNC_MOVE | OB_CLIENT_FUNC_RESIZE;
|
self->functions = OB_CLIENT_FUNC_MOVE | OB_CLIENT_FUNC_RESIZE;
|
||||||
self->decorations = 0; /* unmanaged windows have no decor */
|
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);
|
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,
|
client_configure(self, self->area.x, self->area.y,
|
||||||
self->area.width, self->area.height,
|
self->area.width, self->area.height,
|
||||||
self->border_width, FALSE, TRUE);
|
FALSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_update_wmhints(ObClient *self)
|
void client_update_wmhints(ObClient *self)
|
||||||
|
@ -2568,7 +2574,7 @@ static void client_apply_startup_state(ObClient *self,
|
||||||
do this before applying the states so they have the correct
|
do this before applying the states so they have the correct
|
||||||
pre-max/pre-fullscreen values
|
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",
|
ob_debug("placed window 0x%x at %d, %d with size %d x %d\n",
|
||||||
self->window, self->area.x, self->area.y,
|
self->window, self->area.x, self->area.y,
|
||||||
self->area.width, self->area.height);
|
self->area.width, self->area.height);
|
||||||
|
@ -2818,7 +2824,7 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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)
|
gboolean user, gboolean final)
|
||||||
{
|
{
|
||||||
gint oldw, oldh;
|
gint oldw, oldh;
|
||||||
|
@ -2839,13 +2845,11 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
|
||||||
|
|
||||||
/* figure out if we moved or resized or what */
|
/* figure out if we moved or resized or what */
|
||||||
moved = x != self->area.x || y != self->area.y;
|
moved = x != self->area.x || y != self->area.y;
|
||||||
resized = w != self->area.width || h != self->area.height ||
|
resized = w != self->area.width || h != self->area.height;
|
||||||
b != self->border_width;
|
|
||||||
|
|
||||||
oldw = self->area.width;
|
oldw = self->area.width;
|
||||||
oldh = self->area.height;
|
oldh = self->area.height;
|
||||||
RECT_SET(self->area, x, y, w, h);
|
RECT_SET(self->area, x, y, w, h);
|
||||||
self->border_width = b;
|
|
||||||
|
|
||||||
/* for app-requested resizes, always resize if 'resized' is true.
|
/* for app-requested resizes, always resize if 'resized' is true.
|
||||||
for user-requested ones, only resize if final is true, or when
|
for user-requested ones, only resize if final is true, or when
|
||||||
|
@ -2856,16 +2860,7 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
|
||||||
|
|
||||||
/* if the client is enlarging, then resize the client before the frame */
|
/* if the client is enlarging, then resize the client before the frame */
|
||||||
if (send_resize_client && (w > oldw || h > oldh)) {
|
if (send_resize_client && (w > oldw || h > oldh)) {
|
||||||
XWindowChanges changes;
|
XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh));
|
||||||
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);
|
|
||||||
|
|
||||||
frame_adjust_client_area(self->frame);
|
frame_adjust_client_area(self->frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2918,18 +2913,8 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h, gint b,
|
||||||
|
|
||||||
/* if the client is shrinking, then resize the frame before the client */
|
/* if the client is shrinking, then resize the frame before the client */
|
||||||
if (send_resize_client && (w <= oldw && h <= oldh)) {
|
if (send_resize_client && (w <= oldw && h <= oldh)) {
|
||||||
XWindowChanges changes;
|
|
||||||
|
|
||||||
frame_adjust_client_area(self->frame);
|
frame_adjust_client_area(self->frame);
|
||||||
|
XResizeWindow(ob_display, self->window, w, h);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XFlush(ob_display);
|
XFlush(ob_display);
|
||||||
|
|
|
@ -386,13 +386,11 @@ void client_convert_gravity_resize(ObClient *self, gint gravity,
|
||||||
gint w, gint h);
|
gint w, gint h);
|
||||||
|
|
||||||
#define client_move(self, x, y) \
|
#define client_move(self, x, y) \
|
||||||
client_configure(self, x, y, self->area.width, self->area.height, \
|
client_configure(self, x, y, self->area.width, self->area.height, TRUE, TRUE)
|
||||||
self->border_width, TRUE, TRUE)
|
|
||||||
#define client_resize(self, w, h) \
|
#define client_resize(self, w, h) \
|
||||||
client_configure(self, self->area.x, self->area.y, w, h, \
|
client_configure(self, self->area.x, self->area.y, w, h, TRUE, TRUE)
|
||||||
self->border_width, TRUE, TRUE)
|
|
||||||
#define client_move_resize(self, x, y, w, h) \
|
#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
|
/*! Figure out where a window will end up and what size it will be if you
|
||||||
told it to move/resize to these coordinates.
|
told it to move/resize to these coordinates.
|
||||||
|
@ -433,7 +431,7 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
|
||||||
@param force_reply Send a ConfigureNotify to the client regardless of if
|
@param force_reply Send a ConfigureNotify to the client regardless of if
|
||||||
the position changed.
|
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);
|
gboolean user, gboolean final);
|
||||||
|
|
||||||
void client_reconfigure(ObClient *self);
|
void client_reconfigure(ObClient *self);
|
||||||
|
|
|
@ -1009,26 +1009,30 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
also you can't compress stacking events
|
also you can't compress stacking events
|
||||||
*/
|
*/
|
||||||
|
|
||||||
gint x, y, w, h, b;
|
gint x, y, w, h;
|
||||||
gboolean move = FALSE;
|
gboolean move = FALSE;
|
||||||
gboolean resize = FALSE;
|
gboolean resize = FALSE;
|
||||||
gboolean border = FALSE;
|
|
||||||
|
|
||||||
/* get the current area */
|
/* get the current area */
|
||||||
RECT_TO_DIMS(client->area, x, y, w, h);
|
RECT_TO_DIMS(client->area, x, y, w, h);
|
||||||
b = client->border_width;
|
|
||||||
|
|
||||||
ob_debug("ConfigureRequest for \"%s\" desktop %d wmstate %d "
|
ob_debug("ConfigureRequest for \"%s\" desktop %d wmstate %d "
|
||||||
"visibile %d\n"
|
"visibile %d\n"
|
||||||
" x %d y %d w %d h %d b %d\n",
|
" x %d y %d w %d h %d b %d\n",
|
||||||
client->title,
|
client->title,
|
||||||
screen_desktop, client->wmstate, client->frame->visible,
|
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 (e->xconfigurerequest.value_mask & CWBorderWidth)
|
||||||
if (client->border_width != e->xconfigurerequest.border_width) {
|
if (client->border_width != e->xconfigurerequest.border_width) {
|
||||||
b = e->xconfigurerequest.border_width;
|
client->border_width = e->xconfigurerequest.border_width;
|
||||||
border = TRUE;
|
|
||||||
|
/* 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 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
notify is sent or not */
|
notify is sent or not */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (move || resize || border) {
|
if (move || resize) {
|
||||||
gint lw,lh;
|
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
|
/* if x was not given, then use gravity to figure out the new
|
||||||
x. the reference point should not be moved */
|
x. the reference point should not be moved */
|
||||||
if ((e->xconfigurerequest.value_mask & CWWidth &&
|
if ((e->xconfigurerequest.value_mask & CWWidth &&
|
||||||
!(e->xconfigurerequest.value_mask & CWX)))
|
!(e->xconfigurerequest.value_mask & CWX)))
|
||||||
client_gravity_resize_w(client, &x, client->area.width, w);
|
client_gravity_resize_w(client, &x, client->area.width, w);
|
||||||
/* if y was not given, then use gravity to figure out the new
|
/* if y was not given, then use gravity to figure out the new
|
||||||
y. the reference point should not be moved */
|
y. the reference point should not be moved */
|
||||||
if ((e->xconfigurerequest.value_mask & CWHeight &&
|
if ((e->xconfigurerequest.value_mask & CWHeight &&
|
||||||
!(e->xconfigurerequest.value_mask & CWY)))
|
!(e->xconfigurerequest.value_mask & CWY)))
|
||||||
client_gravity_resize_h(client, &y, client->area.height,h);
|
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
|
/* if they requested something that moves the window, or if
|
||||||
the window is actually being changed then configure it and
|
the window is actually being changed then configure it and
|
||||||
send a configure notify to them */
|
send a configure notify to them */
|
||||||
if (move || !RECT_EQUAL_DIMS(client->area, x, y, w, h) ||
|
if (move || !RECT_EQUAL_DIMS(client->area, x, y, w, h)) {
|
||||||
border)
|
ob_debug("Granting ConfigureRequest x %d y %d w %d h %d\n",
|
||||||
{
|
x, y, w, h);
|
||||||
ob_debug("Granting ConfigureRequest x %d y %d w %d h %d "
|
client_configure(client, x, y, w, h, FALSE, TRUE);
|
||||||
"b %d\n",
|
|
||||||
x, y, w, h, b);
|
|
||||||
client_configure(client, x, y, w, h, b, FALSE, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ignore enter events caused by these like ob actions do */
|
/* ignore enter events caused by these like ob actions do */
|
||||||
|
@ -1351,8 +1351,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
|
|
||||||
client_find_onscreen(client, &x, &y, w, h, FALSE);
|
client_find_onscreen(client, &x, &y, w, h, FALSE);
|
||||||
|
|
||||||
client_configure(client, x, y, w, h, client->border_width,
|
client_configure(client, x, y, w, h, FALSE, TRUE);
|
||||||
FALSE, TRUE);
|
|
||||||
|
|
||||||
client->gravity = ograv;
|
client->gravity = ograv;
|
||||||
|
|
||||||
|
|
|
@ -719,8 +719,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
|
|
||||||
/* when the client has StaticGravity, it likes to move around. */
|
/* when the client has StaticGravity, it likes to move around. */
|
||||||
XMoveWindow(ob_display, self->client->window,
|
XMoveWindow(ob_display, self->client->window,
|
||||||
self->size.left - self->client->border_width,
|
self->size.left, self->size.top);
|
||||||
self->size.top - self->client->border_width);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,7 +298,7 @@ void moveresize_end(gboolean cancel)
|
||||||
client_configure(moveresize_client, x, y,
|
client_configure(moveresize_client, x, y,
|
||||||
(cancel ? start_cw : cur_x),
|
(cancel ? start_cw : cur_x),
|
||||||
(cancel ? start_ch : cur_y),
|
(cancel ? start_ch : cur_y),
|
||||||
moveresize_client->border_width, TRUE, TRUE);
|
TRUE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
moveresize_in_progress = FALSE;
|
moveresize_in_progress = FALSE;
|
||||||
|
@ -318,7 +318,7 @@ static void do_move(gboolean keyboard)
|
||||||
client_configure(moveresize_client, cur_x, cur_y,
|
client_configure(moveresize_client, cur_x, cur_y,
|
||||||
moveresize_client->area.width,
|
moveresize_client->area.width,
|
||||||
moveresize_client->area.height,
|
moveresize_client->area.height,
|
||||||
moveresize_client->border_width, TRUE, FALSE);
|
TRUE, FALSE);
|
||||||
if (config_resize_popup_show == 2) /* == "Always" */
|
if (config_resize_popup_show == 2) /* == "Always" */
|
||||||
popup_coords(moveresize_client, "%d x %d",
|
popup_coords(moveresize_client, "%d x %d",
|
||||||
moveresize_client->frame->area.x,
|
moveresize_client->frame->area.x,
|
||||||
|
@ -376,8 +376,7 @@ static void do_resize()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
get_resize_position(&x, &y, FALSE);
|
get_resize_position(&x, &y, FALSE);
|
||||||
client_configure(moveresize_client, x, y, cur_x, cur_y,
|
client_configure(moveresize_client, x, y, cur_x, cur_y, TRUE, FALSE);
|
||||||
moveresize_client->border_width, TRUE, FALSE);
|
|
||||||
|
|
||||||
/* this would be better with a fixed width font ... XXX can do it better
|
/* this would be better with a fixed width font ... XXX can do it better
|
||||||
if there are 2 text boxes */
|
if there are 2 text boxes */
|
||||||
|
|
Loading…
Reference in a new issue