]> git.sur5r.net Git - i3/i3/commitdiff
Fixes for the last commit: check outputs instead of workspaces, correctly reset state...
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 8 Mar 2010 10:12:02 +0000 (11:12 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 8 Mar 2010 10:15:31 +0000 (11:15 +0100)
src/client.c
src/workspace.c

index f5e7718ec495fc7af9d9e3cb2e38fa81dcb2a5f2..9c136ca6bc4ba68dfb98095e2f0a766bad960d8c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * i3 - an improved dynamic tiling window manager
  *
- * © 2009 Michael Stapelberg and contributors
+ * © 2009-2010 Michael Stapelberg and contributors
  *
  * See file LICENSE for license information.
  *
@@ -155,14 +155,19 @@ bool client_matches_class_name(Client *client, char *to_class, char *to_title,
  */
 void client_enter_fullscreen(xcb_connection_t *conn, Client *client, bool global) {
         Workspace *workspace;
+        Output *output;
         Rect r;
 
         if (global) {
-                TAILQ_FOREACH(workspace, workspaces, workspaces) {
-                        if (workspace->fullscreen_client == NULL && workspace->fullscreen_client != client)
+                TAILQ_FOREACH(output, &outputs, outputs) {
+                        if (!output->active)
+                                continue;
+
+                        if (output->current_workspace->fullscreen_client == NULL)
                                 continue;
 
-                        LOG("Not entering global fullscreen mode, there already is a fullscreen client.\n");
+                        LOG("Not entering global fullscreen mode, there already "
+                            "is a fullscreen client on output %s.\n", output->name);
                         return;
                 }
 
@@ -172,19 +177,19 @@ void client_enter_fullscreen(xcb_connection_t *conn, Client *client, bool global
                 /* Set fullscreen_client for each active workspace.
                  * Expand the rectangle to contain all outputs. */
                 TAILQ_FOREACH(output, &outputs, outputs) {
-                        if(!output->active)
+                        if (!output->active)
                                 continue;
 
                         output->current_workspace->fullscreen_client = client;
 
                         /* Temporarily abuse width/heigth as coordinates of the lower right corner */
-                        if(r.x > output->rect.x)
+                        if (r.x > output->rect.x)
                                 r.x = output->rect.x;
-                        if(r.y > output->rect.y)
+                        if (r.y > output->rect.y)
                                 r.y = output->rect.y;
-                        if(r.x + r.width < output->rect.x + output->rect.width)
+                        if (r.x + r.width < output->rect.x + output->rect.width)
                                 r.width = output->rect.x + output->rect.width;
-                        if(r.y + r.height < output->rect.y + output->rect.height)
+                        if (r.y + r.height < output->rect.y + output->rect.height)
                                 r.height = output->rect.y + output->rect.height;
                 }
 
index f3cc24c8a29114299862f6f77b3897d036bff6ba..94d6a068e0b5ad2941b5127405db6148333810ee 100644 (file)
@@ -145,11 +145,14 @@ void workspace_show(xcb_connection_t *conn, int workspace) {
                         redecorate_window(conn, old_client);
                 else xcb_flush(conn);
 
-                /* We need to check, if a global fullscreen-client is blocking the t_ws and if
-                 * necessary switch that to local fullscreen */
+                /* We need to check if a global fullscreen-client is blocking
+                 * the t_ws and if necessary switch that to local fullscreen */
                 Client* client = c_ws->fullscreen_client;
-                if (client != NULL && client->workspace != c_ws)
+                if (client != NULL && client->workspace != c_ws) {
+                        if (c_ws->fullscreen_client->workspace != c_ws)
+                                c_ws->fullscreen_client = NULL;
                         client_enter_fullscreen(conn, client, false);
+                }
         }
 
         /* Check if we need to change something or if we’re already there */