base rudeness on if they have a strut even smarter!
This commit is contained in:
parent
067776e783
commit
b799cfd9a3
2 changed files with 11 additions and 15 deletions
|
@ -300,9 +300,7 @@ void client_manage(Window window)
|
||||||
dispatch_client(Event_Client_New, self, 0, 0);
|
dispatch_client(Event_Client_New, self, 0, 0);
|
||||||
|
|
||||||
/* make sure the window is visible */
|
/* make sure the window is visible */
|
||||||
if (!(self->strut.left || self->strut.right ||
|
client_move_onscreen(self, TRUE);
|
||||||
self->strut.top || self->strut.bottom))
|
|
||||||
client_move_onscreen(self, TRUE);
|
|
||||||
|
|
||||||
screen_update_areas();
|
screen_update_areas();
|
||||||
|
|
||||||
|
@ -480,13 +478,13 @@ gboolean client_find_onscreen(ObClient *self, int *x, int *y, int w, int h,
|
||||||
/* XXX watch for xinerama dead areas */
|
/* XXX watch for xinerama dead areas */
|
||||||
|
|
||||||
a = screen_area(self->desktop);
|
a = screen_area(self->desktop);
|
||||||
if (*x >= a->x + a->width - 1)
|
if (!self->strut.right && *x >= a->x + a->width - 1)
|
||||||
*x = a->x + a->width - self->frame->area.width;
|
*x = a->x + a->width - self->frame->area.width;
|
||||||
if (*y >= a->y + a->height - 1)
|
if (!self->strut.bottom && *y >= a->y + a->height - 1)
|
||||||
*y = a->y + a->height - self->frame->area.height;
|
*y = a->y + a->height - self->frame->area.height;
|
||||||
if (*x + self->frame->area.width - 1 < a->x)
|
if (!self->strut.left && *x + self->frame->area.width - 1 < a->x)
|
||||||
*x = a->x;
|
*x = a->x;
|
||||||
if (*y + self->frame->area.height - 1 < a->y)
|
if (!self->strut.top && *y + self->frame->area.height - 1 < a->y)
|
||||||
*y = a->y;
|
*y = a->y;
|
||||||
|
|
||||||
if (rude) {
|
if (rude) {
|
||||||
|
@ -496,13 +494,13 @@ gboolean client_find_onscreen(ObClient *self, int *x, int *y, int w, int h,
|
||||||
/* dont let windows map/move into the strut unless they
|
/* dont let windows map/move into the strut unless they
|
||||||
are bigger than the available area */
|
are bigger than the available area */
|
||||||
if (w <= a->width) {
|
if (w <= a->width) {
|
||||||
if (*x < a->x) *x = a->x;
|
if (!self->strut.left && *x < a->x) *x = a->x;
|
||||||
if (*x + w > a->x + a->width)
|
if (!self->strut.right && *x + w > a->x + a->width)
|
||||||
*x = a->x + a->width - w;
|
*x = a->x + a->width - w;
|
||||||
}
|
}
|
||||||
if (h <= a->height) {
|
if (h <= a->height) {
|
||||||
if (*y < a->y) *y = a->y;
|
if (!self->strut.top && *y < a->y) *y = a->y;
|
||||||
if (*y + h > a->y + a->height)
|
if (!self->strut.bottom && *y + h > a->y + a->height)
|
||||||
*y = a->y + a->height - h;
|
*y = a->y + a->height - h;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -776,8 +776,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
h = (e->xconfigurerequest.value_mask & CWHeight) ?
|
h = (e->xconfigurerequest.value_mask & CWHeight) ?
|
||||||
e->xconfigurerequest.height : client->area.height;
|
e->xconfigurerequest.height : client->area.height;
|
||||||
|
|
||||||
if (!(client->strut.left || client->strut.right ||
|
{
|
||||||
client->strut.top || client->strut.bottom)) {
|
|
||||||
int newx = x;
|
int newx = x;
|
||||||
int newy = y;
|
int newy = y;
|
||||||
client_find_onscreen(client, &newx, &newy, w, h, TRUE);
|
client_find_onscreen(client, &newx, &newy, w, h, TRUE);
|
||||||
|
@ -975,8 +974,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
h = client->area.y;
|
h = client->area.y;
|
||||||
client->gravity = tmpg;
|
client->gravity = tmpg;
|
||||||
|
|
||||||
if (!(client->strut.left || client->strut.right ||
|
{
|
||||||
client->strut.top || client->strut.bottom)) {
|
|
||||||
int newx = x;
|
int newx = x;
|
||||||
int newy = y;
|
int newy = y;
|
||||||
client_find_onscreen(client, &newx, &newy, w, h, TRUE);
|
client_find_onscreen(client, &newx, &newy, w, h, TRUE);
|
||||||
|
|
Loading…
Reference in a new issue