]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #1551 from acrisci/bug/rename-workspace-mismatch
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Mon, 16 Mar 2015 21:49:38 +0000 (22:49 +0100)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Mon, 16 Mar 2015 21:49:38 +0000 (22:49 +0100)
bugfix: workspace rename focus mismatch

include/data.h
src/config.c
src/manage.c
testcases/lib/StatusLine.pm
testcases/t/200-urgency-timer.t

index eba0f968088363202eb519130e05f4bee0ad30e3..cec571e9df8eecf71f10c32ebb8c2098f8770d16 100644 (file)
@@ -460,7 +460,6 @@ struct Assignment {
      *
      * A_COMMAND = run the specified command for the matching window
      * A_TO_WORKSPACE = assign the matching window to the specified workspace
-     * A_TO_OUTPUT = assign the matching window to the specified output
      *
      * While the type is a bitmask, only one value can be set at a time. It is
      * a bitmask to allow filtering for multiple types, for example in the
@@ -470,18 +469,16 @@ struct Assignment {
     enum {
         A_ANY = 0,
         A_COMMAND = (1 << 0),
-        A_TO_WORKSPACE = (1 << 1),
-        A_TO_OUTPUT = (1 << 2)
+        A_TO_WORKSPACE = (1 << 1)
     } type;
 
     /** the criteria to check if a window matches */
     Match match;
 
-    /** destination workspace/output/command, depending on the type */
+    /** destination workspace/command, depending on the type */
     union {
         char *command;
         char *workspace;
-        char *output;
     } dest;
 
     TAILQ_ENTRY(Assignment) assignments;
index b41f0e1b7eb2f909aaf7afe9141ddf8c586bc71f..6f906b8ce02e7218828ae2f449bf3223a82dd205 100644 (file)
@@ -158,8 +158,6 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
             assign = TAILQ_FIRST(&assignments);
             if (assign->type == A_TO_WORKSPACE)
                 FREE(assign->dest.workspace);
-            else if (assign->type == A_TO_OUTPUT)
-                FREE(assign->dest.output);
             else if (assign->type == A_COMMAND)
                 FREE(assign->dest.command);
             match_free(&(assign->match));
index 7c464b43efa91c69d3d105db51861acda280f615..077d5720b540366445b3fe813febfc3dbe9fbe78 100644 (file)
@@ -253,23 +253,20 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
     /* See if any container swallows this new window */
     nc = con_for_window(search_at, cwindow, &match);
     if (nc == NULL) {
-        /* If not, check if it is assigned to a specific workspace / output */
-        if ((assignment = assignment_for(cwindow, A_TO_WORKSPACE | A_TO_OUTPUT))) {
+        /* If not, check if it is assigned to a specific workspace */
+        if ((assignment = assignment_for(cwindow, A_TO_WORKSPACE))) {
             DLOG("Assignment matches (%p)\n", match);
-            if (assignment->type == A_TO_WORKSPACE) {
-                Con *assigned_ws = workspace_get(assignment->dest.workspace, NULL);
-                nc = con_descend_tiling_focused(assigned_ws);
-                DLOG("focused on ws %s: %p / %s\n", assigned_ws->name, nc, nc->name);
-                if (nc->type == CT_WORKSPACE)
-                    nc = tree_open_con(nc, cwindow);
-                else
-                    nc = tree_open_con(nc->parent, cwindow);
-
-                /* set the urgency hint on the window if the workspace is not visible */
-                if (!workspace_is_visible(assigned_ws))
-                    urgency_hint = true;
-            }
-            /* TODO: handle assignments with type == A_TO_OUTPUT */
+            Con *assigned_ws = workspace_get(assignment->dest.workspace, NULL);
+            nc = con_descend_tiling_focused(assigned_ws);
+            DLOG("focused on ws %s: %p / %s\n", assigned_ws->name, nc, nc->name);
+            if (nc->type == CT_WORKSPACE)
+                nc = tree_open_con(nc, cwindow);
+            else
+                nc = tree_open_con(nc->parent, cwindow);
+
+            /* set the urgency hint on the window if the workspace is not visible */
+            if (!workspace_is_visible(assigned_ws))
+                urgency_hint = true;
         } else if (startup_ws) {
             /* If it’s not assigned, but was started on a specific workspace,
              * we want to open it there */
index 379fd3d6c133bb6f1a0524fd61639795a98199f0..f2487797876b7f7520db35c5dbcb0997d51d3b15 100644 (file)
@@ -19,7 +19,9 @@ sub noninteractive {
     # CONTINUOUS_INTEGRATION gets set when running under Travis, see
     # http://docs.travis-ci.com/user/ci-environment/ and
     # https://github.com/travis-ci/travis-ci/issues/1337
-    return (! -t STDOUT) || $ENV{CONTINUOUS_INTEGRATION} eq 'true';
+    return (! -t STDOUT) || (
+        defined($ENV{CONTINUOUS_INTEGRATION}) &&
+        $ENV{CONTINUOUS_INTEGRATION} eq 'true');
 }
 
 # setup %ansi_line_upwards to map all working displays to the
index 0fb8c8be364a09a638bcbc5c7d858fdeafdedab3..b6ebc876a14c9020a154f828e0646c6c11a09869 100644 (file)
@@ -31,7 +31,7 @@ my $config = <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
-force_display_urgency_hint 150ms
+force_display_urgency_hint 500ms
 EOT
 my $pid = launch_with_config($config);
 
@@ -70,7 +70,7 @@ is(@urgent, 1, 'window still marked as urgent');
 # now check if the timer was triggered
 cmd "workspace $tmp2";
 
-sleep(0.1);
+sleep(0.5);
 @content = @{get_ws_content($tmp1)};
 @urgent = grep { $_->{urgent} } @content;
 is(@urgent, 0, 'window not marked as urgent anymore');
@@ -142,7 +142,7 @@ cmd "workspace $tmp3";
 $split_left->delete_hint('urgency');
 sync_with_i3;
 
-sleep(0.2);
+sleep(0.6);
 is(count_total_urgent(get_ws($tmp3)), 0, "no more urgent windows on workspace $tmp3");
 
 exit_gracefully($pid);