]> git.sur5r.net Git - i3/i3/blobdiff - src/randr.c
Merge branch 'master' into next
[i3/i3] / src / randr.c
index ac61dd882f707f96ba7e1d108b7bd383f39312e6..161c8886cf8685371a90f905aac150a2c91b2f6b 100644 (file)
@@ -420,11 +420,16 @@ void init_ws_for_output(Output *output, Con *content) {
             continue;
         DLOG("relevant command = %s\n", bind->command);
         char *target = bind->command + strlen("workspace ");
-        /* We check if this is the workspace next/prev command. Beware: The
-         * workspace names "next" and "prev" are OK, so we check before
+        /* We check if this is the workspace
+         * next/prev/next_on_output/prev_on_output/back_and_forth command.
+         * Beware: The workspace names "next", "prev", "next_on_output",
+         * "prev_on_output" and "back_and_forth" are OK, so we check before
          * stripping the double quotes */
         if (strncasecmp(target, "next", strlen("next")) == 0 ||
-            strncasecmp(target, "prev", strlen("prev")) == 0)
+            strncasecmp(target, "prev", strlen("prev")) == 0 ||
+            strncasecmp(target, "next_on_output", strlen("next_on_output")) == 0 ||
+            strncasecmp(target, "prev_on_output", strlen("prev_on_output")) == 0 ||
+            strncasecmp(target, "back_and_forth", strlen("back_and_forth")) == 0)
             continue;
         if (*target == '"')
             target++;
@@ -743,7 +748,7 @@ void randr_query_outputs() {
                 Con *next = NULL;
                 if (TAILQ_FIRST(&(croot->focus_head)) == output->con) {
                     DLOG("This output (%p) was focused! Getting next\n", output->con);
-                    next = con_next_focused(output->con);
+                    next = focused;
                     DLOG("next = %p\n", next);
                 }
 
@@ -763,6 +768,7 @@ void randr_query_outputs() {
                 if (next) {
                     DLOG("now focusing next = %p\n", next);
                     con_focus(next);
+                    workspace_show(con_get_workspace(next));
                 }
 
                 /* 3: move the dock clients to the first output */
@@ -806,8 +812,6 @@ void randr_query_outputs() {
         disable_randr(conn);
     }
 
-    ewmh_update_workarea();
-
     /* Just go through each active output and assign one workspace */
     TAILQ_FOREACH(output, &outputs, outputs) {
         if (!output->active)
@@ -844,9 +848,10 @@ void randr_init(int *event_base) {
     const xcb_query_extension_reply_t *extreply;
 
     extreply = xcb_get_extension_data(conn, &xcb_randr_id);
-    if (!extreply->present)
+    if (!extreply->present) {
         disable_randr(conn);
-    else randr_query_outputs();
+        return;
+    } else randr_query_outputs();
 
     if (event_base != NULL)
         *event_base = extreply->first_event;