]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t crash anymore when moving focus to another screen (Thanks, Mirko!)
authorMichael Stapelberg <michael+x200@stapelberg.de>
Fri, 10 Apr 2009 19:29:25 +0000 (21:29 +0200)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Fri, 10 Apr 2009 19:29:25 +0000 (21:29 +0200)
This fixes ticket #24. The crash appeared only under special conditions:
- The screen on which you switch to must be empty or at least not as
  full as the screen on which you were before.
- You switch focus using your mouse.
- You previously selected a column/row which is not availably on the
  destination screen (for example (1,1) and switching to an empty
  screen).

src/handlers.c

index faca13bca1d30319bcc435313f40350b8d248135..477666236c2053f11954d6abc91f51fa3e797ec5 100644 (file)
@@ -173,7 +173,11 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, xcb_enter_notify_
                         LOG("ERROR: No such screen\n");
                         return 0;
                 }
+                c_ws->current_row = current_row;
+                c_ws->current_col = current_col;
                 c_ws = &workspaces[screen->current_workspace];
+                current_row = c_ws->current_row;
+                current_col = c_ws->current_col;
                 LOG("We're now on virtual screen number %d\n", screen->num);
                 return 1;
         }