]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #1893 from rr-/resize
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Fri, 11 Sep 2015 21:31:33 +0000 (14:31 -0700)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Fri, 11 Sep 2015 21:31:33 +0000 (14:31 -0700)
Added cmd_size

15 files changed:
RELEASE-NOTES-4.10.3 [deleted file]
RELEASE-NOTES-4.10.4 [new file with mode: 0644]
debian/changelog
docs/debugging
docs/userguide
libi3/string.c
man/asciidoc.conf
release.sh
src/bindings.c
src/commands.c
src/con.c
src/handlers.c
src/window.c
testcases/t/101-focus.t
testcases/t/526-reconfigure-dock.t [new file with mode: 0644]

diff --git a/RELEASE-NOTES-4.10.3 b/RELEASE-NOTES-4.10.3
deleted file mode 100644 (file)
index 524f552..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-
- ┌──────────────────────────────┐
- │ Release notes for i3 v4.10.3 │
- └──────────────────────────────┘
-
-This is i3 v4.10.3. This version is considered stable. All users of i3 are
-strongly encouraged to upgrade.
-
- ┌────────────────────────────┐
- │ Bugfixes                   │
- └────────────────────────────┘
-
-  • serialize con_id with %p in run_binding() (For FreeBSD)
-  • ignore InputHint when not in WM_HINTS (fixes e.g. mupdf focus)
-  • disable physically disconnect RandR outputs
-  • initialize workspace rect to the output's upon creation
-  • userguide: quoted strings need to be used, escaping isn’t possible
-  • mkdirp: do not throw an error if directory exists (fixes layout loss for
-    in-place restarts)
-  • i3bar: fix freeing static strings
-
- ┌────────────────────────────┐
- │ Thanks!                    │
- └────────────────────────────┘
-
-Thanks for testing, bugfixes, discussions and everything I forgot go out to:
-
-  Tony Crisci, Deiz, Theo Buehler, shdown
-
--- Michael Stapelberg, 2015-07-30
diff --git a/RELEASE-NOTES-4.10.4 b/RELEASE-NOTES-4.10.4
new file mode 100644 (file)
index 0000000..803bc7f
--- /dev/null
@@ -0,0 +1,24 @@
+
+ ┌──────────────────────────────┐
+ │ Release notes for i3 v4.10.4 │
+ └──────────────────────────────┘
+
+This is i3 v4.10.4. This version is considered stable. All users of i3 are
+strongly encouraged to upgrade.
+
+ ┌────────────────────────────┐
+ │ Bugfixes                   │
+ └────────────────────────────┘
+
+  • revert: disable physically disconnected RandR outputs
+  • i3-msg: strdup getenv() result before freeing
+
+ ┌────────────────────────────┐
+ │ Thanks!                    │
+ └────────────────────────────┘
+
+Thanks for testing, bugfixes, discussions and everything I forgot go out to:
+
+  shdown
+
+-- Michael Stapelberg, 2015-09-08
index 96b7fd2379595a99934fb5210e934f59cb745a28..65b7fc105c34a4b908976e42dcebdfa179b98b54 100644 (file)
@@ -1,8 +1,14 @@
+i3-wm (4.10.5-1) unstable; urgency=medium
+
+  * UNRELEASED
+
+ -- Michael Stapelberg <stapelberg@debian.org>  Tue, 08 Sep 2015 09:25:45 +0200
+
 i3-wm (4.10.4-1) unstable; urgency=medium
 
-  * NOT YET RELEASED.
+  * New upstream release.
 
- -- Michael Stapelberg <stapelberg@debian.org>  Thu, 30 Jul 2015 22:30:45 +0200
+ -- Michael Stapelberg <stapelberg@debian.org>  Tue, 08 Sep 2015 09:15:45 +0200
 
 i3-wm (4.10.3-1) unstable; urgency=medium
 
index 55197753c0d03ffffff82097f00ebab1c9d0069c..7be7c8e5b37f2d4cd44134c30b9b6f32f4a3ea0a 100644 (file)
@@ -93,10 +93,17 @@ issue with the software in question, not i3.
 
 == Obtaining the debug logfile
 
-Please note that log files may contain sensitive data such as window titles.
+[CAUTION]
+================================================================================
+Logs may contain sensitive information, so please inspect the log before
+submitting it. Logs may be viewed by anyone, once posted. If you choose to
+redact the log, make an effort not to discard information which may be relevant
+to the issue you are reporting.
+
 The best way to avoid submitting such information is to only run the necessary
-applications to reproduce the behavior when saving the log file. This will also
-make analyzing the log file easier.
+steps to reproduce the behavior when saving the log file. This will also make
+analyzing the log file easier.
+================================================================================
 
 No matter whether i3 misbehaved in some way without crashing or whether it just
 crashed, the logfile provides all information necessary to debug the problem.
index ab9d27d104d97657390bfc3093a33ade7520d7ce..5e148ff547ef930ca89ad6fb978aa691adcfc18c 100644 (file)
@@ -1944,7 +1944,7 @@ rename workspace to <new_name>
 i3-msg 'rename workspace 5 to 6'
 i3-msg 'rename workspace 1 to "1: www"'
 i3-msg 'rename workspace "1: www" to "10: www"'
-i3-msg 'rename workspace to "2: mail"
+i3-msg 'rename workspace to "2: mail"'
 bindsym $mod+r exec i3-input -F 'rename workspace to "%s"' -P 'New name: '
 --------------------------------------------------------------------------
 
index a7b8c6fc4f1a6be6917106423cb58616500d8b66..7741fde064f0ade5ab81583d802c3e593f7cdcc1 100644 (file)
@@ -194,7 +194,10 @@ void i3string_set_markup(i3String *str, bool is_markup) {
 i3String *i3string_escape_markup(i3String *str) {
 #if PANGO_SUPPORT
     const char *text = i3string_as_utf8(str);
-    return i3string_from_utf8(g_markup_escape_text(text, -1));
+    char *escaped = g_markup_escape_text(text, -1);
+    i3String *result = i3string_from_utf8(escaped);
+    free(escaped);
+    return result;
 #else
     return str;
 #endif
index eda71d6e2c1e1041c9019dc1f3d5033529416efe..ad2348d687a4f89459cede7b1e426d4586494b1d 100644 (file)
@@ -7,7 +7,7 @@ template::[header-declarations]
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>
 <refmiscinfo class="source">i3</refmiscinfo>
-<refmiscinfo class="version">4.10.3</refmiscinfo>
+<refmiscinfo class="version">4.10.4</refmiscinfo>
 <refmiscinfo class="manual">i3 Manual</refmiscinfo>
 </refmeta>
 <refnamediv>
index 1ca70754d25ec5eaa8118c0867063cad2360a660..33b8dcd63f3a799ba6203a330d553bb6779be0a3 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/zsh
 # This script is used to prepare a new release of i3.
 
-export RELEASE_VERSION="4.10.3"
-export PREVIOUS_VERSION="4.10.2"
+export RELEASE_VERSION="4.10.4"
+export PREVIOUS_VERSION="4.10.3"
 export RELEASE_BRANCH="master"
 
 if [ ! -e "../i3.github.io" ]
index f9d2cf8d3252639396b46d5b5303f857c0b832ed..32aac05af3d605e5c9c0f6fa4b7442e6db726e23 100644 (file)
@@ -80,13 +80,13 @@ Binding *configure_binding(const char *bindtype, const char *modifiers, const ch
     new_binding->command = sstrdup(command);
     new_binding->event_state_mask = event_state_from_str(modifiers);
     int group_bits_set = 0;
-    if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_1)
+    if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_1)
         group_bits_set++;
-    if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_2)
+    if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_2)
         group_bits_set++;
-    if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_3)
+    if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_3)
         group_bits_set++;
-    if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_4)
+    if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_4)
         group_bits_set++;
     if (group_bits_set > 1)
         ELOG("Keybinding has more than one Group specified, but your X server is always in precisely one group. The keybinding can never trigger.\n");
index 1967e2227f22c81f3afe4295accc9c50eb33b081..443edf4a66304634e3b3d7b96fcbbd78427417c7 100644 (file)
@@ -1538,8 +1538,7 @@ void cmd_focus(I3_CMD) {
             count);
 
     cmd_output->needs_tree_render = true;
-    // XXX: default reply for now, make this a better reply
-    ysuccess(true);
+    ysuccess(count > 0);
 }
 
 /*
index b1ddf2acc3340eb4d955dcf15f0bcba336627417..9a5d36c13c4e32bd9aa858f73171ba724b172cd0 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -1245,18 +1245,13 @@ Rect con_border_style_rect(Con *con) {
     int border_style = con_border_style(con);
     if (border_style == BS_NONE)
         return (Rect){0, 0, 0, 0};
-    borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
     if (border_style == BS_NORMAL) {
         result = (Rect){border_width, 0, -(2 * border_width), -(border_width)};
     } else {
         result = (Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
     }
 
-    /* Floating windows are never adjacent to any other window, so
-       don’t hide their border(s). This prevents bug #998. */
-    if (con_is_floating(con))
-        return result;
-
+    borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
     if (borders_to_hide & ADJ_LEFT_SCREEN_EDGE) {
         result.x -= border_width;
         result.width += border_width;
@@ -1280,6 +1275,11 @@ Rect con_border_style_rect(Con *con) {
  */
 adjacent_t con_adjacent_borders(Con *con) {
     adjacent_t result = ADJ_NONE;
+    /* Floating windows are never adjacent to any other window, so
+       don’t hide their border(s). This prevents bug #998. */
+    if (con_is_floating(con))
+        return result;
+
     Con *workspace = con_get_workspace(con);
     if (con->rect.x == workspace->rect.x)
         result |= ADJ_LEFT_SCREEN_EDGE;
index 1e7eef1e210ba414106b593b27a3ff1004c6112d..f3c2350e5c75e2961ceb3a88b27dbc309e50d409 100644 (file)
@@ -386,15 +386,35 @@ static void handle_configure_request(xcb_configure_request_event_t *event) {
         return;
     }
 
-    /* Dock windows can be reconfigured in their height */
+    /* Dock windows can be reconfigured in their height and moved to another output. */
     if (con->parent && con->parent->type == CT_DOCKAREA) {
-        DLOG("Dock window, only height reconfiguration allowed\n");
+        DLOG("Reconfiguring dock window (con = %p).\n", con);
         if (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
-            DLOG("Height given, changing\n");
+            DLOG("Dock client wants to change height to %d, we can do that.\n", event->height);
 
             con->geometry.height = event->height;
             tree_render();
         }
+
+        if (event->value_mask & XCB_CONFIG_WINDOW_X || event->value_mask & XCB_CONFIG_WINDOW_Y) {
+            int16_t x = event->value_mask & XCB_CONFIG_WINDOW_X ? event->x : (int16_t)con->geometry.x;
+            int16_t y = event->value_mask & XCB_CONFIG_WINDOW_Y ? event->y : (int16_t)con->geometry.y;
+
+            Con *current_output = con_get_output(con);
+            Output *target = get_output_containing(x, y);
+            if (target != NULL && current_output != target->con) {
+                DLOG("Dock client is requested to be moved to output %s, moving it there.\n", target->name);
+                Match *match;
+                Con *nc = con_for_window(target->con, con->window, &match);
+                DLOG("Dock client will be moved to container %p.\n", nc);
+                con_detach(con);
+                con_attach(con, nc, false);
+
+                tree_render();
+            } else {
+                DLOG("Dock client will not be moved, we only support moving it to another output.\n");
+            }
+        }
     }
 
     fake_absolute_configure_notify(con);
index 278918c74eb42ecf4b829a4adfb3009a756ce4be..5898333f3d6490f9074f53b50df9511208b29c22 100644 (file)
@@ -359,7 +359,7 @@ i3String *window_parse_title_format(i3Window *win) {
     for (char *walk = format; *walk != '\0'; walk++) {
         if (STARTS_WITH(walk, "%title")) {
             if (escaped_title == NULL)
-                escaped_title = i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name);
+                escaped_title = win->name == NULL ? "" : i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name);
 
             buffer_len = buffer_len - strlen("%title") + strlen(escaped_title);
             walk += strlen("%title") - 1;
@@ -396,6 +396,8 @@ i3String *window_parse_title_format(i3Window *win) {
         } else if (STARTS_WITH(walk + 1, "instance")) {
             outwalk += sprintf(outwalk, "%s", escaped_instance);
             walk += strlen("instance");
+        } else {
+            *(outwalk++) = *walk;
         }
     }
     *outwalk = '\0';
index d6ce0fb864ee6eeb1e39f7ffa4f2723249687478..0aac87f95275f0a69ae31c7395e80396d9102f03 100644 (file)
@@ -60,48 +60,14 @@ is($focus, $bottom->id, "Bottom window focused (wrapping to the top works)");
 $focus = focus_after('focus down');
 is($focus, $top->id, "Top window focused (wrapping to the bottom works)");
 
-###############################################
-# Test focus with empty containers and colspan
-###############################################
+#####################################################################
+# Test focus is only successful if there was a window that could be
+# matched.
+#####################################################################
 
-#my $otmp = get_unused_workspace();
-#$i3->command("workspace $otmp")->recv;
-#
-#$top = i3test::open_standard_window($x);
-#$bottom = i3test::open_standard_window($x);
-#sleep 0.25;
-#
-#$focus = focus_after("mj");
-#$focus = focus_after("mh");
-#$focus = focus_after("k");
-#is($focus, $bottom->id, "Selecting top window without snapping doesn't work");
-#
-#$focus = focus_after("sl");
-#is($focus, $bottom->id, "Bottom window focused");
-#
-#$focus = focus_after("k");
-#is($focus, $top->id, "Top window focused");
-#
-## Same thing, but left/right instead of top/bottom
-#
-#my $o2tmp = get_unused_workspace();
-#$i3->command("workspace $o2tmp")->recv;
-#
-#my $left = i3test::open_standard_window($x);
-#my $right = i3test::open_standard_window($x);
-#sleep 0.25;
-#
-#$focus = focus_after("ml");
-#$focus = focus_after("h");
-#$focus = focus_after("mk");
-#$focus = focus_after("l");
-#is($focus, $left->id, "Selecting right window without snapping doesn't work");
-#
-#$focus = focus_after("sj");
-#is($focus, $left->id, "left window focused");
-#
-#$focus = focus_after("l");
-#is($focus, $right->id, "right window focused");
+my $result = cmd '[con_mark=__does_not_exist] focus';
+is($result->[0]->{success}, 0, 'focus is unsuccessful if no window was matched');
 
+#####################################################################
 
 done_testing;
diff --git a/testcases/t/526-reconfigure-dock.t b/testcases/t/526-reconfigure-dock.t
new file mode 100644 (file)
index 0000000..9e3ed3f
--- /dev/null
@@ -0,0 +1,57 @@
+#!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 reconfiguration of dock clients.
+# Ticket: #1883
+use i3test i3_autostart => 0;
+
+my ($config, $pid, $window, $rect);
+my (@docks);
+
+###############################################################################
+# 1: Given two screens A and B and a dock client on screen A, when the dock
+#    client is reconfigured to be positioned on screen B, then the client is
+#    moved to the correct position.
+###############################################################################
+
+$config = <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+fake-outputs 1024x768+0+0,1024x768+1024+0
+EOT
+$pid = launch_with_config($config);
+
+$window = open_window({
+        window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK')
+    });
+
+$rect = $window->rect;
+is($rect->x, 0, 'sanity check: dock client is on the left screen');
+
+$window->rect(X11::XCB::Rect->new(x => 1024, y => 0, width => 1024, height => 30));
+sync_with_i3;
+
+@docks = get_dock_clients;
+is(@docks, 1, 'there is still exactly one dock');
+
+is($docks[0]->{rect}->{x}, 1024, 'dock client has moved to the other screen');
+
+exit_gracefully($pid);
+
+###############################################################################
+
+done_testing;