Bugfix: Also fix horizontal resizing
The same problem as in the commit before this one was present. Additionally, the dock_clients and internal bar were not taken into account everywhere.
This commit is contained in:
@ -417,3 +417,31 @@ void workspace_update_urgent_flag(Workspace *ws) {
|
||||
|
||||
ws->urgent = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the width of the workspace.
|
||||
*
|
||||
*/
|
||||
int workspace_width(Workspace *ws) {
|
||||
return ws->rect.width;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the effective height of the workspace (without the internal bar and
|
||||
* without dock clients).
|
||||
*
|
||||
*/
|
||||
int workspace_height(Workspace *ws) {
|
||||
int height = ws->rect.height;
|
||||
i3Font *font = load_font(global_conn, config.font);
|
||||
|
||||
/* Reserve space for dock clients */
|
||||
Client *client;
|
||||
SLIST_FOREACH(client, &(ws->screen->dock_clients), dock_clients)
|
||||
height -= client->desired_height;
|
||||
|
||||
/* Space for the internal bar */
|
||||
height -= (font->height + 6);
|
||||
|
||||
return height;
|
||||
}
|
||||
|
Reference in New Issue
Block a user