]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #1513 from Airblader/defect-1473
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Fri, 13 Mar 2015 07:52:52 +0000 (00:52 -0700)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Fri, 13 Mar 2015 07:52:52 +0000 (00:52 -0700)
Move workspace to assigned output when renaming it

51 files changed:
RELEASE-NOTES-4.8 [deleted file]
RELEASE-NOTES-4.9.1 [new file with mode: 0644]
debian/changelog
docs/hacking-howto
docs/i3bar-protocol
docs/testsuite
docs/userguide
i3-config-wizard/main.c
i3-dmenu-desktop
i3-input/main.c
i3-migrate-config-to-v4
i3-nagbar/main.c
i3.config
i3.config.keycodes
i3bar/include/common.h
i3bar/src/child.c
i3bar/src/main.c
i3bar/src/workspaces.c
i3bar/src/xcb.c
include/atoms.xmacro
include/config.h
include/data.h
include/key_press.h
include/libi3.h
libi3/font.c
libi3/string.c
man/asciidoc.conf
man/i3-sensible-editor.man
man/i3-sensible-pager.man
man/i3-sensible-terminal.man
release.sh [new file with mode: 0755]
src/bindings.c
src/click.c
src/commands.c
src/con.c
src/config_parser.c
src/floating.c
src/handlers.c
src/ipc.c
src/main.c
src/manage.c
src/render.c
src/restore_layout.c
src/sighandler.c
src/tree.c
src/util.c
src/window.c
src/x.c
src/xcb.c
src/xcursor.c
testcases/t/231-wm-change-state.t [deleted file]

diff --git a/RELEASE-NOTES-4.8 b/RELEASE-NOTES-4.8
deleted file mode 100644 (file)
index f0f5923..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-
- ┌──────────────────────────────┐
- │ Release notes for i3 v4.8    │
- └──────────────────────────────┘
-
-This is i3 v4.8. This version is considered stable. All users of i3 are
-strongly encouraged to upgrade.
-
-The biggest new feature certainly is layout saving/restoring. See
-http://i3wm.org/docs/layout-saving.html for more details. tl;dr: export your
-current layout as JSON file, load it into new i3 sessions, get placeholder
-windows that will be replaced by the actual apps once you start them.
-
-Also very important for owners of HiDPI/“retina” displays is that i3 will now
-respect your configured DPI and scale up its UI elements accordingly. Use
-“xrandr --dpi 184” to set your dpi to 184, in case your setup does not figure
-it out automatically. To get properly scaling fonts, we also changed the
-default font from a bitmap font to a pango font (“DejaVu Sans Mono 8”).
-
-Multiple changes improve the compatibility of i3 with other software, e.g.
-java-based software (focus handling, once again) or external pagers (we now
-provide _NET_CLIENT_LIST and let pager applications change workspaces).
-
-For packagers, another change is that yajl ≥ 2.0 is now required for compiling
-i3. This should not be a problem for anyone, as that version is pretty old by
-now.
-
-For contributors, note that we have starting formatting the source code with
-clang-format-3.5. This means that there will no longer be a need to argue about
-coding style when discussing patches :).
-
- ┌────────────────────────────┐
- │ Changes in v4.8            │
- └────────────────────────────┘
-
-  • docs/ipc: reformat/update list of ipc libraries
-  • docs/ipc: fix current_workspace outputs reply member
-  • docs/ipc: update ipc COMMAND reply docs
-  • docs/userguide: fix multiple typos
-  • docs/debugging: use bzip2
-  • docs/debugging: explain how to enable logging on the fly
-  • docs/debugging: merge the debug symbols/backtrace section
-  • docs/debugging: recommend i3 --moreversion
-  • man/i3-nagbar.man: update manpage to document all options
-  • i3bar: Amend status line error 127 message
-  • i3bar: don’t kill watcher on EOF, leads to better error messages
-  • i3bar: send mouse wheel events to child too
-  • i3bar: do click handling and tray padding retina-correctly
-  • i3bar: render separators render-correctly
-  • i3bar: reinit colors on barconfig update
-  • i3bar: Don't start child unless status_command
-  • i3bar: implement custom workspace numbers config
-  • resize floating windows when right-clicking the decoration
-  • enable shmlog when invoked as i3-with-shmlog
-  • Disable pointer warps when focus_follows_mouse is disabled
-  • Movement into a branch considers movement direction
-  • set ewmh desktop properties on startup
-  • handle ButtonPress events with child != XCB_NONE
-  • implement layout restoring
-  • only LOG() the DPI when it changes, DLOG() it otherwise
-  • send IPC window events for focus and title changes
-  • these types of windows are now floating by default:
-    dialog, utility, toolbar and splash windows, modal windows, windows with an
-    equal minimum and maximum size
-  • send last event timestamp with WM_TAKE_FOCUS message
-  • maintain the _NET_CLIENT_LIST property
-  • don’t set input focus _and_ send WM_TAKE_FOCUS
-  • respect CFLAGS in linking command
-  • fix parallel make
-  • reset SIGPIPE handler before executing a command
-  • render default window border width retina-correctly
-  • draw workspace buttons and padded text blocks retina-correctly
-  • render resize windows retina-correctly
-  • delegate click handling to dock clients
-  • send complete config on barconfig_update
-  • implement the window::fullscreen_mode ipc event
-  • make all workspaces starting with "__" internal
-  • improve error messages for i3-internal workspace names
-  • allow _NET_ACTIVE_WINDOW requests to switch workspaces if they indicate
-    that they are a pager (following the spec)
-  • workspace assignments by number
-  • add configuration option for disabling mouse warping
-  • set _NET_ACTIVE_WINDOW to None when none has focus
-  • set X-LightDM-DesktopName in i3.xsession.desktop to fix autostart on Ubuntu
-  • don’t ELOG ipc EOF
-  • replace all printf()s with D?LOG
-  • delete ipc socket when exiting, cleanup tmpdir
-  • default config: switch to DejaVu Sans Mono 8 as default font
-  • cleanup tmpdir when restarting and not using XDG_RUNTIME_DIR
-  • Snap pointer to resize bar on drag resize
-  • Size resizebar according to container size
-  • Fix clang -Wextra except -Wunused-parameter
-  • Respect Motif hint for window decorations
-
- ┌────────────────────────────┐
- │ Bugfixes                   │
- └────────────────────────────┘
-
-  • create con pixmaps when not needed
-  • i3bar: fix resource leak: statusline_ctx needs to be freed first
-  • tree_split should not split floating cons
-  • fix memory leak with ipc_receive_message
-  • fix invalid reads by setting con->window to NULL in tree_close
-  • fix memory leak when closing windows
-  • fix memory leak when matching window by criteria
-  • fix memory leak when matching window by con_id
-  • ignore dock clients in the resize command
-  • clear wm_size_hints if they are not set
-  • resize window check should check for NULL
-  • fix window event crash with no window
-  • i3-dmenu-desktop: also quote the %c field code
-  • new_window and new_float can now be used simultaneously with different
-    border widths
-  • fix crash when using multiple for_window statements that move windows
-  • Set input focus with last timestamp
-  • handle windows whose WM_TRANSIENT_FOR points to themselve
-  • don’t overwrite the original size of floating windows when changing border
-  • don’t errnously render floating fullscreen windows during restart
-  • ensure floating windows don’t drop out of fullscreen when restarting
-  • don’t overwrite the window’s geometry after restartingnext
-  • i3bar: Set `mapped` flag on trayclient creation
-  • i3bar: don't show "EOF" status line error
-
- ┌────────────────────────────┐
- │ Thanks!                    │
- └────────────────────────────┘
-
-Thanks for testing, bugfixes, discussions and everything I forgot go out to:
-
-Aleksi Blinnikka, Alexander Berntsen, Alexander Kedrik, Antonio, Arun
-Persaud, Atte Peltomaki, bo, Campbell Barton, chris, David Coppa, eeemsi,
-Holger Langenau, Jean-Philippe Ouellet, Jens, jeroentbt, Jonas Maaskola,
-Julian Ospald, Kernc, Koston, lasers, lkraav, Marcin, Marco Hunsicker,
-Marcus Crestani, Matthias Thubauville, Maxime, Michael Stapelberg, Peter
-Boström, Petr Písař, Quentin Glidic, Steve Jones, TonyC, Tony Crisci,
-Vivien Didelot, Wieland Hoffmann, x33a, xeen
-
--- Michael Stapelberg, 2014-06-15
diff --git a/RELEASE-NOTES-4.9.1 b/RELEASE-NOTES-4.9.1
new file mode 100644 (file)
index 0000000..5ff6d22
--- /dev/null
@@ -0,0 +1,36 @@
+
+ ┌──────────────────────────────┐
+ │ Release notes for i3 v4.9.1  │
+ └──────────────────────────────┘
+
+This is i3 v4.9.1. This version is considered stable. All users of i3 are
+strongly encouraged to upgrade.
+
+This is a bugfix release for i3 v4.9.
+
+ ┌────────────────────────────┐
+ │ Bugfixes                   │
+ └────────────────────────────┘
+
+  • i3bar: fix incorrect y-offset for text
+  • fix key bindings on big-endian platforms
+  • fix key bindings using Mode_switch
+  • fix keyboard layout change detection
+  • revert "Handle WM_CHANGE_STATE requests for iconic state" (fixes problems
+    with application windows disappearing, like SDL-based games when switching
+    workspaces)
+  • insert id-based match at HEAD, not TAIL (fixes window swallowing not
+    working when the criteria match the placeholder window)
+  • improve error messages on failing commands
+  • replace ~ in filepath when calling append_layout
+  • properly error out when the layout file cannot be read
+
+ ┌────────────────────────────┐
+ │ Thanks!                    │
+ └────────────────────────────┘
+
+Thanks for testing, bugfixes, discussions and everything I forgot go out to:
+
+  Steven McDonald, Ton van den Heuvel, Ingo Bürk
+
+-- Michael Stapelberg, 2015-03-07
index 02fb0e536df0786c03dd36f310f03c95cedbdbd1..1dcfc9f9fc6b45a458ded6042da814f30149c967 100644 (file)
@@ -1,8 +1,20 @@
-i3-wm (4.8.1-1) unstable; urgency=medium
+i3-wm (4.9.2-1) experimental; urgency=medium
 
-  * NOT YET RELEASED
+  * NOT YET RELEASED.
 
- -- Michael Stapelberg <stapelberg@debian.org>  Sun, 15 Jun 2014 19:37:32 +0200
+ -- Michael Stapelberg <stapelberg@debian.org>  Sat, 07 Mar 2015 20:31:31 +0100
+
+i3-wm (4.9.1-1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Michael Stapelberg <stapelberg@debian.org>  Sat, 07 Mar 2015 20:01:46 +0100
+
+i3-wm (4.9-1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Michael Stapelberg <stapelberg@debian.org>  Sat, 28 Feb 2015 14:53:34 +0100
 
 i3-wm (4.8-2) unstable; urgency=medium
 
index a591047ede3986f6235d1e9ba301292902c9932a..12d6b14ee1b2da3406d4b78e7960c66288207749 100644 (file)
@@ -1012,7 +1012,7 @@ gets started in any way) and the window(s) which appear.
 
 Imagine for example using dmenu: The user starts dmenu by pressing Mod+d, dmenu
 gets started with PID 3390. The user then decides to launch Firefox, which
-takes a long time. So he enters firefox into dmenu and presses enter. Firefox
+takes a long time. So they enter firefox into dmenu and press enter. Firefox
 gets started with PID 4001. When it finally finishes loading, it creates an X11
 window and uses MapWindow to make it visible. This is the first time i3
 actually gets in touch with Firefox. It decides to map the window, but it has
index 0ca2fd82c9e3d3e0233d359dcdfe682e1c063588..8fd51ae9359cfe92ae1fd6f45a2057bf0a591b1a 100644 (file)
@@ -119,7 +119,8 @@ click_events::
 full_text::
        The most simple block you can think of is one which just includes the
        only required key, the +full_text+ key. i3bar will display the string
-       value and that’s it.
+       value parsed as
+       https://developer.gnome.org/pango/stable/PangoMarkupFormat.html[Pango markup].
 short_text::
        Where appropriate, the +short_text+ (string) entry should also be
        provided. It will be used in case the status line needs to be shortened
index 61a7221962af1161010cd23d7440fb549733874f..29a352185da2f2f39ec2e24cf47224671fda86d6 100644 (file)
@@ -107,6 +107,11 @@ containing the appropriate i3 logfile for each testcase. The latest folder can
 always be found under the symlink +latest/+. Unless told differently, it will
 run the tests on a separate X server instance (using Xephyr).
 
+Xephyr will open a window where you can inspect the running test. You can run
+the tests without an X session with Xvfb, such as with +xvfb-run
+./complete-run+. This will also speed up the tests signficantly especially on
+machines without a powerful video card.
+
 .Example invocation of complete-run.pl+
 ---------------------------------------
 $ cd ~/i3/testcases
index 4b4dacc858a1c76ce62b024ee756804be9b3ce08..45b05a062fcbaf020521fee55a0362cca997bc5f 100644 (file)
@@ -1625,6 +1625,10 @@ container to the next/previous workspace and +move container to workspace curren
 See <<move_to_outputs>> for how to move a container/workspace to a different
 RandR output.
 
+Workspace names are parsed as
+https://developer.gnome.org/pango/stable/PangoMarkupFormat.html[Pango markup]
+by i3bar.
+
 [[back_and_forth]]
 To switch back to the previously focused workspace, use +workspace
 back_and_forth+; likewise, you can move containers to the previously focused
@@ -1646,6 +1650,7 @@ move [window|container] [to] workspace <prev|next|current>
 -------------------------
 bindsym $mod+1 workspace 1
 bindsym $mod+2 workspace 2
+bindsym $mod+3 workspace 3:<span foreground="red">vim</span>
 ...
 
 bindsym $mod+Shift+1 move container to workspace 1
index c09d459d8d67cf0495e64955bec2c0d3e11ddafd..5a855c40cb76832978b794a4acbb3e2fe05af3f9 100644 (file)
@@ -494,7 +494,7 @@ static char *resolve_tilde(const char *path) {
 static int handle_expose() {
     /* re-draw the background */
     xcb_rectangle_t border = {0, 0, 300, (15 * font.height) + 8};
-    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#000000")});
+    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){get_colorpixel("#000000")});
     xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &border);
 
     set_font(&font);
@@ -870,7 +870,7 @@ int main(int argc, char *argv[]) {
         XCB_WINDOW_CLASS_INPUT_OUTPUT,
         XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
         XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK,
-        (uint32_t[]) {
+        (uint32_t[]){
             0, /* back pixel: black */
             XCB_EVENT_MASK_EXPOSURE |
                 XCB_EVENT_MASK_BUTTON_PRESS});
index 2c54233d02501a57bb776cf7dad0260aea777a4f..cc72f1016429780c2e13a2ef8378c119701cb9e0 100755 (executable)
@@ -306,7 +306,7 @@ for my $app (keys %apps) {
 #   };
 
 # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
-# ┃ Run dmenu to ask the user for her choice                                  ┃
+# ┃ Run dmenu to ask the user for their choice                                ┃
 # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
 
 # open2 will just make dmenu’s STDERR go to our own STDERR.
index 9f3ff174a786928f66b9eef2eaccbd904dfe10d9..7d5231905ccd0cd408624f32d64ac90310967f48 100644 (file)
@@ -130,9 +130,9 @@ static int handle_expose(void *data, xcb_connection_t *conn, xcb_expose_event_t
 
     /* re-draw the background */
     xcb_rectangle_t border = {0, 0, 500, font.height + 8}, inner = {2, 2, 496, font.height + 8 - 4};
-    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#FF0000")});
+    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){get_colorpixel("#FF0000")});
     xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &border);
-    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#000000")});
+    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){get_colorpixel("#000000")});
     xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &inner);
 
     /* restore font color */
@@ -410,7 +410,7 @@ int main(int argc, char *argv[]) {
         XCB_WINDOW_CLASS_INPUT_OUTPUT,
         XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
         XCB_CW_BACK_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK,
-        (uint32_t[]) {
+        (uint32_t[]){
             0, /* back pixel: black */
             1, /* override redirect: don’t manage this window */
             XCB_EVENT_MASK_EXPOSURE});
index ae5bf4deb02811e715885dc622c741dcf114a6cd..b78378be1c65a68225a38d8ebace7b5be0845a3d 100755 (executable)
@@ -341,7 +341,7 @@ sub convert_command {
             # NOTE: This is not 100% accurate, as it only works for one level
             # of nested containers. As this is a common use case, we use 'focus
             # parent; $command' nevertheless. For advanced use cases, the user
-            # has to modify his config.
+            # has to modify their config.
             print "$statement $key focus parent; $command\n";
         }
         return;
index 8dbc4a761fa851f70ad29f8c1d94721efa1256e4..b501ff6a304536437e02525d9f4846bd860922a8 100644 (file)
@@ -5,7 +5,7 @@
  * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * i3-nagbar is a utility which displays a nag message, for example in the case
- * when the user has an error in his configuration file.
+ * when the user has an error in their configuration file.
  *
  */
 #include <stdio.h>
@@ -188,7 +188,7 @@ static void handle_button_release(xcb_connection_t *conn, xcb_button_release_eve
  */
 static int handle_expose(xcb_connection_t *conn, xcb_expose_event_t *event) {
     /* re-draw the background */
-    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {color_background});
+    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){color_background});
     xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &rect);
 
     /* restore font color */
@@ -212,7 +212,7 @@ static int handle_expose(xcb_connection_t *conn, xcb_expose_event_t *event) {
     xcb_rectangle_t close = {y - w - (2 * line_width), 0, w + (2 * line_width), rect.height};
     xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &close);
 
-    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {color_border});
+    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){color_border});
     xcb_point_t points[] = {
         {y - w - (2 * line_width), line_width / 2},
         {y - (line_width / 2), line_width / 2},
@@ -238,11 +238,11 @@ static int handle_expose(xcb_connection_t *conn, xcb_expose_event_t *event) {
         /* account for left/right padding, which seems to be set to 12px (total) below */
         w += 12;
         y -= 30;
-        xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {color_button_background});
-        close = (xcb_rectangle_t) {y - w - (2 * line_width), 2, w + (2 * line_width), rect.height - 6};
+        xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){color_button_background});
+        close = (xcb_rectangle_t){y - w - (2 * line_width), 2, w + (2 * line_width), rect.height - 6};
         xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &close);
 
-        xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {color_border});
+        xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){color_border});
         buttons[c].x = y - w - (2 * line_width);
         buttons[c].width = w;
         xcb_point_t points2[] = {
@@ -415,7 +415,7 @@ int main(int argc, char *argv[]) {
         XCB_WINDOW_CLASS_INPUT_OUTPUT,
         XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
         XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK,
-        (uint32_t[]) {
+        (uint32_t[]){
             0, /* back pixel: black */
             XCB_EVENT_MASK_EXPOSURE |
                 XCB_EVENT_MASK_STRUCTURE_NOTIFY |
@@ -512,7 +512,7 @@ int main(int argc, char *argv[]) {
 
             case XCB_CONFIGURE_NOTIFY: {
                 xcb_configure_notify_event_t *configure_notify = (xcb_configure_notify_event_t *)event;
-                rect = (xcb_rectangle_t) {
+                rect = (xcb_rectangle_t){
                     configure_notify->x,
                     configure_notify->y,
                     configure_notify->width,
index d7e96fe9c01d185da6d007d02d0aff5be9b42ffc..f7722d361957c5d48b8aedc42c3d2033bba89d36 100644 (file)
--- a/i3.config
+++ b/i3.config
 
 # Font for window titles. Will also be used by the bar unless a different font
 # is used in the bar {} block below.
+font pango:monospace 8
+
 # This font is widely installed, provides lots of unicode glyphs, right-to-left
 # text rendering and scalability on retina/hidpi displays (thanks to pango).
-font pango:DejaVu Sans Mono 8
+#font pango:DejaVu Sans Mono 8
+
 # Before i3 v4.8, we used to recommend this one as the default:
 # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 # The font above is very space-efficient, that is, it looks good, sharp and
@@ -166,7 +169,7 @@ bar {
 
 #######################################################################
 # automatically start i3-config-wizard to offer the user to create a
-# keysym-based config which used his favorite modifier (alt or windows)
+# keysym-based config which used their favorite modifier (alt or windows)
 #
 # i3-config-wizard will not launch if there already is a config file
 # in ~/.i3/config.
index 93528a54eeafd50f31983a9d98aebc2141fb9f90..0c978d0b7c15928009cc75a00f4d79b63d865728 100644 (file)
@@ -12,9 +12,12 @@ set $mod Mod1
 
 # Font for window titles. Will also be used by the bar unless a different font
 # is used in the bar {} block below.
+font pango:monospace 8
+
 # This font is widely installed, provides lots of unicode glyphs, right-to-left
 # text rendering and scalability on retina/hidpi displays (thanks to pango).
-font pango:DejaVu Sans Mono 8
+#font pango:DejaVu Sans Mono 8
+
 # Before i3 v4.8, we used to recommend this one as the default:
 # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 # The font above is very space-efficient, that is, it looks good, sharp and
index e8b6be0a57ec7e2788a9a68a9eb4ed161cfceb8a..997a429ed518aab68274c1cf59e41e14ce74e25c 100644 (file)
@@ -16,8 +16,6 @@
 typedef struct rect_t rect;
 
 struct ev_loop *main_loop;
-char *statusline;
-char *statusline_buffer;
 
 struct rect_t {
     int x;
index d0f0c5fbc67deb004a66f73752e1b2c4a533038c..efe028843d0e4b2e1b5fa02d70efc9bc3fa04f9f 100644 (file)
@@ -54,26 +54,41 @@ typedef struct parser_ctx {
 
 parser_ctx parser_context;
 
-/* The buffer statusline points to */
 struct statusline_head statusline_head = TAILQ_HEAD_INITIALIZER(statusline_head);
-char *statusline_buffer = NULL;
+/* Used temporarily while reading a statusline */
+struct statusline_head statusline_buffer = TAILQ_HEAD_INITIALIZER(statusline_buffer);
 
 int child_stdin;
 
 /*
- * Clears all blocks from the statusline structure in memory and frees their
- * associated resources.
+ * Remove all blocks from the given statusline.
+ * If free_resources is set, the fields of each status block will be free'd.
  */
-static void clear_status_blocks() {
+static void clear_statusline(struct statusline_head *head, bool free_resources) {
     struct status_block *first;
-    while (!TAILQ_EMPTY(&statusline_head)) {
-        first = TAILQ_FIRST(&statusline_head);
-        I3STRING_FREE(first->full_text);
-        TAILQ_REMOVE(&statusline_head, first, blocks);
+    while (!TAILQ_EMPTY(head)) {
+        first = TAILQ_FIRST(head);
+        if (free_resources) {
+            I3STRING_FREE(first->full_text);
+            FREE(first->color);
+            FREE(first->name);
+            FREE(first->instance);
+        }
+
+        TAILQ_REMOVE(head, first, blocks);
         free(first);
     }
 }
 
+static void copy_statusline(struct statusline_head *from, struct statusline_head *to) {
+    struct status_block *current;
+    TAILQ_FOREACH(current, from, blocks) {
+        struct status_block *new_block = smalloc(sizeof(struct status_block));
+        memcpy(new_block, current, sizeof(struct status_block));
+        TAILQ_INSERT_TAIL(to, new_block, blocks);
+    }
+}
+
 /*
  * Replaces the statusline in memory with an error message. Pass a format
  * string and format parameters as you would in `printf'. The next time
@@ -81,7 +96,7 @@ static void clear_status_blocks() {
  * the space allocated for the statusline.
  */
 __attribute__((format(printf, 1, 2))) static void set_statusline_error(const char *format, ...) {
-    clear_status_blocks();
+    clear_statusline(&statusline_head, true);
 
     char *message;
     va_list args;
@@ -115,9 +130,6 @@ void cleanup(void) {
     if (stdin_io != NULL) {
         ev_io_stop(main_loop, stdin_io);
         FREE(stdin_io);
-        FREE(statusline_buffer);
-        /* statusline pointed to memory within statusline_buffer */
-        statusline = NULL;
     }
 
     if (child_sig != NULL) {
@@ -130,20 +142,12 @@ void cleanup(void) {
 
 /*
  * The start of a new array is the start of a new status line, so we clear all
- * previous entries.
- *
+ * previous entries from the buffer.
  */
 static int stdin_start_array(void *context) {
-    struct status_block *first;
-    while (!TAILQ_EMPTY(&statusline_head)) {
-        first = TAILQ_FIRST(&statusline_head);
-        I3STRING_FREE(first->full_text);
-        FREE(first->color);
-        FREE(first->name);
-        FREE(first->instance);
-        TAILQ_REMOVE(&statusline_head, first, blocks);
-        free(first);
-    }
+    // the blocks are still used by statusline_head, so we won't free the
+    // resources here.
+    clear_statusline(&statusline_buffer, false);
     return 1;
 }
 
@@ -182,7 +186,7 @@ static int stdin_boolean(void *context, int val) {
 static int stdin_string(void *context, const unsigned char *val, size_t len) {
     parser_ctx *ctx = context;
     if (strcasecmp(ctx->last_map_key, "full_text") == 0) {
-        ctx->block.full_text = i3string_from_utf8_with_length((const char *)val, len);
+        ctx->block.full_text = i3string_from_markup_with_length((const char *)val, len);
     }
     if (strcasecmp(ctx->last_map_key, "color") == 0) {
         sasprintf(&(ctx->block.color), "%.*s", len, val);
@@ -196,7 +200,7 @@ static int stdin_string(void *context, const unsigned char *val, size_t len) {
             ctx->block.align = ALIGN_LEFT;
         }
     } else if (strcasecmp(ctx->last_map_key, "min_width") == 0) {
-        i3String *text = i3string_from_utf8_with_length((const char *)val, len);
+        i3String *text = i3string_from_markup_with_length((const char *)val, len);
         ctx->block.min_width = (uint32_t)predict_text_width(text);
         i3string_free(text);
     }
@@ -226,6 +230,10 @@ static int stdin_integer(void *context, long long val) {
     return 1;
 }
 
+/*
+ * When a map is finished, we have an entire status block.
+ * Move it from the parser's context to the statusline buffer.
+ */
 static int stdin_end_map(void *context) {
     parser_ctx *ctx = context;
     struct status_block *new_block = smalloc(sizeof(struct status_block));
@@ -236,11 +244,19 @@ static int stdin_end_map(void *context) {
         new_block->full_text = i3string_from_utf8("SPEC VIOLATION: full_text is NULL!");
     if (new_block->urgent)
         ctx->has_urgent = true;
-    TAILQ_INSERT_TAIL(&statusline_head, new_block, blocks);
+    TAILQ_INSERT_TAIL(&statusline_buffer, new_block, blocks);
     return 1;
 }
 
+/*
+ * When an array is finished, we have an entire statusline.
+ * Copy it from the buffer to the actual statusline.
+ */
 static int stdin_end_array(void *context) {
+    DLOG("copying statusline_buffer to statusline_head\n");
+    clear_statusline(&statusline_head, true);
+    copy_statusline(&statusline_buffer, &statusline_head);
+
     DLOG("dumping statusline:\n");
     struct status_block *current;
     TAILQ_FOREACH(current, &statusline_head, blocks) {
@@ -304,7 +320,7 @@ static void read_flat_input(char *buffer, int length) {
         buffer[length - 1] = '\0';
     else
         buffer[length] = '\0';
-    first->full_text = i3string_from_utf8(buffer);
+    first->full_text = i3string_from_markup(buffer);
 }
 
 static bool read_json_input(unsigned char *input, int length) {
index 371aeec9be4e4457d372d6464f408843b3280ef6..ee3d81b974e23923ec2dcacfa2dce47b28708887 100644 (file)
@@ -171,8 +171,6 @@ int main(int argc, char **argv) {
 
     kill_child();
 
-    FREE(statusline_buffer);
-
     clean_xcb();
     ev_default_destroy();
 
index e8184d400c4fc560987bb0d143f465fb0cc77761..45b511ffbb66fb69ce63a0861e5cf445826e5322 100644 (file)
@@ -123,12 +123,12 @@ static int workspaces_string_cb(void *params_, const unsigned char *val, size_t
 
             /* Offset may be equal to length, in which case display the number */
             params->workspaces_walk->name = (offset < len
-                                                 ? i3string_from_utf8_with_length(ws_name + offset, len - offset)
-                                                 : i3string_from_utf8(ws_num));
+                                                 ? i3string_from_markup_with_length(ws_name + offset, len - offset)
+                                                 : i3string_from_markup(ws_num));
 
         } else {
             /* Default case: just save the name */
-            params->workspaces_walk->name = i3string_from_utf8_with_length(ws_name, len);
+            params->workspaces_walk->name = i3string_from_markup_with_length(ws_name, len);
         }
 
         /* Save its rendered width */
index 3a1b8cb2277807a766e8f094a5194a3ef77dd1a0..8bda53c45ea656c289acb0b61696787ee9c39c60 100644 (file)
@@ -192,12 +192,12 @@ void refresh_statusline(void) {
 
             /* Draw the background */
             uint32_t bg_color = colors.urgent_ws_bg;
-            uint32_t bg_values[] = { bg_color, bg_color };
+            uint32_t bg_values[] = {bg_color, bg_color};
             xcb_change_gc(xcb_connection, statusline_ctx, mask, bg_values);
 
             /* The urgent background “overshoots” by 2 px so that the text that
              * is printed onto it will not be look so cut off. */
-            xcb_rectangle_t bg_rect = { x - logical_px(2), logical_px(1), block->width + logical_px(4), bar_height - logical_px(2) };
+            xcb_rectangle_t bg_rect = {x - logical_px(2), logical_px(1), block->width + logical_px(4), bar_height - logical_px(2)};
             xcb_poly_fill_rectangle(xcb_connection, statusline_pm, statusline_ctx, 1, &bg_rect);
         } else {
             fg_color = (block->color ? get_colorpixel(block->color) : colors.bar_fg);
@@ -215,8 +215,8 @@ void refresh_statusline(void) {
             xcb_change_gc(xcb_connection, statusline_ctx, mask, values);
             xcb_poly_line(xcb_connection, XCB_COORD_MODE_ORIGIN, statusline_pm,
                           statusline_ctx, 2,
-                          (xcb_point_t[]) { { x - sep_offset, logical_px(4) },
-                                            { x - sep_offset, bar_height - logical_px(4) } });
+                          (xcb_point_t[]){{x - sep_offset, logical_px(4)},
+                                          {x - sep_offset, bar_height - logical_px(4)}});
         }
     }
 }
@@ -367,13 +367,12 @@ void handle_button(xcb_button_press_event_t *event) {
             struct status_block *block;
             int sep_offset_remainder = 0;
 
-            TAILQ_FOREACH (block, &statusline_head, blocks) {
+            TAILQ_FOREACH(block, &statusline_head, blocks) {
                 if (i3string_get_num_bytes(block->full_text) == 0)
                     continue;
 
                 last_block_x = block_x;
-                block_x += block->width + block->x_offset + block->x_append
-                           + get_sep_offset(block) + sep_offset_remainder;
+                block_x += block->width + block->x_offset + block->x_append + get_sep_offset(block) + sep_offset_remainder;
 
                 if (x <= block_x && x >= last_block_x) {
                     send_block_clicked(event->detail, block->name, block->instance, event->root_x, event->root_y);
@@ -387,7 +386,7 @@ void handle_button(xcb_button_press_event_t *event) {
     }
 
     /* TODO: Move this to extern get_ws_for_output() */
-    TAILQ_FOREACH (cur_ws, walk->workspaces, tailq) {
+    TAILQ_FOREACH(cur_ws, walk->workspaces, tailq) {
         if (cur_ws->visible) {
             break;
         }
@@ -506,7 +505,7 @@ static void handle_visibility_notify(xcb_visibility_notify_event_t *event) {
     int num_visible = 0;
     i3_output *output;
 
-    SLIST_FOREACH (output, outputs, slist) {
+    SLIST_FOREACH(output, outputs, slist) {
         if (!output->active) {
             continue;
         }
index 1f28c01405209022c8567c6d9370fe0a1d7426e7..59dab6eddd1c1eeeff16b3b5b26d5992b137ad85 100644 (file)
@@ -39,4 +39,3 @@ xmacro(I3_PID)
 xmacro(_NET_REQUEST_FRAME_EXTENTS)
 xmacro(_NET_FRAME_EXTENTS)
 xmacro(_MOTIF_WM_HINTS)
-xmacro(WM_CHANGE_STATE)
index dea26d96344548a5573ebdb6de2813b4a1ccc32e..afafb64be0cb8da35017684d0ec354e7cd03f50c 100644 (file)
@@ -105,7 +105,7 @@ struct Config {
 
     /** By default, focus follows mouse. If the user explicitly wants to
      * turn this off (and instead rely only on the keyboard for changing
-     * focus), we allow him to do this with this relatively special option.
+     * focus), we allow them to do this with this relatively special option.
      * It is not planned to add any different focus models. */
     bool disable_focus_follows_mouse;
 
index 8f2c197df3e11e4a9234323a5fd8b3fd6049b289..eba0f968088363202eb519130e05f4bee0ad30e3 100644 (file)
@@ -450,7 +450,7 @@ struct Match {
 /**
  * An Assignment makes specific windows go to a specific workspace/output or
  * run a command for that window. With this mechanism, the user can -- for
- * example -- assign his browser to workspace "www". Checking if a window is
+ * example -- assign their browser to workspace "www". Checking if a window is
  * assigned works by comparing the Match data structure with the window (see
  * match_matches_window()).
  *
index 9712e8b9eda608542ff331ca39bd148726568f89..86cc6836f1300402ad29a26c3cddcc62968c4ff2 100644 (file)
@@ -19,7 +19,7 @@ void handle_key_press(xcb_key_press_event_t *event);
 /**
  * Kills the commanderror i3-nagbar process, if any.
  *
- * Called when reloading/restarting, since the user probably fixed his wrong
+ * Called when reloading/restarting, since the user probably fixed their wrong
  * keybindings.
  *
  * If wait_for_it is set (restarting), this function will waitpid(), otherwise,
index 7a2bdf581c6bae07a32715b11977a283a7d1f8ae..c1a11dfc33ec7cef39b00310cbde3e07b99ff9f7 100644 (file)
@@ -141,6 +141,12 @@ int sasprintf(char **strp, const char *fmt, ...);
  */
 i3String *i3string_from_utf8(const char *from_utf8);
 
+/**
+ * Build an i3String from an UTF-8 encoded string in Pango markup.
+ *
+ */
+i3String *i3string_from_markup(const char *from_markup);
+
 /**
  * Build an i3String from an UTF-8 encoded string with fixed length.
  * To be used when no proper NUL-terminaison is available.
@@ -149,6 +155,13 @@ i3String *i3string_from_utf8(const char *from_utf8);
  */
 i3String *i3string_from_utf8_with_length(const char *from_utf8, size_t num_bytes);
 
+/**
+ * Build an i3String from an UTF-8 encoded string in Pango markup with fixed
+ * length.
+ *
+ */
+i3String *i3string_from_markup_with_length(const char *from_markup, size_t num_bytes);
+
 /**
  * Build an i3String from an UCS-2 encoded string.
  * Returns the newly-allocated i3String.
@@ -193,6 +206,11 @@ const xcb_char2b_t *i3string_as_ucs2(i3String *str);
  */
 size_t i3string_get_num_bytes(i3String *str);
 
+/**
+ * Whether the given i3String is in Pango markup.
+ */
+bool i3string_is_markup(i3String *str);
+
 /**
  * Returns the number of glyphs in an i3String.
  *
index a338f9752cc29714c5c357e63323de786aa62f3f..cb92d52fbd29bc8281cb9beabcc269f2c5fca93b 100644 (file)
@@ -102,7 +102,8 @@ static bool load_pango_font(i3Font *font, const char *desc) {
  *
  */
 static void draw_text_pango(const char *text, size_t text_len,
-                            xcb_drawable_t drawable, int x, int y, int max_width) {
+                            xcb_drawable_t drawable, int x, int y,
+                            int max_width, bool is_markup) {
     /* Create the Pango layout */
     /* root_visual_type is cached in load_pango_font */
     cairo_surface_t *surface = cairo_xcb_surface_create(conn, drawable,
@@ -116,13 +117,16 @@ static void draw_text_pango(const char *text, size_t text_len,
     pango_layout_set_wrap(layout, PANGO_WRAP_CHAR);
     pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
 
-    pango_layout_set_text(layout, text, text_len);
+    if (is_markup)
+        pango_layout_set_markup(layout, text, text_len);
+    else
+        pango_layout_set_text(layout, text, text_len);
 
     /* Do the drawing */
     cairo_set_source_rgb(cr, pango_font_red, pango_font_green, pango_font_blue);
     pango_cairo_update_layout(cr, layout);
     pango_layout_get_pixel_size(layout, NULL, &height);
-    cairo_move_to(cr, x, y - (height - savedFont->height));
+    cairo_move_to(cr, x, y - 0.5 * (height - savedFont->height));
     pango_cairo_show_layout(cr, layout);
 
     /* Free resources */
@@ -135,7 +139,7 @@ static void draw_text_pango(const char *text, size_t text_len,
  * Calculate the text width using Pango rendering.
  *
  */
-static int predict_text_width_pango(const char *text, size_t text_len) {
+static int predict_text_width_pango(const char *text, size_t text_len, bool is_markup) {
     /* Create a dummy Pango layout */
     /* root_visual_type is cached in load_pango_font */
     cairo_surface_t *surface = cairo_xcb_surface_create(conn, root_screen->root, root_visual_type, 1, 1);
@@ -145,7 +149,12 @@ static int predict_text_width_pango(const char *text, size_t text_len) {
     /* Get the font width */
     gint width;
     pango_layout_set_font_description(layout, savedFont->specific.pango_desc);
-    pango_layout_set_text(layout, text, text_len);
+
+    if (is_markup)
+        pango_layout_set_markup(layout, text, text_len);
+    else
+        pango_layout_set_text(layout, text, text_len);
+
     pango_cairo_update_layout(cr, layout);
     pango_layout_get_pixel_size(layout, &width, NULL);
 
@@ -383,7 +392,7 @@ void draw_text(i3String *text, xcb_drawable_t drawable,
         case FONT_TYPE_PANGO:
             /* Render the text using Pango */
             draw_text_pango(i3string_as_utf8(text), i3string_get_num_bytes(text),
-                            drawable, x, y, max_width);
+                            drawable, x, y, max_width, i3string_is_markup(text));
             return;
 #endif
         default:
@@ -422,7 +431,7 @@ void draw_text_ascii(const char *text, xcb_drawable_t drawable,
         case FONT_TYPE_PANGO:
             /* Render the text using Pango */
             draw_text_pango(text, strlen(text),
-                            drawable, x, y, max_width);
+                            drawable, x, y, max_width, false);
             return;
 #endif
         default:
@@ -446,7 +455,7 @@ static int xcb_query_text_width(const xcb_char2b_t *text, size_t text_len) {
                                                                          cookie, &error);
     if (reply == NULL) {
         /* We return a safe estimate because a rendering error is better than
-         * a crash. Plus, the user will see the error in his log. */
+         * a crash. Plus, the user will see the error in their log. */
         fprintf(stderr, "Could not get text extents (X error code %d)\n",
                 error->error_code);
         return savedFont->specific.xcb.info->max_bounds.character_width * text_len;
@@ -518,7 +527,8 @@ int predict_text_width(i3String *text) {
 #if PANGO_SUPPORT
         case FONT_TYPE_PANGO:
             /* Calculate extents using Pango */
-            return predict_text_width_pango(i3string_as_utf8(text), i3string_get_num_bytes(text));
+            return predict_text_width_pango(i3string_as_utf8(text), i3string_get_num_bytes(text),
+                                            i3string_is_markup(text));
 #endif
         default:
             assert(false);
index 009312d6946ea69f865605850b61f684fbe6e7d0..afeca9741c3fd4479278ce44dbad59180955d7a1 100644 (file)
@@ -20,6 +20,7 @@ struct _i3String {
     xcb_char2b_t *ucs2;
     size_t num_glyphs;
     size_t num_bytes;
+    bool is_markup;
 };
 
 /*
@@ -39,6 +40,19 @@ i3String *i3string_from_utf8(const char *from_utf8) {
     return str;
 }
 
+/*
+ * Build an i3String from an UTF-8 encoded string in Pango markup.
+ *
+ */
+i3String *i3string_from_markup(const char *from_markup) {
+    i3String *str = i3string_from_utf8(from_markup);
+
+    /* Set the markup flag */
+    str->is_markup = true;
+
+    return str;
+}
+
 /*
  * Build an i3String from an UTF-8 encoded string with fixed length.
  * To be used when no proper NUL-terminaison is available.
@@ -59,6 +73,20 @@ i3String *i3string_from_utf8_with_length(const char *from_utf8, size_t num_bytes
     return str;
 }
 
+/*
+ * Build an i3String from an UTF-8 encoded string in Pango markup with fixed
+ * length.
+ *
+ */
+i3String *i3string_from_markup_with_length(const char *from_markup, size_t num_bytes) {
+    i3String *str = i3string_from_utf8_with_length(from_markup, num_bytes);
+
+    /* set the markup flag */
+    str->is_markup = true;
+
+    return str;
+}
+
 /*
  * Build an i3String from an UCS-2 encoded string.
  * Returns the newly-allocated i3String.
@@ -133,6 +161,13 @@ size_t i3string_get_num_bytes(i3String *str) {
     return str->num_bytes;
 }
 
+/*
+ * Whether the given i3String is in Pango markup.
+ */
+bool i3string_is_markup(i3String *str) {
+    return str->is_markup;
+}
+
 /*
  * Returns the number of glyphs in an i3String.
  *
index 84b6d52c4c1fceff2630e94985dd0d11cc015304..d441e78f8449be4a42379bdd713c5609c0a72f2e 100644 (file)
@@ -7,7 +7,7 @@ template::[header-declarations]
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>
 <refmiscinfo class="source">i3</refmiscinfo>
-<refmiscinfo class="version">4.8</refmiscinfo>
+<refmiscinfo class="version">4.9.1</refmiscinfo>
 <refmiscinfo class="manual">i3 Manual</refmiscinfo>
 </refmeta>
 <refnamediv>
index 2a0448813ecb48ecb97624cc4717b5df8f7ab540..19b0f3a59267378ec30c54e146d19da93a3f8c07 100644 (file)
@@ -30,7 +30,7 @@ It tries to start one of the following (in that order):
 * gedit
 * mc-edit
 
-Please don’t complain about the order: If the user has any preference, he will
+Please don’t complain about the order: If the user has any preference, they will
 have $VISUAL or $EDITOR set.
 
 == SEE ALSO
index 6b04c4316fda10d0f8fe7a1876ad356df1db5984..22754c0bd96686e74e5cb372384b9381db9b8ef4 100644 (file)
@@ -23,7 +23,7 @@ It tries to start one of the following (in that order):
 * w3m
 * i3-sensible-editor(1)
 
-Please don’t complain about the order: If the user has any preference, he will
+Please don’t complain about the order: If the user has any preference, they will
 have $PAGER set.
 
 == SEE ALSO
index d1ad5198edaa8bd9fa30f63f3056d5f93a34149e..6fa91ac893900c61d077fba66a60a453fed3a5b6 100644 (file)
@@ -33,8 +33,8 @@ It tries to start one of the following (in that order):
 * roxterm
 * xfce4-terminal
 
-Please don’t complain about the order: If the user has any preference, she will
-have $TERMINAL set or modified her i3 configuration file.
+Please don’t complain about the order: If the user has any preference, they will
+have $TERMINAL set or modified their i3 configuration file.
 
 == SEE ALSO
 
diff --git a/release.sh b/release.sh
new file mode 100755 (executable)
index 0000000..db5ca09
--- /dev/null
@@ -0,0 +1,193 @@
+#!/bin/zsh
+# This script is used to prepare a new release of i3.
+
+export RELEASE_VERSION="4.9.1"
+export PREVIOUS_VERSION="4.9"
+export RELEASE_BRANCH="master"
+
+if [ ! -e "../i3.github.io" ]
+then
+       echo "../i3.github.io does not exist."
+       echo "Use git clone git://github.com/i3/i3.github.io"
+       exit 1
+fi
+
+if [ ! -e "RELEASE-NOTES-${RELEASE_VERSION}" ]
+then
+       echo "RELEASE-NOTES-${RELEASE_VERSION} not found."
+       exit 1
+fi
+
+if git diff-files --quiet --exit-code debian/changelog
+then
+       echo "Expected debian/changelog to be changed (containing the changelog for ${RELEASE_VERSION})."
+       exit 1
+fi
+
+eval $(gpg-agent --daemon)
+export GPG_AGENT_INFO
+
+################################################################################
+# Section 1: update git and build the release tarball
+################################################################################
+
+STARTDIR=$PWD
+
+TMPDIR=$(mktemp -d)
+cd $TMPDIR
+if ! wget http://i3wm.org/downloads/i3-${PREVIOUS_VERSION}.tar.bz2; then
+       echo "Could not download i3-${PREVIOUS_VERSION}.tar.bz2 (required for comparing files)."
+       exit 1
+fi
+git clone --quiet --branch "${RELEASE_BRANCH}" file://${STARTDIR}
+cd i3
+if [ ! -e "${STARTDIR}/RELEASE-NOTES-${RELEASE_VERSION}" ]; then
+       echo "Required file RELEASE-NOTES-${RELEASE_VERSION} not found."
+       exit 1
+fi
+git checkout -b release-${RELEASE_VERSION}
+cp "${STARTDIR}/RELEASE-NOTES-${RELEASE_VERSION}" "RELEASE-NOTES-${RELEASE_VERSION}"
+git add RELEASE-NOTES-${RELEASE_VERSION}
+git rm RELEASE-NOTES-${PREVIOUS_VERSION}
+sed -i "s,<refmiscinfo class=\"version\">[^<]*</refmiscinfo>,<refmiscinfo class=\"version\">${RELEASE_VERSION}</refmiscinfo>,g" man/asciidoc.conf
+git commit -a -m "release i3 ${RELEASE_VERSION}"
+git tag "${RELEASE_VERSION}" -m "release i3 ${RELEASE_VERSION}" --sign --local-user=0x4AC8EE1D
+
+make dist
+
+echo "Differences in the release tarball file lists:"
+
+diff -u \
+       <(tar tf ../i3-${PREVIOUS_VERSION}.tar.bz2 | sed "s,i3-${PREVIOUS_VERSION}/,,g" | sort) \
+       <(tar tf    i3-${RELEASE_VERSION}.tar.bz2  | sed "s,i3-${RELEASE_VERSION}/,,g"  | sort) \
+       | colordiff
+
+if ! tar xf i3-${RELEASE_VERSION}.tar.bz2 --to-stdout --strip-components=1 i3-${RELEASE_VERSION}/I3_VERSION | grep -q "^${RELEASE_VERSION} "
+then
+       echo "I3_VERSION file does not start with ${RELEASE_VERSION}"
+       exit 1
+fi
+
+gpg --armor -b i3-${RELEASE_VERSION}.tar.bz2
+
+if [ "${RELEASE_BRANCH}" = "master" ]; then
+       git checkout master
+       git merge --no-ff release-${RELEASE_VERSION} -m "Merge branch 'release-${RELEASE_VERSION}'"
+       git checkout next
+       git merge --no-ff master -m "Merge branch 'master' into next"
+else
+       git checkout next
+       git merge --no-ff release-${RELEASE_VERSION} -m "Merge branch 'release-${RELEASE_VERSION}'"
+       git checkout master
+       git merge --no-ff next -m "Merge branch 'next' into master"
+fi
+
+################################################################################
+# Section 2: Debian packaging
+################################################################################
+
+cd "${TMPDIR}"
+mkdir debian
+
+# Copy over the changelog because we expect it to be locally modified in the
+# start directory.
+cp "${STARTDIR}/debian/changelog" i3/debian/changelog
+
+cat > ${TMPDIR}/Dockerfile <<EOT
+FROM debian:sid
+RUN sed -i 's,^deb \(.*\),deb \1\ndeb-src \1,g' /etc/apt/sources.list
+RUN apt-get update && apt-get install -y dpkg-dev devscripts
+COPY i3/i3-${RELEASE_VERSION}.tar.bz2 /usr/src/i3-wm_${RELEASE_VERSION}.orig.tar.bz2
+WORKDIR /usr/src/
+RUN tar xf i3-wm_${RELEASE_VERSION}.orig.tar.bz2
+WORKDIR /usr/src/i3-${RELEASE_VERSION}
+COPY i3/debian /usr/src/i3-${RELEASE_VERSION}/debian/
+RUN mkdir debian/source
+RUN echo '3.0 (quilt)' > debian/source/format
+WORKDIR /usr/src
+RUN mk-build-deps --install --remove --tool 'apt-get --no-install-recommends -y' i3-${RELEASE_VERSION}/debian/control
+WORKDIR /usr/src/i3-${RELEASE_VERSION}
+RUN dpkg-buildpackage -sa -j8
+EOT
+
+CONTAINER_NAME=$(echo "i3-${TMPDIR}" | sed 's,/,,g')
+docker build -t i3 .
+for file in $(docker run --name "${CONTAINER_NAME}" i3 /bin/sh -c "ls /usr/src/i3*_${RELEASE_VERSION}*")
+do
+       docker cp "${CONTAINER_NAME}:${file}" ${TMPDIR}/debian/
+done
+
+echo "Content of resulting package’s .changes file:"
+cat ${TMPDIR}/debian/*.changes
+
+# debsign is in devscripts, which is available in fedora and debian
+debsign -k4AC8EE1D ${TMPDIR}/debian/*.changes
+
+# TODO: docker cleanup
+
+################################################################################
+# Section 3: website
+################################################################################
+
+cd ${TMPDIR}
+git clone --quiet ${STARTDIR}/../i3.github.io
+cd i3.github.io
+cp ${TMPDIR}/i3/i3-${RELEASE_VERSION}.tar.bz2* downloads/
+git add downloads/i3-${RELEASE_VERSION}.tar.bz2*
+cp ${TMPDIR}/i3/RELEASE-NOTES-${RELEASE_VERSION} downloads/RELEASE-NOTES-${RELEASE_VERSION}.txt
+git add downloads/RELEASE-NOTES-${RELEASE_VERSION}.txt
+sed -i "s,<h2>Documentation for i3 v[^<]*</h2>,<h2>Documentation for i3 v${RELEASE_VERSION}</h2>,g" docs/index.html
+sed -i "s,<span style=\"margin-left: 2em; color: #c0c0c0\">[^<]*</span>,<span style=\"margin-left: 2em; color: #c0c0c0\">${RELEASE_VERSION}</span>,g" index.html
+sed -i "s,The current stable version is .*$,The current stable version is ${RELEASE_VERSION}.,g" downloads/index.html
+sed -i "s,<tbody>,<tbody>\n  <tr>\n    <td>${RELEASE_VERSION}</td>\n    <td><a href=\"/downloads/i3-${RELEASE_VERSION}.tar.bz2\">i3-${RELEASE_VERSION}.tar.bz2</a></td>\n    <td>$(ls -lh ../i3/i3-${RELEASE_VERSION}.tar.bz2 | awk -F " " {'print $5'} | sed 's/K$/ KiB/g')</td>\n    <td><a href=\"/downloads/i3-${RELEASE_VERSION}.tar.bz2.asc\">signature</a></td>\n    <td>$(date +'%Y-%m-%d')</td>\n    <td><a href=\"/downloads/RELEASE-NOTES-${RELEASE_VERSION}.txt\">release notes</a></td>\n  </tr>\n,g" downloads/index.html
+
+git commit -a -m "add ${RELEASE_VERSION} release"
+
+mkdir docs/${PREVIOUS_VERSION}
+tar cf - '--exclude=[0-9]\.[0-9e]*' docs | tar xf - --strip-components=1 -C docs/${PREVIOUS_VERSION}
+git add docs/${PREVIOUS_VERSION}
+git commit -a -m "save docs for ${PREVIOUS_VERSION}"
+
+for i in $(find _docs -maxdepth 1 -and -type f -and \! -regex ".*\.\(html\|man\)$" -and \! -name "Makefile")
+do
+       base="$(basename $i)"
+       [ -e "${STARTDIR}/docs/${base}" ] && cp "${STARTDIR}/docs/${base}" "_docs/${base}"
+done
+
+(cd _docs && make)
+
+for i in $(find _docs -maxdepth 1 -and -type f -and \! -regex ".*\.\(html\|man\)$" -and \! -name "Makefile")
+do
+       base="$(basename $i)"
+       [ -e "${STARTDIR}/docs/${base}" ] && cp "_docs/${base}.html" docs/
+done
+
+git commit -a -m "update docs for ${RELEASE_VERSION}"
+
+################################################################################
+# Section 4: final push instructions
+################################################################################
+
+echo "As a final sanity check, install the debian package and see whether i3 works."
+
+echo "When satisfied, run:"
+echo "  cd ${TMPDIR}/i3"
+echo "  git checkout next"
+echo "  vi debian/changelog"
+# TODO: can we just set up the remote spec properly?
+echo "  git push git@github.com:i3/i3 next"
+echo "  git push git@github.com:i3/i3 master"
+echo "  git push git@github.com:i3/i3 --tags"
+echo ""
+echo "  cd ${TMPDIR}/i3.github.io"
+# TODO: can we just set up the remote spec properly?
+echo "  git push git@github.com:i3/i3.github.io master"
+echo ""
+echo "  cd ${TMPDIR}/debian"
+echo "  dput *.changes"
+echo ""
+echo "Announce on:"
+echo "  twitter"
+echo "  google+"
+echo "  mailing list"
+echo "  #i3 topic"
index 8f9767e69943e26a6df3b9cb091cfd38e5f47bf6..cbac2dfd96dfd0f3826dcb669ab9b5400fb720f1 100644 (file)
@@ -159,9 +159,10 @@ static Binding *get_binding(uint16_t modifiers, bool is_release, uint16_t input_
          * need to look in the array of translated keycodes for the event’s
          * keycode */
         if (input_type == B_KEYBOARD && bind->symbol != NULL) {
+            xcb_keycode_t input_keycode = (xcb_keycode_t)input_code;
             if (memmem(bind->translated_to,
                        bind->number_keycodes * sizeof(xcb_keycode_t),
-                       &input_code, sizeof(xcb_keycode_t)) == NULL)
+                       &input_keycode, sizeof(xcb_keycode_t)) == NULL)
                 continue;
         } else {
             /* This case is easier: The user specified a keycode */
@@ -210,7 +211,7 @@ Binding *get_binding_from_xcb_event(xcb_generic_event_t *event) {
     state_filtered &= 0xFF;
     DLOG("(removed upper 8 bits, state = %d)\n", state_filtered);
 
-    if (xkb_current_group == XkbGroup2Index)
+    if (xkb_current_group == XCB_XKB_GROUP_2)
         state_filtered |= BIND_MODE_SWITCH;
 
     DLOG("(checked mode_switch, state %d)\n", state_filtered);
@@ -293,8 +294,8 @@ void translate_keysyms(void) {
             bind->translated_to[bind->number_keycodes - 1] = i;
         }
 
-        DLOG("Translated symbol \"%s\" to %d keycode\n", bind->symbol,
-             bind->number_keycodes);
+        DLOG("Translated symbol \"%s\" to %d keycode (mods %d)\n", bind->symbol,
+             bind->number_keycodes, bind->mods);
     }
 }
 
index 51ffcf3ab3c4361452897713bf399bdf70c87302..55e7147c557237c6cef5d7a1ff10978c86bc154b 100644 (file)
@@ -380,11 +380,6 @@ int handle_button_press(xcb_button_press_event_t *event) {
         return 0;
     }
 
-    if (event->child != XCB_NONE) {
-        DLOG("event->child not XCB_NONE, so this is an event which originated from a click into the application, but the application did not handle it.\n");
-        return route_click(con, event, mod_pressed, CLICK_INSIDE);
-    }
-
     /* Check if the click was on the decoration of a child */
     Con *child;
     TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
@@ -394,5 +389,10 @@ int handle_button_press(xcb_button_press_event_t *event) {
         return route_click(child, event, mod_pressed, CLICK_DECORATION);
     }
 
+    if (event->child != XCB_NONE) {
+        DLOG("event->child not XCB_NONE, so this is an event which originated from a click into the application, but the application did not handle it.\n");
+        return route_click(con, event, mod_pressed, CLICK_INSIDE);
+    }
+
     return route_click(con, event, mod_pressed, CLICK_BORDER);
 }
index 49005ba7d5421c98f80041cbb1fdf1088bdcd63a..b3d36f24059ebf435d05b8ad55e67ece1c6e07bb 100644 (file)
             y(map_close);                   \
         }                                   \
     } while (0)
-#define yerror(message)                     \
-    do {                                    \
-        if (cmd_output->json_gen != NULL) { \
-            y(map_open);                    \
-            ystr("success");                \
-            y(bool, false);                 \
-            ystr("error");                  \
-            ystr(message);                  \
-            y(map_close);                   \
-        }                                   \
+#define yerror(format, ...)                             \
+    do {                                                \
+        if (cmd_output->json_gen != NULL) {             \
+            char *message;                              \
+            sasprintf(&message, format, ##__VA_ARGS__); \
+            y(map_open);                                \
+            ystr("success");                            \
+            y(bool, false);                             \
+            ystr("error");                              \
+            ystr(message);                              \
+            y(map_close);                               \
+            free(message);                              \
+        }                                               \
     } while (0)
 
 /** When the command did not include match criteria (!), we use the currently
@@ -552,8 +555,7 @@ void cmd_move_con_to_workspace_number(I3_CMD, char *which) {
 
     if (parsed_num == -1) {
         LOG("Could not parse initial part of \"%s\" as a number.\n", which);
-        // TODO: better error message
-        yerror("Could not parse number");
+        yerror("Could not parse number \"%s\"", which);
         return;
     }
 
@@ -878,11 +880,15 @@ void cmd_nop(I3_CMD, char *comment) {
 void cmd_append_layout(I3_CMD, char *path) {
     LOG("Appending layout \"%s\"\n", path);
 
+    /* Make sure we allow paths like '~/.i3/layout.json' */
+    path = resolve_tilde(path);
+
     json_content_t content = json_determine_content(path);
     LOG("JSON content = %d\n", content);
     if (content == JSON_CONTENT_UNKNOWN) {
         ELOG("Could not determine the contents of \"%s\", not loading.\n", path);
-        ysuccess(false);
+        yerror("Could not determine the contents of \"%s\".", path);
+        free(path);
         return;
     }
 
@@ -924,6 +930,7 @@ void cmd_append_layout(I3_CMD, char *path) {
     if (content == JSON_CONTENT_WORKSPACE)
         ipc_send_workspace_event("restored", parent, NULL);
 
+    free(path);
     cmd_output->needs_tree_render = true;
 }
 
@@ -980,8 +987,7 @@ void cmd_workspace_number(I3_CMD, char *which) {
 
     if (parsed_num == -1) {
         LOG("Could not parse initial part of \"%s\" as a number.\n", which);
-        // TODO: better error message
-        yerror("Could not parse number");
+        yerror("Could not parse number \"%s\"", which);
         return;
     }
 
@@ -1891,10 +1897,7 @@ void cmd_rename_workspace(I3_CMD, char *old_name, char *new_name) {
     }
 
     if (!workspace) {
-        // TODO: we should include the old workspace name here and use yajl for
-        // generating the reply.
-        // TODO: better error message
-        yerror("Old workspace not found");
+        yerror("Old workspace \"%s\" not found", old_name);
         return;
     }
 
@@ -1904,10 +1907,7 @@ void cmd_rename_workspace(I3_CMD, char *old_name, char *new_name) {
                !strcasecmp(child->name, new_name));
 
     if (check_dest != NULL) {
-        // TODO: we should include the new workspace name here and use yajl for
-        // generating the reply.
-        // TODO: better error message
-        yerror("New workspace already exists");
+        yerror("New workspace \"%s\" already exists", new_name);
         return;
     }
 
index 4957c303b5bcced0c2e461e652c1c6052c9091f7..b610b0c60c1c9cfb792d107a7ff6d05acdc27487 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -1149,12 +1149,12 @@ Rect con_border_style_rect(Con *con) {
     /* Shortcut to avoid calling con_adjacent_borders() on dock containers. */
     int border_style = con_border_style(con);
     if (border_style == BS_NONE)
-        return (Rect) {0, 0, 0, 0};
+        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)};
+        result = (Rect){border_width, 0, -(2 * border_width), -(border_width)};
     } else {
-        result = (Rect) {border_width, border_width, -(2 * border_width), -(2 * border_width)};
+        result = (Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
     }
 
     /* Floating windows are never adjacent to any other window, so
@@ -1473,7 +1473,7 @@ Rect con_minimum_size(Con *con) {
 
     if (con_is_leaf(con)) {
         DLOG("leaf node, returning 75x50\n");
-        return (Rect) {0, 0, 75, 50};
+        return (Rect){0, 0, 75, 50};
     }
 
     if (con->type == CT_FLOATING_CON) {
@@ -1493,7 +1493,7 @@ Rect con_minimum_size(Con *con) {
         }
         DLOG("stacked/tabbed now, returning %d x %d + deco_rect = %d\n",
              max_width, max_height, deco_height);
-        return (Rect) {0, 0, max_width, max_height + deco_height};
+        return (Rect){0, 0, max_width, max_height + deco_height};
     }
 
     /* For horizontal/vertical split containers we sum up the width (h-split)
@@ -1513,7 +1513,7 @@ Rect con_minimum_size(Con *con) {
             }
         }
         DLOG("split container, returning width = %d x height = %d\n", width, height);
-        return (Rect) {0, 0, width, height};
+        return (Rect){0, 0, width, height};
     }
 
     ELOG("Unhandled case, type = %d, layout = %d, split = %d\n",
index 24cebcece9707755087d83928a49030629ecea63..b229b445ba24ae71358cfcc891e4fafa06d40490 100644 (file)
@@ -823,11 +823,11 @@ static char *migrate_config(char *input, off_t size) {
         fprintf(stderr, "Migration process exit code was != 0\n");
         if (returncode == 2) {
             fprintf(stderr, "could not start the migration script\n");
-            /* TODO: script was not found. tell the user to fix his system or create a v4 config */
+            /* TODO: script was not found. tell the user to fix their system or create a v4 config */
         } else if (returncode == 1) {
             fprintf(stderr, "This already was a v4 config. Please add the following line to your config file:\n");
             fprintf(stderr, "# i3 config file (v4)\n");
-            /* TODO: nag the user with a message to include a hint for i3 in his config file */
+            /* TODO: nag the user with a message to include a hint for i3 in their config file */
         }
         return NULL;
     }
index 8a2fde2c745c96e7d479dca5dafa35e6244309f6..e6ca2d7188d6392c172aa09bf17d6eb0588f6544 100644 (file)
@@ -511,7 +511,7 @@ DRAGGING_CB(resize_window_callback) {
         dest_height = max(dest_height, (int)(dest_width / ratio));
     }
 
-    con->rect = (Rect) {dest_x, dest_y, dest_width, dest_height};
+    con->rect = (Rect){dest_x, dest_y, dest_width, dest_height};
 
     /* Obey window size */
     floating_check_size(con);
index 3569710b23cd61e704f3ae7027d36c414de87fd7..0cd397fd0669e6f855dc80e6a4957498f3c8c1b6 100644 (file)
@@ -106,7 +106,7 @@ static void check_crossing_screen_boundary(uint32_t x, uint32_t y) {
         return;
     }
 
-    /* Focus the output on which the user moved his cursor */
+    /* Focus the output on which the user moved their cursor */
     Con *old_focused = focused;
     Con *next = con_descend_focused(output_get_content(output->con));
     /* Since we are switching outputs, this *must* be a different workspace, so
@@ -149,7 +149,7 @@ static void handle_enter_notify(xcb_enter_notify_event_t *event) {
         enter_child = true;
     }
 
-    /* If not, then the user moved his cursor to the root window. In that case, we adjust c_ws */
+    /* If not, then the user moved their cursor to the root window. In that case, we adjust c_ws */
     if (con == NULL) {
         DLOG("Getting screen at %d x %d\n", event->root_x, event->root_y);
         check_crossing_screen_boundary(event->root_x, event->root_y);
@@ -651,18 +651,18 @@ static void handle_expose_event(xcb_expose_event_t *event) {
     return;
 }
 
-#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT      0
-#define _NET_WM_MOVERESIZE_SIZE_TOP          1
-#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT     2
-#define _NET_WM_MOVERESIZE_SIZE_RIGHT        3
-#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT  4
-#define _NET_WM_MOVERESIZE_SIZE_BOTTOM       5
-#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT   6
-#define _NET_WM_MOVERESIZE_SIZE_LEFT         7
-#define _NET_WM_MOVERESIZE_MOVE              8  /* movement only */
-#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD     9  /* size via keyboard */
-#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD     10 /* move via keyboard */
-#define _NET_WM_MOVERESIZE_CANCEL            11 /* cancel operation */
+#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
+#define _NET_WM_MOVERESIZE_SIZE_TOP 1
+#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
+#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
+#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
+#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
+#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
+#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
+#define _NET_WM_MOVERESIZE_MOVE 8           /* movement only */
+#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9  /* size via keyboard */
+#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
+#define _NET_WM_MOVERESIZE_CANCEL 11        /* cancel operation */
 
 /*
  * Handle client messages (EWMH)
@@ -804,21 +804,6 @@ static void handle_client_message(xcb_client_message_event_t *event) {
             XCB_ATOM_CARDINAL, 32, 4,
             &r);
         xcb_flush(conn);
-    } else if (event->type == A_WM_CHANGE_STATE) {
-        /* http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4 */
-        Con *con = con_by_window_id(event->window);
-
-        if (con && event->data.data32[0] == 3) {
-            /* this request is so we can play some animiation showing the
-             * window physically moving to the tray before we close it (I
-             * think) */
-            DLOG("Client has requested iconic state. Closing this con. (con = %p)\n", con);
-            tree_close(con, DONT_KILL_WINDOW, false, false);
-            tree_render();
-        } else {
-            DLOG("Not handling WM_CHANGE_STATE request. (window = %d, state = %d)\n", event->window, event->data.data32[0]);
-        }
-
     } else if (event->type == A__NET_CURRENT_DESKTOP) {
         /* This request is used by pagers and bars to change the current
          * desktop likely as a result of some user action. We interpret this as
@@ -1257,12 +1242,21 @@ void handle_event(int type, xcb_generic_event_t *event) {
         DLOG("xkb event, need to handle it.\n");
 
         xcb_xkb_state_notify_event_t *state = (xcb_xkb_state_notify_event_t *)event;
-        if (state->xkbType == XCB_XKB_MAP_NOTIFY) {
+        if (state->xkbType == XCB_XKB_NEW_KEYBOARD_NOTIFY) {
+            DLOG("xkb new keyboard notify, sequence %d, time %d\n", state->sequence, state->time);
+            xcb_key_symbols_free(keysyms);
+            keysyms = xcb_key_symbols_alloc(conn);
+            ungrab_all_keys(conn);
+            translate_keysyms();
+            grab_all_keys(conn, false);
+        } else if (state->xkbType == XCB_XKB_MAP_NOTIFY) {
             if (event_is_ignored(event->sequence, type)) {
                 DLOG("Ignoring map notify event for sequence %d.\n", state->sequence);
             } else {
                 DLOG("xkb map notify, sequence %d, time %d\n", state->sequence, state->time);
                 add_ignore_event(event->sequence, type);
+                xcb_key_symbols_free(keysyms);
+                keysyms = xcb_key_symbols_alloc(conn);
                 ungrab_all_keys(conn);
                 translate_keysyms();
                 grab_all_keys(conn, false);
@@ -1273,7 +1267,7 @@ void handle_event(int type, xcb_generic_event_t *event) {
             /* See The XKB Extension: Library Specification, section 14.1 */
             /* We check if the current group (each group contains
              * two levels) has been changed. Mode_switch activates
-             * group XkbGroup2Index */
+             * group XCB_XKB_GROUP_2 */
             if (xkb_current_group == state->group)
                 return;
             xkb_current_group = state->group;
@@ -1283,7 +1277,7 @@ void handle_event(int type, xcb_generic_event_t *event) {
                 grab_all_keys(conn, false);
             } else {
                 DLOG("Mode_switch enabled\n");
-                grab_all_keys(conn, false);
+                grab_all_keys(conn, true);
             }
         }
 
@@ -1321,7 +1315,7 @@ void handle_event(int type, xcb_generic_event_t *event) {
             handle_motion_notify((xcb_motion_notify_event_t *)event);
             break;
 
-        /* Enter window = user moved his mouse over the window */
+        /* Enter window = user moved their mouse over the window */
         case XCB_ENTER_NOTIFY:
             handle_enter_notify((xcb_enter_notify_event_t *)event);
             break;
index 7dbb6632cb88191f77a86cfe398efaeff1c57297..acd2267bdb61f761f34511d3adaf3bec7afcff50 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -157,7 +157,7 @@ static void dump_binding(yajl_gen gen, Binding *bind) {
     y(integer, bind->keycode);
 
     ystr("input_type");
-    ystr((const char*)(bind->input_type == B_KEYBOARD ? "keyboard" : "mouse"));
+    ystr((const char *)(bind->input_type == B_KEYBOARD ? "keyboard" : "mouse"));
 
     ystr("symbol");
     if (bind->symbol == NULL)
@@ -397,7 +397,8 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
         ystr("transient_for");
         if (con->window->transient_for == XCB_NONE)
             y(null);
-        else y(integer, con->window->transient_for);
+        else
+            y(integer, con->window->transient_for);
 
         y(map_close);
     }
index b696e031a2dfc60c34cc8c4eda5b4af17575d26f..8b514178bbbf3283fc9391f11ef5c6f42643ba1a 100644 (file)
@@ -502,7 +502,7 @@ int main(int argc, char *argv[]) {
     }
 
     xcb_void_cookie_t cookie;
-    cookie = xcb_change_window_attributes_checked(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {ROOT_EVENT_MASK});
+    cookie = xcb_change_window_attributes_checked(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK});
     check_error(conn, cookie, "Another window manager seems to be running");
 
     xcb_get_geometry_reply_t *greply = xcb_get_geometry_reply(conn, gcookie, NULL);
@@ -536,9 +536,9 @@ int main(int argc, char *argv[]) {
         xcb_xkb_use_extension(conn, XCB_XKB_MAJOR_VERSION, XCB_XKB_MINOR_VERSION);
         xcb_xkb_select_events(conn,
                               XCB_XKB_ID_USE_CORE_KBD,
-                              XCB_XKB_EVENT_TYPE_STATE_NOTIFY | XCB_XKB_EVENT_TYPE_MAP_NOTIFY,
+                              XCB_XKB_EVENT_TYPE_STATE_NOTIFY | XCB_XKB_EVENT_TYPE_MAP_NOTIFY | XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY,
                               0,
-                              XCB_XKB_EVENT_TYPE_STATE_NOTIFY | XCB_XKB_EVENT_TYPE_MAP_NOTIFY,
+                              XCB_XKB_EVENT_TYPE_STATE_NOTIFY | XCB_XKB_EVENT_TYPE_MAP_NOTIFY | XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY,
                               0xff,
                               0xff,
                               NULL);
@@ -742,10 +742,10 @@ int main(int argc, char *argv[]) {
 
         xcb_create_gc(conn, gc, root->root,
                       XCB_GC_FUNCTION | XCB_GC_PLANE_MASK | XCB_GC_FILL_STYLE | XCB_GC_SUBWINDOW_MODE,
-                      (uint32_t[]) {XCB_GX_COPY, ~0, XCB_FILL_STYLE_SOLID, XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS});
+                      (uint32_t[]){XCB_GX_COPY, ~0, XCB_FILL_STYLE_SOLID, XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS});
 
         xcb_copy_area(conn, root->root, pixmap, gc, 0, 0, 0, 0, width, height);
-        xcb_change_window_attributes_checked(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]) {pixmap});
+        xcb_change_window_attributes_checked(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]){pixmap});
         xcb_flush(conn);
         xcb_free_gc(conn, gc);
         xcb_free_pixmap(conn, pixmap);
@@ -778,7 +778,7 @@ int main(int argc, char *argv[]) {
         ELOG("Could not setup signal handler");
 
     /* Ignore SIGPIPE to survive errors when an IPC client disconnects
-     * while we are sending him a message */
+     * while we are sending them a message */
     signal(SIGPIPE, SIG_IGN);
 
     /* Autostarting exec-lines */
index b7ea5e69e1aa3ce08e8ba864ef97fb368148d51a..7c464b43efa91c69d3d105db51861acda280f615 100644 (file)
@@ -69,7 +69,7 @@ void restore_geometry(void) {
 
     /* Strictly speaking, this line doesn’t really belong here, but since we
      * are syncing, let’s un-register as a window manager first */
-    xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
+    xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
 
     /* Make sure our changes reach the X server, we restart/exit now */
     xcb_aux_sync(conn);
@@ -434,7 +434,7 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
      * which are not managed by the wm anyways). We store the original geometry
      * here because it’s used for dock clients. */
     if (nc->geometry.width == 0)
-        nc->geometry = (Rect) {geom->x, geom->y, geom->width, geom->height};
+        nc->geometry = (Rect){geom->x, geom->y, geom->width, geom->height};
 
     if (motif_border_style != BS_NORMAL) {
         DLOG("MOTIF_WM_HINTS specifies decorations (border_style = %d)\n", motif_border_style);
index 7f92d4d441071601c7871e19b7f57992fec390d9..d7d576673e4b65bb13dcf9ddfbf1e5e20e2bf070 100644 (file)
@@ -154,7 +154,7 @@ void render_con(Con *con, bool render_fullscreen) {
         /* depending on the border style, the rect of the child window
          * needs to be smaller */
         Rect *inset = &(con->window_rect);
-        *inset = (Rect) {0, 0, con->rect.width, con->rect.height};
+        *inset = (Rect){0, 0, con->rect.width, con->rect.height};
         if (!render_fullscreen)
             *inset = rect_add(*inset, con_border_style_rect(con));
 
@@ -299,7 +299,7 @@ void render_con(Con *con, bool render_fullscreen) {
                            transient_con->window != NULL &&
                            transient_con->window->transient_for != XCB_NONE) {
                         DLOG("transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, fullscreen_id = 0x%08x\n",
-                                transient_con->window->id, transient_con->window->transient_for, fullscreen->window->id);
+                             transient_con->window->id, transient_con->window->transient_for, fullscreen->window->id);
                         if (transient_con->window->transient_for == fullscreen->window->id) {
                             is_transient_for = true;
                             break;
index 3a657c90bf4123de34315aa6f66aab4c76d6997f..0f6e54f9cc18e68d01d832680ab201e4b503838d 100644 (file)
@@ -125,9 +125,9 @@ void restore_connect(void) {
 
 static void update_placeholder_contents(placeholder_state *state) {
     xcb_change_gc(restore_conn, state->gc, XCB_GC_FOREGROUND,
-                  (uint32_t[]) {config.client.placeholder.background});
+                  (uint32_t[]){config.client.placeholder.background});
     xcb_poly_fill_rectangle(restore_conn, state->pixmap, state->gc, 1,
-                            (xcb_rectangle_t[]) {{0, 0, state->rect.width, state->rect.height}});
+                            (xcb_rectangle_t[]){{0, 0, state->rect.width, state->rect.height}});
 
     // TODO: make i3font functions per-connection, at least these two for now…?
     xcb_flush(restore_conn);
@@ -190,7 +190,7 @@ static void open_placeholder_window(Con *con) {
             XCURSOR_CURSOR_POINTER,
             true,
             XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK,
-            (uint32_t[]) {
+            (uint32_t[]){
                 config.client.placeholder.background,
                 XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY,
             });
@@ -211,7 +211,7 @@ static void open_placeholder_window(Con *con) {
         xcb_create_pixmap(restore_conn, root_depth, state->pixmap,
                           state->window, state->rect.width, state->rect.height);
         state->gc = xcb_generate_id(restore_conn);
-        xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]) {0});
+        xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]){0});
         update_placeholder_contents(state);
         TAILQ_INSERT_TAIL(&state_head, state, state);
 
@@ -219,7 +219,7 @@ static void open_placeholder_window(Con *con) {
         Match *temp_id = smalloc(sizeof(Match));
         match_init(temp_id);
         temp_id->id = placeholder;
-        TAILQ_INSERT_TAIL(&(con->swallow_head), temp_id, matches);
+        TAILQ_INSERT_HEAD(&(con->swallow_head), temp_id, matches);
     }
 
     Con *child;
@@ -323,7 +323,7 @@ static void configure_notify(xcb_configure_notify_event_t *event) {
         xcb_create_pixmap(restore_conn, root_depth, state->pixmap,
                           state->window, state->rect.width, state->rect.height);
         state->gc = xcb_generate_id(restore_conn);
-        xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]) {0});
+        xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]){0});
 
         update_placeholder_contents(state);
         xcb_copy_area(restore_conn, state->pixmap, state->window, state->gc,
index 8b5bfed4c015745390dd4a645645dfc87b4619d4..546b73d91104d2e19941b0f1f370ecc616dd8054 100644 (file)
@@ -129,9 +129,9 @@ static int sig_draw_window(xcb_window_t win, int width, int height, int font_hei
     /* re-draw the background */
     xcb_rectangle_t border = {0, 0, width, height},
                     inner = {2, 2, width - 4, height - 4};
-    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#FF0000")});
+    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){get_colorpixel("#FF0000")});
     xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &border);
-    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#000000")});
+    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){get_colorpixel("#000000")});
     xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &inner);
 
     /* restore font color */
index e99c5063b3b26ed5bb363874a8a5d6be35e291b2..9b60fea6f9cc5031fc2663d1cd494986909c08ea 100644 (file)
@@ -76,7 +76,7 @@ bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry) {
 
     /* TODO: refactor the following */
     croot = con_new(NULL, NULL);
-    croot->rect = (Rect) {
+    croot->rect = (Rect){
         geometry->x,
         geometry->y,
         geometry->width,
@@ -118,7 +118,7 @@ void tree_init(xcb_get_geometry_reply_t *geometry) {
     croot->name = "root";
     croot->type = CT_ROOT;
     croot->layout = L_SPLITH;
-    croot->rect = (Rect) {
+    croot->rect = (Rect){
         geometry->x,
         geometry->y,
         geometry->width,
@@ -237,7 +237,7 @@ bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool
              * unmap the window,
              * then reparent it to the root window. */
             xcb_change_window_attributes(conn, con->window->id,
-                                         XCB_CW_EVENT_MASK, (uint32_t[]) {XCB_NONE});
+                                         XCB_CW_EVENT_MASK, (uint32_t[]){XCB_NONE});
             xcb_unmap_window(conn, con->window->id);
             cookie = xcb_reparent_window(conn, con->window->id, root, 0, 0);
 
index b382a586e09f2d8b545e663bcaa26b5b4eaf61cc..c5c22ba8c8c1f68351350d39db1a543cab6cd3f9 100644 (file)
@@ -42,17 +42,17 @@ bool rect_contains(Rect rect, uint32_t x, uint32_t y) {
 }
 
 Rect rect_add(Rect a, Rect b) {
-    return (Rect) {a.x + b.x,
-                   a.y + b.y,
-                   a.width + b.width,
-                   a.height + b.height};
+    return (Rect){a.x + b.x,
+                  a.y + b.y,
+                  a.width + b.width,
+                  a.height + b.height};
 }
 
 Rect rect_sub(Rect a, Rect b) {
-    return (Rect) {a.x - b.x,
-                   a.y - b.y,
-                   a.width - b.width,
-                   a.height - b.height};
+    return (Rect){a.x - b.x,
+                  a.y - b.y,
+                  a.width - b.width,
+                  a.height - b.height};
 }
 
 /*
index e406752a54c63fa5bd2f2b77ddb96419cef407c3..ace109e3e068e7e95dc383a33a0a9c16771d6bd5 100644 (file)
@@ -189,7 +189,7 @@ void window_update_strut_partial(i3Window *win, xcb_get_property_reply_t *prop)
     DLOG("Reserved pixels changed to: left = %d, right = %d, top = %d, bottom = %d\n",
          strut[0], strut[1], strut[2], strut[3]);
 
-    win->reserved = (struct reservedpx) {strut[0], strut[1], strut[2], strut[3]};
+    win->reserved = (struct reservedpx){strut[0], strut[1], strut[2], strut[3]};
 
     free(prop);
 }
diff --git a/src/x.c b/src/x.c
index b39c19d002f2515d7dd1843b640ea047dac4dc4a..9dd09117cf72eaeb234b2f1c10b7c49a9e89b17b 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -352,8 +352,8 @@ void x_draw_decoration(Con *con) {
 
     Rect *r = &(con->rect);
     Rect *w = &(con->window_rect);
-    p->con_rect = (struct width_height) {r->width, r->height};
-    p->con_window_rect = (struct width_height) {w->width, w->height};
+    p->con_rect = (struct width_height){r->width, r->height};
+    p->con_window_rect = (struct width_height){w->width, w->height};
     p->con_deco_rect = con->deco_rect;
     p->background = config.client.background;
     p->con_is_leaf = con_is_leaf(con);
@@ -403,7 +403,7 @@ void x_draw_decoration(Con *con) {
                 );
 #endif
 
-        xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {config.client.background});
+        xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){config.client.background});
         xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, sizeof(background) / sizeof(xcb_rectangle_t), background);
     }
 
@@ -424,7 +424,7 @@ void x_draw_decoration(Con *con) {
          * (left, bottom and right part). We don’t just fill the whole
          * rectangle because some childs are not freely resizable and we want
          * their background color to "shine through". */
-        xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->background});
+        xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->background});
         if (!(borders_to_hide & ADJ_LEFT_SCREEN_EDGE)) {
             xcb_rectangle_t leftline = {0, 0, br.x, r->height};
             xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, &leftline);
@@ -450,12 +450,12 @@ void x_draw_decoration(Con *con) {
         if (TAILQ_NEXT(con, nodes) == NULL &&
             TAILQ_PREV(con, nodes_head, nodes) == NULL &&
             con->parent->type != CT_FLOATING_CON) {
-            xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->indicator});
+            xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->indicator});
             if (p->parent_layout == L_SPLITH)
-                xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]) {
+                xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
                                                                               {r->width + (br.width + br.x), br.y, -(br.width + br.x), r->height + br.height}});
             else if (p->parent_layout == L_SPLITV)
-                xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]) {
+                xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
                                                                               {br.x, r->height + (br.height + br.y), r->width + br.width, -(br.height + br.y)}});
         }
     }
@@ -466,20 +466,20 @@ void x_draw_decoration(Con *con) {
         goto copy_pixmaps;
 
     /* 4: paint the bar */
-    xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->background});
+    xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->background});
     xcb_rectangle_t drect = {con->deco_rect.x, con->deco_rect.y, con->deco_rect.width, con->deco_rect.height};
     xcb_poly_fill_rectangle(conn, parent->pixmap, parent->pm_gc, 1, &drect);
 
     /* 5: draw two unconnected horizontal lines in border color */
-    xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->border});
+    xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->border});
     Rect *dr = &(con->deco_rect);
     adjacent_t borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
     int deco_diff_l = borders_to_hide & ADJ_LEFT_SCREEN_EDGE ? 0 : con->current_border_width;
-    int deco_diff_r = borders_to_hide & ADJ_RIGHT_SCREEN_EDGE ? 0 : con-> current_border_width;
+    int deco_diff_r = borders_to_hide & ADJ_RIGHT_SCREEN_EDGE ? 0 : con->current_border_width;
     if (parent->layout == L_TABBED ||
         (parent->layout == L_STACKED && TAILQ_NEXT(con, nodes) != NULL)) {
-            deco_diff_l = 0;
-            deco_diff_r = 0;
+        deco_diff_l = 0;
+        deco_diff_r = 0;
     }
     xcb_segment_t segments[] = {
         {dr->x, dr->y,
@@ -545,12 +545,12 @@ after_title:
     /* Draw a 1px separator line before and after every tab, so that tabs can
      * be easily distinguished. */
     if (parent->layout == L_TABBED) {
-        xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->border});
+        xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->border});
     } else {
-        xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->background});
+        xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->background});
     }
     xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, parent->pixmap, parent->pm_gc, 6,
-                  (xcb_point_t[]) {
+                  (xcb_point_t[]){
                       {dr->x + dr->width, dr->y},
                       {dr->x + dr->width, dr->y + dr->height},
                       {dr->x + dr->width - 1, dr->y},
@@ -559,7 +559,7 @@ after_title:
                       {dr->x, dr->y},
                   });
 
-    xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->border});
+    xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->border});
     xcb_poly_segment(conn, parent->pixmap, parent->pm_gc, 2, segments);
 
 copy_pixmaps:
@@ -975,9 +975,9 @@ void x_push_changes(Con *con) {
             Output *target = get_output_containing(mid_x, mid_y);
             if (current != target) {
                 /* Ignore MotionNotify events generated by warping */
-                xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
+                xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
                 xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, mid_x, mid_y);
-                xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {ROOT_EVENT_MASK});
+                xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK});
             }
         }
         warp_to = NULL;
index cb0c29f16b545414c0971f3b3b34412f32a80135..5dda5ccee1bc6d940842af8100fb04209923ff03 100644 (file)
--- a/src/xcb.c
+++ b/src/xcb.c
@@ -70,9 +70,9 @@ xcb_window_t create_window(xcb_connection_t *conn, Rect dims,
  */
 void xcb_draw_line(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext_t gc,
                    uint32_t colorpixel, uint32_t x, uint32_t y, uint32_t to_x, uint32_t to_y) {
-    xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]) {colorpixel});
+    xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){colorpixel});
     xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, drawable, gc, 2,
-                  (xcb_point_t[]) {{x, y}, {to_x, to_y}});
+                  (xcb_point_t[]){{x, y}, {to_x, to_y}});
 }
 
 /*
@@ -81,7 +81,7 @@ void xcb_draw_line(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext
  */
 void xcb_draw_rect(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext_t gc,
                    uint32_t colorpixel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) {
-    xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]) {colorpixel});
+    xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){colorpixel});
     xcb_rectangle_t rect = {x, y, width, height};
     xcb_poly_fill_rectangle(conn, drawable, gc, 1, &rect);
 }
index 6daeedba5aab23f58de903e8c89c1dd6c38c50fa..0a8da42545c5384f405b7de67a60675e7b419ccc 100644 (file)
@@ -56,7 +56,7 @@ void xcursor_load_cursors(void) {
  */
 void xcursor_set_root_cursor(int cursor_id) {
     xcb_change_window_attributes(conn, root, XCB_CW_CURSOR,
-                                 (uint32_t[]) {xcursor_get_cursor(cursor_id)});
+                                 (uint32_t[]){xcursor_get_cursor(cursor_id)});
 }
 
 xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c) {
diff --git a/testcases/t/231-wm-change-state.t b/testcases/t/231-wm-change-state.t
deleted file mode 100644 (file)
index 92992b4..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!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)
-#
-# Correctly handle WM_CHANGE_STATE requests for the iconic state
-# See http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4
-# Ticket: #1279
-# Bug still in: 4.8-7-gf4a8253
-use i3test;
-
-sub send_iconic_state_request {
-    my ($win) = @_;
-
-    my $msg = pack "CCSLLLLLL",
-        X11::XCB::CLIENT_MESSAGE, # response_type
-        32, # format
-        0, # sequence
-        $win->id, # window
-        $x->atom(name => 'WM_CHANGE_STATE')->id, # message type
-        3, # data32[0]
-        0, # data32[1]
-        0, # data32[2]
-        0, # data32[3]
-        0; # data32[4]
-
-    $x->send_event(0, $x->get_root_window(), X11::XCB::EVENT_MASK_SUBSTRUCTURE_REDIRECT, $msg);
-}
-
-my $ws = fresh_workspace;
-my $win = open_window;
-
-send_iconic_state_request($win);
-sync_with_i3;
-
-is(@{get_ws($ws)->{nodes}}, 0, 'When a window requests the iconic state, the container should be closed');
-
-done_testing;