remove the client_remaximize function, and replace it with the client_reconfigure function, which just calls client_configure with the window's current location and dimensions, user=TRUE and final=TRUE.
add support for the VIDMODE extension in client_configure, namely, fullscreen windows are positioned at the point of the viewport rather than at 0,0. call client_reconfigure when uniconifying a window, so that fullscreen windows are put at the point of the view port.
This commit is contained in:
parent
a865fe603f
commit
68cc6e30b8
3 changed files with 17 additions and 20 deletions
|
@ -1031,7 +1031,7 @@ void client_setup_decor_and_functions(Client *self)
|
||||||
we may also need to be repositioned */
|
we may also need to be repositioned */
|
||||||
frame_adjust_area(self->frame, TRUE, TRUE);
|
frame_adjust_area(self->frame, TRUE, TRUE);
|
||||||
/* with new decor, the window's maximized size may change */
|
/* with new decor, the window's maximized size may change */
|
||||||
client_remaximize(self);
|
client_reconfigure(self);
|
||||||
} else {
|
} else {
|
||||||
/* this makes sure that these windows appear on all desktops */
|
/* this makes sure that these windows appear on all desktops */
|
||||||
if (self->type == Type_Desktop && self->desktop != DESKTOP_ALL)
|
if (self->type == Type_Desktop && self->desktop != DESKTOP_ALL)
|
||||||
|
@ -1089,19 +1089,10 @@ static void client_change_allowed_actions(Client *self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_remaximize(Client *self)
|
void client_reconfigure(Client *self)
|
||||||
{
|
{
|
||||||
int dir;
|
client_configure(self, Corner_TopLeft, self->area.x, self->area.y,
|
||||||
if (self->max_horz && self->max_vert)
|
self->area.width, self->area.height, TRUE, TRUE);
|
||||||
dir = 0;
|
|
||||||
else if (self->max_horz)
|
|
||||||
dir = 1;
|
|
||||||
else if (self->max_vert)
|
|
||||||
dir = 2;
|
|
||||||
else
|
|
||||||
return; /* not maximized */
|
|
||||||
self->max_horz = self->max_vert = FALSE;
|
|
||||||
client_maximize(self, TRUE, dir, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_update_wmhints(Client *self)
|
void client_update_wmhints(Client *self)
|
||||||
|
@ -1618,8 +1609,12 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
|
||||||
|
|
||||||
/* set the size and position if fullscreen */
|
/* set the size and position if fullscreen */
|
||||||
if (self->fullscreen) {
|
if (self->fullscreen) {
|
||||||
|
#ifdef VIDMODE
|
||||||
|
XF86VidModeGetViewPort(ob_display, ob_screen, &x, &y);
|
||||||
|
#else
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
|
#endif
|
||||||
w = screen_physical_size.width;
|
w = screen_physical_size.width;
|
||||||
h = screen_physical_size.height;
|
h = screen_physical_size.height;
|
||||||
user = FALSE; /* ignore that increment etc shit when in fullscreen */
|
user = FALSE; /* ignore that increment etc shit when in fullscreen */
|
||||||
|
@ -1867,6 +1862,11 @@ void client_iconify(Client *self, gboolean iconic, gboolean curdesk)
|
||||||
/* this puts it after the current focused window */
|
/* this puts it after the current focused window */
|
||||||
focus_order_remove(self);
|
focus_order_remove(self);
|
||||||
focus_order_add_new(self);
|
focus_order_add_new(self);
|
||||||
|
|
||||||
|
/* this is here cuz with the VIDMODE extension, the viewport can change
|
||||||
|
while a fullscreen window is iconic, and when it uniconifies, it
|
||||||
|
would be nice if it did so to the new position of the viewport */
|
||||||
|
client_reconfigure(self);
|
||||||
}
|
}
|
||||||
client_change_state(self);
|
client_change_state(self);
|
||||||
client_showhide(self);
|
client_showhide(self);
|
||||||
|
|
|
@ -318,11 +318,6 @@ void client_unmanage(Client *client);
|
||||||
/*! Sets the client list on the root window from the client_list */
|
/*! Sets the client list on the root window from the client_list */
|
||||||
void client_set_list();
|
void client_set_list();
|
||||||
|
|
||||||
/*! Reapplies the maximized state to the window
|
|
||||||
Use this to make the window readjust its maximized size to new
|
|
||||||
surroundings (struts, etc). */
|
|
||||||
void client_remaximize(Client *self);
|
|
||||||
|
|
||||||
/*! Determines if the client should be shown or hidden currently.
|
/*! Determines if the client should be shown or hidden currently.
|
||||||
@return TRUE if it should be visible; otherwise, FALSE.
|
@return TRUE if it should be visible; otherwise, FALSE.
|
||||||
*/
|
*/
|
||||||
|
@ -354,6 +349,8 @@ gboolean client_focused(Client *self);
|
||||||
void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
|
void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
|
||||||
gboolean user, gboolean final);
|
gboolean user, gboolean final);
|
||||||
|
|
||||||
|
void client_reconfigure(Client *self);
|
||||||
|
|
||||||
/*! Moves a client so that it is on screen if it is entirely out of the
|
/*! Moves a client so that it is on screen if it is entirely out of the
|
||||||
viewable screen.
|
viewable screen.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -581,11 +581,11 @@ static void screen_update_area()
|
||||||
Client *c = it->data;
|
Client *c = it->data;
|
||||||
if (i < screen_num_desktops) {
|
if (i < screen_num_desktops) {
|
||||||
if (c->desktop == i)
|
if (c->desktop == i)
|
||||||
client_remaximize(c);
|
client_reconfigure(c);
|
||||||
} else {
|
} else {
|
||||||
/* the 'all desktops' size */
|
/* the 'all desktops' size */
|
||||||
if (c->desktop == DESKTOP_ALL)
|
if (c->desktop == DESKTOP_ALL)
|
||||||
client_remaximize(c);
|
client_reconfigure(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue