]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: resize window check should check for null
authorTony Crisci <tony@dubstepdish.com>
Fri, 18 Apr 2014 18:14:22 +0000 (14:14 -0400)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 26 Apr 2014 10:10:05 +0000 (12:10 +0200)
When checking the window type for a resize command, first check to see
if the window property is null before checking whether or not it is a
dock window. The window may be null in the case it is a branch
container.

fixes #1220

src/commands.c
testcases/t/224-regress-resize-branch.t [new file with mode: 0644]

index 11d0b24469e38726aa4d57d4a9e3cde90691d864..e1aa063b541f8f0a5f66c85bc9dce8b05eb47d89 100644 (file)
@@ -782,7 +782,7 @@ void cmd_resize(I3_CMD, char *way, char *direction, char *resize_px, char *resiz
     owindow *current;
     TAILQ_FOREACH(current, &owindows, owindows) {
         /* Don't handle dock windows (issue #1201) */
-        if (current->con->window->dock) {
+        if (current->con->window && current->con->window->dock) {
             DLOG("This is a dock window. Not resizing (con = %p)\n)", current->con);
             continue;
         }
diff --git a/testcases/t/224-regress-resize-branch.t b/testcases/t/224-regress-resize-branch.t
new file mode 100644 (file)
index 0000000..a4a1b31
--- /dev/null
@@ -0,0 +1,33 @@
+#!perl
+# vim:ts=4:sw=4:expandtab
+#
+# Please read the following documents before working on tests:
+# • http://build.i3wm.org/docs/testsuite.html
+#   (or docs/testsuite)
+#
+# • http://build.i3wm.org/docs/lib-i3test.html
+#   (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • http://build.i3wm.org/docs/ipc.html
+#   (or docs/ipc)
+#
+# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
+#   (unless you are already familiar with Perl)
+#
+# Test that i3 does not crash when resizing a split container
+# Ticket: #1220
+# Bug still in: 4.7.2-128-g702906d
+use i3test;
+
+open_window;
+open_window;
+
+cmd 'split h';
+
+open_window;
+
+cmd 'focus parent, resize grow left';
+
+does_i3_live;
+
+done_testing;