Bugfix: Correctly adjust state when transferring fullscreen windows to other workspaces (Thanks Mirko)

This fixes ticket #27.
Furthermore, it is ensured that only one client at a time is in fullscreen mode.
This commit is contained in:
Michael Stapelberg
2009-04-17 21:01:33 +02:00
parent 12cc8b78af
commit 49d5bdbb08
2 changed files with 20 additions and 5 deletions

View File

@ -364,11 +364,13 @@ void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
Workspace *workspace = client->container->workspace;
workspace->fullscreen_client = (client->fullscreen ? NULL : client);
client->fullscreen = !client->fullscreen;
if (client->fullscreen) {
if (!client->fullscreen) {
if (workspace->fullscreen_client != NULL) {
LOG("Not entering fullscreen mode, there already is a fullscreen client.\n");
return;
}
client->fullscreen = true;
workspace->fullscreen_client = client;
LOG("Entering fullscreen mode...\n");
/* We just entered fullscreen mode, lets configure the window */
uint32_t mask = XCB_CONFIG_WINDOW_X |
@ -399,6 +401,8 @@ void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
fake_configure_notify(conn, child_rect, client->child);
} else {
LOG("leaving fullscreen mode\n");
client->fullscreen = false;
workspace->fullscreen_client = NULL;
/* 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;