backport client_leave_fullscreen from next branch (Thanks ccount)

next
Michael Stapelberg 2010-03-20 14:47:33 +01:00
parent e014c72a58
commit bbea32f021
2 changed files with 38 additions and 0 deletions

View File

@ -53,6 +53,12 @@ bool client_matches_class_name(Client *client, char *to_class, char *to_title,
*/
void client_enter_fullscreen(xcb_connection_t *conn, Client *client);
/**
* Leaves fullscreen mode for the current client. This is called by toggle_fullscreen.
*
*/
void client_leave_fullscreen(xcb_connection_t *conn, Client *client);
/**
* Toggles fullscreen mode for the given client. It updates the data
* structures and reconfigures (= resizes/moves) the client and its frame to

View File

@ -192,6 +192,38 @@ void client_enter_fullscreen(xcb_connection_t *conn, Client *client) {
xcb_flush(conn);
}
/*
* Leaves fullscreen mode for the current client. This is called by toggle_fullscreen.
*
*/
void client_leave_fullscreen(xcb_connection_t *conn, Client *client) {
LOG("leaving fullscreen mode\n");
client->fullscreen = false;
Workspace *ws;
TAILQ_FOREACH(ws, workspaces, workspaces)
if (ws->fullscreen_client == client)
ws->fullscreen_client = NULL;
if (client_is_floating(client)) {
/* For floating clients its enough if we just reconfigure that window (in fact,
* re-rendering the layout will not update the client.) */
reposition_client(conn, client);
resize_client(conn, client);
/* redecorate_window flushes */
redecorate_window(conn, client);
} else {
client_set_below_floating(conn, client);
/* Because the coordinates of the window havent changed, it would not be
re-configured if we dont set the following flag */
client->force_reconfigure = true;
/* We left fullscreen mode, redraw the whole layout to ensure enternotify events are disabled */
render_layout(conn);
}
xcb_flush(conn);
}
/*
* Toggles fullscreen mode for the given client. It updates the data structures and
* reconfigures (= resizes/moves) the client and its frame to the full size of the