t_ws->screen = container->workspace->screen;
/* Copy the dimensions from the virtual screen */
memcpy(&(t_ws->rect), &(container->workspace->screen->rect), sizeof(Rect));
+ } else {
+ /* Check if there is already a fullscreen client on the destination workspace and
+ * stop moving if so. */
+ if (current_client->fullscreen && (t_ws->fullscreen_client != NULL)) {
+ LOG("Not moving: Fullscreen client already existing on destination workspace.\n");
+ return;
+ }
}
Container *to_container = t_ws->table[t_ws->current_col][t_ws->current_row];
assert(to_container != NULL);
remove_client_from_container(conn, current_client, container);
+ if (container->workspace->fullscreen_client == current_client)
+ container->workspace->fullscreen_client = NULL;
CIRCLEQ_INSERT_TAIL(&(to_container->clients), current_client, clients);
SLIST_INSERT_HEAD(&(to_container->workspace->focus_stack), current_client, focus_clients);
+ if (current_client->fullscreen)
+ t_ws->fullscreen_client = current_client;
LOG("Moved.\n");
current_client->container = to_container;
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, let’s configure the window */
uint32_t mask = XCB_CONFIG_WINDOW_X |
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 haven’t changed, it would not be
re-configured if we don’t set the following flag */
client->force_reconfigure = true;