]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #1657 from Georgiy-Tugai/fix-flickering-shortened
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Sun, 26 Apr 2015 21:38:27 +0000 (23:38 +0200)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Sun, 26 Apr 2015 21:38:27 +0000 (23:38 +0200)
i3bar: fix flickering shortened status bar on other output(s)

163 files changed:
CONTRIBUTING.md
RELEASE-NOTES-4.10.1 [deleted file]
RELEASE-NOTES-4.10.2 [new file with mode: 0644]
common.mk
debian/changelog
docs/asciidoc-git.conf
docs/debugging
docs/userguide
generate-command-parser.pl
i3-config-wizard/i3-config-wizard.mk
i3-config-wizard/main.c
i3-dmenu-desktop
i3-dump-log/i3-dump-log.mk
i3-dump-log/main.c
i3-input/i3-input.mk
i3-input/main.c
i3-msg/i3-msg.mk
i3-msg/main.c
i3-nagbar/i3-nagbar.mk
i3-nagbar/main.c
i3-save-tree
i3bar/i3bar.mk
i3bar/include/child.h
i3bar/include/common.h
i3bar/include/config.h
i3bar/include/ipc.h
i3bar/include/mode.h
i3bar/include/outputs.h
i3bar/include/parse_json_header.h
i3bar/include/trayclients.h
i3bar/include/util.h
i3bar/include/workspaces.h
i3bar/include/xcb.h
i3bar/src/child.c
i3bar/src/config.c
i3bar/src/ipc.c
i3bar/src/main.c
i3bar/src/mode.c
i3bar/src/outputs.c
i3bar/src/parse_json_header.c
i3bar/src/workspaces.c
i3bar/src/xcb.c
include/all.h
include/assignments.h
include/atoms.xmacro
include/bindings.h
include/click.h
include/cmdparse.h
include/commands.h
include/commands_parser.h
include/con.h
include/config.h
include/config_directives.h
include/config_parser.h
include/data.h
include/debug.h
include/display_version.h
include/ewmh.h
include/fake_outputs.h
include/floating.h
include/handlers.h
include/i3.h
include/i3/ipc.h
include/ipc.h
include/key_press.h
include/libi3.h
include/load_layout.h
include/log.h
include/main.h
include/manage.h
include/match.h
include/move.h
include/output.h
include/randr.h
include/regex.h
include/render.h
include/resize.h
include/restore_layout.h
include/scratchpad.h
include/shmlog.h
include/sighandler.h
include/startup.h
include/tree.h
include/util.h
include/window.h
include/workspace.h
include/x.h
include/xcb.h
include/xcb_compat.h
include/xcursor.h
include/xinerama.h
include/yajl_utils.h
libi3/dpi.c
libi3/fake_configure_notify.c
libi3/font.c
libi3/get_colorpixel.c
libi3/get_config_path.c
libi3/get_mod_mask.c
libi3/get_process_filename.c
libi3/get_visualtype.c
libi3/ipc_connect.c
libi3/ipc_recv_message.c
libi3/ipc_send_message.c
libi3/resolve_tilde.c
libi3/root_atom_contents.c
libi3/safewrappers.c
libi3/string.c
libi3/strndup.c
libi3/ucs2_conversion.c
man/asciidoc.conf
parser-specs/commands.spec
parser-specs/config.spec
release.sh
src/assignments.c
src/bindings.c
src/click.c
src/commands.c
src/commands_parser.c
src/con.c
src/config.c
src/config_directives.c
src/config_parser.c
src/debug.c
src/display_version.c
src/ewmh.c
src/fake_outputs.c
src/floating.c
src/handlers.c
src/i3.mk
src/ipc.c
src/key_press.c
src/load_layout.c
src/log.c
src/main.c
src/manage.c
src/match.c
src/move.c
src/output.c
src/randr.c
src/regex.c
src/render.c
src/resize.c
src/restore_layout.c
src/scratchpad.c
src/sighandler.c
src/startup.c
src/tree.c
src/util.c
src/version.c
src/window.c
src/workspace.c
src/x.c
src/xcb.c
src/xcursor.c
src/xinerama.c
testcases/complete-run.pl
testcases/t/158-wm_take_focus.t
testcases/t/165-for_window.t
testcases/t/187-commands-parser.t
testcases/t/201-config-parser.t
testcases/t/232-cmd-move-criteria.t
testcases/t/243-move-to-mark.t [new file with mode: 0644]
testcases/t/243-net-wm-state-hidden.t [new file with mode: 0644]

index 7a5e0c5fda2b947e1db0c2f11c3a4dab67283d3f..1e1307614cc10e8f7ff14794ae6f44e9e4f9c3a2 100644 (file)
@@ -9,6 +9,11 @@ and https://github.com/i3/i3lock
 1. Read http://i3wm.org/docs/debugging.html
 2. Make sure you include a link to your logfile in your report (section 3).
 3. Make sure you include the i3 version number in your report (section 1).
+4. Please be aware that we cannot support compatibility issues with
+   closed-source software, as digging into compatibility problems without
+   having access to the source code is too time-consuming. Additionally,
+   experience has shown that often, the software in question is responsible for
+   the issue. Please raise an issue with the software in question, not i3.
 
 # Pull requests
 
diff --git a/RELEASE-NOTES-4.10.1 b/RELEASE-NOTES-4.10.1
deleted file mode 100644 (file)
index 61b4770..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-
- ┌──────────────────────────────┐
- │ Release notes for i3 v4.10.1 │
- └──────────────────────────────┘
-
-This is i3 v4.10.1. This version is considered stable. All users of i3 are
-strongly encouraged to upgrade.
-
-This release contains mostly bugfixes, but we felt it was necessary since there
-are two important changes in behavior: we have reverted the pango markup
-parsing by default (introduced with i3 v4.9) and the change in how the
-“workspace” command behaves (introduced with i3 v4.9). Both of them broke some
-user’s setups, which is not acceptable. In order to help us avoid such mistakes
-in the future, please consider using the i3 git version — it is typically
-stable.
-
-PS: The v4.10 release did not contain any of the commits we meant to release
-due to a human error in our release automation. Hence the v4.10.1 release.
-
- ┌────────────────────────────┐
- │ Changes in i3 v4.10.1      │
- └────────────────────────────┘
-
-  • i3bar: cut long statuslines from the left
-  • i3bar: add support for the short_text property
-  • i3-sensible-terminal: launch i3-nagbar when no terminal is found
-  • i3-config-wizard: switch modifier on key up/down
-  • docs/layout-saving: added a troubleshooting section
-  • docs: degender all the terms
-  • Revert "Workspace command number selection"
-  • don’t parse blocks as markup by default
-  • Allow escaping backslashes in commands.
-  • switch default font from “DejaVu Sans Mono 8” to “monospace 8”, which is
-    typically a synonym, except for users who prefer a different font.
-  • When renaming a workspace, look for assignments and move the renamed
-    workspace to the appropriate output.
-  • i3-save-tree: make --workspace optional by defaulting to the focused
-    workspace
-  • Allow nop command without argument
-
- ┌────────────────────────────┐
- │ Bugfixes                   │
- └────────────────────────────┘
-
-  • i3bar: buffer the statusline to avoid flickering
-  • i3bar: fix click events for workspace buttons with long statusline
-  • i3bar: set correct initial position when reconfiguring
-  • i3bar: reconfigure strut partial on reload
-  • i3-nagbar: fix sizes/positioning on hi-dpi displays
-  • i3-config-wizard: fix sizes/positioning on hi-dpi displays
-  • i3-input: fix sizes/positioning on hi-dpi displays
-  • Fix scrolling in window decoration with hidden cursor.
-  • workspace rename focus mismatch
-  • Don’t overwrite border width when already set (placeholders).
-  • fix a segfault during config file validation
-  • Restore placeholder windows after restarting.
-  • Don’t focus placeholder windows.
-
- ┌────────────────────────────┐
- │ Thanks!                    │
- └────────────────────────────┘
-
-Thanks for testing, bugfixes, discussions and everything I forgot go out to:
-
-  Chih-Chyuan Hwang, Deiz, Diana Dinosaur, Ingo Bürk, Michael Hofmann,
-  Michael Tipton, Micha Rosenbaum, shdown, Tony Crisci
-
--- Michael Stapelberg, 2015-03-29
diff --git a/RELEASE-NOTES-4.10.2 b/RELEASE-NOTES-4.10.2
new file mode 100644 (file)
index 0000000..49c06e5
--- /dev/null
@@ -0,0 +1,26 @@
+
+ ┌──────────────────────────────┐
+ │ Release notes for i3 v4.10.2 │
+ └──────────────────────────────┘
+
+This is i3 v4.10.2. This version is considered stable. All users of i3 are
+strongly encouraged to upgrade.
+
+ ┌────────────────────────────┐
+ │ Bugfixes                   │
+ └────────────────────────────┘
+
+  • Cope with non-null-terminated x class properties.
+  • Get workspace name when renaming current workspace (fixes crash).
+  • Use a reasonable default sep_block_width if a separator_symbol is given.
+  • Remove windows from the save set when unmapping.
+
+ ┌────────────────────────────┐
+ │ Thanks!                    │
+ └────────────────────────────┘
+
+Thanks for testing, bugfixes, discussions and everything I forgot go out to:
+
+  Ingo Bürk, Michael Hofmann,
+
+-- Michael Stapelberg, 2015-04-16
index dcc90c964f968c975c7a7bbf2e62352d895de524..c568fb60dba42d557e73ac33c167a46b7c6a2230 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -2,9 +2,13 @@ UNAME=$(shell uname)
 DEBUG=1
 INSTALL=install
 LN=ln
+PKG_CONFIG=pkg-config
 ifndef PREFIX
   PREFIX=/usr
 endif
+ifndef EXEC_PREFIX
+  EXEC_PREFIX=$(PREFIX)
+endif
 ifndef SYSCONFDIR
   ifeq ($(PREFIX),/usr)
     SYSCONFDIR=/etc
@@ -59,7 +63,7 @@ I3_CPPFLAGS += -DI3__FILE__=__FILE__
 
 ## Libraries flags
 
-ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
+ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null 1>/dev/null || echo 1),1)
 $(error "pkg-config was not found")
 endif
 
@@ -73,15 +77,15 @@ endif
 #
 # We redirect stderr to /dev/null because pkg-config prints an error if support
 # for gnome-config was enabled but gnome-config is not actually installed.
-cflags_for_lib = $(shell pkg-config --silence-errors --cflags $(1) 2>/dev/null)
-ldflags_for_lib = $(shell pkg-config --exists 2>/dev/null $(1) && pkg-config --libs $(1) 2>/dev/null || echo -l$(2))
+cflags_for_lib = $(shell $(PKG_CONFIG) --silence-errors --cflags $(1) 2>/dev/null)
+ldflags_for_lib = $(shell $(PKG_CONFIG) --exists 2>/dev/null $(1) && $(PKG_CONFIG) --libs $(1) 2>/dev/null || echo -l$(2))
 
 # XCB common stuff
 XCB_CFLAGS  := $(call cflags_for_lib, xcb)
 XCB_CFLAGS  += $(call cflags_for_lib, xcb-event)
 XCB_LIBS    := $(call ldflags_for_lib, xcb,xcb)
 XCB_LIBS    += $(call ldflags_for_lib, xcb-event,xcb-event)
-ifeq ($(shell pkg-config --exists xcb-util 2>/dev/null || echo 1),1)
+ifeq ($(shell $(PKG_CONFIG) --exists xcb-util 2>/dev/null || echo 1),1)
 XCB_CFLAGS  += $(call cflags_for_lib, xcb-atom)
 XCB_CFLAGS  += $(call cflags_for_lib, xcb-aux)
 XCB_LIBS    += $(call ldflags_for_lib, xcb-atom,xcb-atom)
@@ -124,7 +128,7 @@ LIBEV_LIBS   := $(call ldflags_for_lib, libev,ev)
 
 # libpcre
 PCRE_CFLAGS := $(call cflags_for_lib, libpcre)
-ifeq ($(shell pkg-config --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
+ifeq ($(shell $(PKG_CONFIG) --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
 I3_CPPFLAGS += -DPCRE_HAS_UCP=1
 endif
 PCRE_LIBS   := $(call ldflags_for_lib, libpcre,pcre)
index 183e59406b9d8d96a388158a725ef9ac956ef34e..023eeac10b6e000570cfc0c624f2ca04c1248cd9 100644 (file)
@@ -1,8 +1,14 @@
-i3-wm (4.10.2-1) experimental; urgency=medium
+i3-wm (4.10.3-1) experimental; urgency=medium
 
   * NOT YET RELEASED.
 
- -- Michael Stapelberg <stapelberg@debian.org>  Sun, 29 Mar 2015 19:10:38 +0200
+ -- Michael Stapelberg <stapelberg@debian.org>  Thu, 16 Apr 2015 09:08:30 +0200
+
+i3-wm (4.10.2-1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Michael Stapelberg <stapelberg@debian.org>  Thu, 16 Apr 2015 09:02:53 +0200
 
 i3-wm (4.10.1-1) experimental; urgency=medium
 
index 3d42bca8a9999309c3e8b961d9c377de5896585f..36bdb6f5a0cac50ac424537636e140b4799587aa 100644 (file)
@@ -647,7 +647,7 @@ endif::doctype-manpage[]
 </div>\r
 {disable-javascript%<div id="footnotes"><hr /></div>}\r
 <div id="footer" lang="de">\r
-© 2009-2014 Michael Stapelberg, <a href="http://i3wm.org/impress.html">Impressum</a>
+© 2009 Michael Stapelberg, <a href="http://i3wm.org/impress.html">Impressum</a>
 </div>\r
 </body>\r
 </html>\r
index 1253b0c50fc2b405f8279d36211c7c02014174fd..639dbdfe979d67d4469b17885c6c0fa9faec6813 100644 (file)
@@ -10,10 +10,10 @@ Thank you for being interested in debugging i3. It really means
 something to us to get your bug fixed. If you have any questions about the
 process and/or need further help, do not hesitate to contact us!
 
-== Verify you are using i3 ≥ 4.7
+== Verify you are using i3 ≥ 4.10
 
-Only the latest major version of i3 is supported, i.e. version 4.7 currently.
-To verify which version you are running, use:
+Only the latest major version of i3 is supported. To verify which version
+you are running, use:
 
 ---------------
 $ i3 --moreversion 2>&- || i3 --version
@@ -69,6 +69,11 @@ i3-msg 'debuglog on; shmlog on; reload'
 
 == Obtaining the debug logfile
 
+Please note that log files may contain sensitive data such as window titles.
+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.
+
 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.
 
@@ -121,3 +126,19 @@ When debugging with us in IRC, be prepared to use a so called nopaste service
 such as http://nopaste.info or http://pastebin.com because pasting large
 amounts of text in IRC sometimes leads to incomplete lines (servers have line
 length limitations) or flood kicks.
+
+== Debugging i3bar
+
+To debug i3bar problems, add +verbose yes+ to all +bar {}+ blocks in your i3 config
+and then restart all i3bar instances like this:
+
+---------------------------------------------------------------------
+$ killall i3bar
+$ for c in $(i3-msg -t get_bar_config | python -c \
+      'import json,sys;print("\n".join(json.load(sys.stdin)))'); do \
+    (i3bar --bar_id=$c >i3bar.$c.log 2>&1) & \
+  done;
+---------------------------------------------------------------------
+
+There will now be +i3bar.*.log+ files in your current directory that you can provide
+in your bug report.
index 687dff10e5221c48ebfd3f3f1207eff76c4199c8..301d8c811d5976a1d5d0a1e6f153c6b972d115c7 100644 (file)
@@ -405,13 +405,16 @@ can configure mouse bindings in a similar way to key bindings.
 
 *Syntax*:
 ----------------------------------
-bindsym [--release] [--whole-window] [Modifiers+]button[n] command
+bindsym [--release] [--border] [--whole-window] [Modifiers+]button[n] command
 ----------------------------------
 
 By default, the binding will only run when you click on the titlebar of the
-window. If the +--whole-window+ flag is given, it will run when any part of the
-window is clicked. If the +--release+ flag is given, it will run when the mouse
-button is released.
+window. If the +--release+ flag is given, it will run when the mouse button
+is released.
+
+If the +--whole-window+ flag is given, the binding will also run when any part
+of the window is clicked, with the exception of the border. To have a bind run
+when the border is clicked, specify the +--border+ flag.
 
 *Examples*:
 --------------------------------
@@ -721,6 +724,10 @@ commands will not run when restarting i3, if you need a command to run
 also when restarting i3 you should use the +exec_always+
 keyword. These commands will be run in order.
 
+See <<command_chaining>> for details on the special meaning of +;+ (semicolon)
+and +,+ (comma): they chain commands together in i3 and need to be escaped if
+you want to use them in your command.
+
 *Syntax*:
 -------------------
 exec [--no-startup-id] command
@@ -1464,6 +1471,8 @@ do this is to use the +i3-msg+ utility:
 i3-msg border none
 --------------------------
 
+[[command_chaining]]
+
 Commands can be chained by using +;+ (a semicolon). So, to move a window to a
 specific workspace and immediately switch to that workspace, you can configure
 the following keybinding:
@@ -1508,6 +1517,10 @@ instance::
        Compares the window instance (the first part of WM_CLASS)
 window_role::
        Compares the window role (WM_WINDOW_ROLE).
+window_type::
+        Compare the window type (_NET_WM_WINDOW_TYPE). Possible values are
+        +normal+, +dialog+, +utility+, +toolbar+, +splash+, +menu+, +dropdown_menu+,
+        +popup_menu+ and +toolti+.
 id::
        Compares the X11 window ID, which you can get via +xwininfo+ for example.
 title::
@@ -1533,7 +1546,11 @@ information on how to use them.
 What good is a window manager if you can’t actually start any applications?
 The exec command starts an application by passing the command you specify to a
 shell. This implies that you can use globbing (wildcards) and programs will be
-searched in your $PATH.
+searched in your +$PATH+.
+
+See <<command_chaining>> for details on the special meaning of +;+ (semicolon)
+and +,+ (comma): they chain commands together in i3 and need to be escaped if
+you want to use them in your command.
 
 *Syntax*:
 ------------------------------
@@ -1834,6 +1851,26 @@ bindsym $mod+x move workspace to output right
 bindsym $mod+x move container to output VGA1
 --------------------------------------------------------
 
+=== Moving containers/workspaces to marks
+
+To move a container to another container with a specific mark (see <<vim_like_marks>>),
+you can use the following command.
+
+The window will be moved right after the marked container in the tree, i.e., it ends up
+in the same position as if you had opened a new window when the marked container was
+focused. If the mark is on a split container, the window will appear as a new child
+after the currently focused child within that container.
+
+*Syntax*:
+------------------------------------
+move window|container to mark <mark>
+------------------------------------
+
+*Example*:
+--------------------------------------------------------
+for_window [instance="tabme"] move window to mark target
+--------------------------------------------------------
+
 [[resizingconfig]]
 
 === Resizing containers/windows
index 9b5ef562941779da30ff5e6386f178bd36c9650d..f40bb390100b1ff3c26a748e4c84473a54e0317d 100755 (executable)
@@ -2,7 +2,7 @@
 # vim:ts=4:sw=4:expandtab
 #
 # i3 - an improved dynamic tiling window manager
-# © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+# © 2009 Michael Stapelberg and contributors (see also: LICENSE)
 #
 # generate-command-parser.pl: script to generate parts of the command parser
 # from its specification file parser-specs/commands.spec.
index 1dab64526165e73c1642172c459ac4e33f9e8d3a..900893f5e85297824fc0ae1ee0621d9c826b7d5a 100644 (file)
@@ -20,8 +20,8 @@ i3-config-wizard/i3-config-wizard: libi3.a $(i3_config_wizard_OBJECTS)
 
 install-i3-config-wizard: i3-config-wizard/i3-config-wizard
        echo "[i3-config-wizard] Install"
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -m 0755 i3-config-wizard/i3-config-wizard $(DESTDIR)$(PREFIX)/bin/
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
+       $(INSTALL) -m 0755 i3-config-wizard/i3-config-wizard $(DESTDIR)$(EXEC_PREFIX)/bin/
 
 clean-i3-config-wizard:
        echo "[i3-config-wizard] Clean"
index 9c9241cd0ad5223d67c77ba20b7ee1a01de31227..4c1d96971ec0d5cc27978b0ed24c219ba82252d1 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * i3-config-wizard: Program to convert configs using keycodes to configs using
  *                   keysyms.
index cc72f1016429780c2e13a2ef8378c119701cb9e0..a0549ead7dbb81c37991cc748f782ef2eace0f33 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 # vim:ts=4:sw=4:expandtab
 #
-# © 2012-2014 Michael Stapelberg
+# © 2012 Michael Stapelberg
 #
 # No dependencies except for perl ≥ v5.10
 
@@ -45,7 +45,7 @@ my $result = GetOptions(
     'dmenu=s' => \$dmenu_cmd,
     'entry-type=s' => \@entry_types,
     'version' => sub {
-        say "dmenu-desktop 1.5 © 2012-2013 Michael Stapelberg";
+        say "dmenu-desktop 1.5 © 2012 Michael Stapelberg";
         exit 0;
     },
     'help' => sub {
index bbce356fddd78eba858f993acb91c77d2724d6d0..7e5d4499fab7dc5d8f3dde55f401437b0d9f8f02 100644 (file)
@@ -20,8 +20,8 @@ i3-dump-log/i3-dump-log: libi3.a $(i3_dump_log_OBJECTS)
 
 install-i3-dump-log: i3-dump-log/i3-dump-log
        echo "[i3-dump-log] Install"
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -m 0755 i3-dump-log/i3-dump-log $(DESTDIR)$(PREFIX)/bin/
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
+       $(INSTALL) -m 0755 i3-dump-log/i3-dump-log $(DESTDIR)$(EXEC_PREFIX)/bin/
 
 clean-i3-dump-log:
        echo "[i3-dump-log] Clean"
index 1b0d593c5e1c7322c11c210e739adfade5f50030..137554a4f1fefc36539c5ca8c40b5357b32a7e2a 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * i3-dump-log/main.c: Dumps the i3 SHM log to stdout.
  *
index 03f4e0a6e5f53fbe994e102a90b8769c7e902db4..be3e28331d263d02d820be553ae4e0d82508b491 100644 (file)
@@ -20,8 +20,8 @@ i3-input/i3-input: libi3.a $(i3_input_OBJECTS)
 
 install-i3-input: i3-input/i3-input
        echo "[i3-input] Install"
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -m 0755 i3-input/i3-input $(DESTDIR)$(PREFIX)/bin/
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
+       $(INSTALL) -m 0755 i3-input/i3-input $(DESTDIR)$(EXEC_PREFIX)/bin/
 
 clean-i3-input:
        echo "[i3-input] Clean"
index b32d7b6629b25dcd109e4f9ab1af6d059bfe8ca0..5a6a740e1e6b789cc22f6c21d3fa89f2be8a27db 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * i3-input/main.c: Utility which lets the user input commands and sends them
  *                  to i3.
index fda56dad003e524c797da9f9e9954319283deca3..277c43e7b788407013dccf69f408330e802cc1e4 100644 (file)
@@ -20,8 +20,8 @@ i3-msg/i3-msg: libi3.a $(i3_msg_OBJECTS)
 
 install-i3-msg: i3-msg/i3-msg
        echo "[i3-msg] Install"
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -m 0755 i3-msg/i3-msg $(DESTDIR)$(PREFIX)/bin/
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
+       $(INSTALL) -m 0755 i3-msg/i3-msg $(DESTDIR)$(EXEC_PREFIX)/bin/
 
 clean-i3-msg:
        echo "[i3-msg] Clean"
index 354e8af90d61b0b939cbb7d241a0ac8a53cd2ebe..6a6186d8288d6e71679742f7ee90a2b92f34260e 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * i3-msg/main.c: Utility which sends messages to a running i3-instance using
  * IPC via UNIX domain sockets.
index e98d65824c845ce3ddc3faf5d6e3617d6118fad3..aba3c09ab49223fce156f0a61cf5b83d307a5dc4 100644 (file)
@@ -20,8 +20,8 @@ i3-nagbar/i3-nagbar: libi3.a $(i3_nagbar_OBJECTS)
 
 install-i3-nagbar: i3-nagbar/i3-nagbar
        echo "[i3-nagbar] Install"
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -m 0755 i3-nagbar/i3-nagbar $(DESTDIR)$(PREFIX)/bin/
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
+       $(INSTALL) -m 0755 i3-nagbar/i3-nagbar $(DESTDIR)$(EXEC_PREFIX)/bin/
 
 clean-i3-nagbar:
        echo "[i3-nagbar] Clean"
index 83389b34b240ed7da3f8c62152f25842a30438c6..d93c6585e831b7a3b1222d0768f8ef4e29315f86 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 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 their configuration file.
index 289fd8c6980d4e8aa25cc64d9390947459846ee3..18a1a38068b7da28b9b4efd69c92da4bbb6e4a72 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 # vim:ts=4:sw=4:expandtab
 #
-# © 2013-2014 Michael Stapelberg
+# © 2013 Michael Stapelberg
 #
 # Requires perl ≥ v5.10, AnyEvent::I3 and JSON::XS
 
index 53227a8e10fbb29d0468389bc1bb1a65c2fefa99..737b0b6999db1aed5e9dbe75d95fe4515bad08bf 100644 (file)
@@ -20,8 +20,8 @@ i3bar/i3bar: libi3.a $(i3bar_OBJECTS)
 
 install-i3bar: i3bar/i3bar
        echo "[i3bar] Install"
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -m 0755 i3bar/i3bar $(DESTDIR)$(PREFIX)/bin/
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
+       $(INSTALL) -m 0755 i3bar/i3bar $(DESTDIR)$(EXEC_PREFIX)/bin/
 
 clean-i3bar:
        echo "[i3bar] Clean"
index b87cfaacacffd8d78ff8679cf71dd8fe7e32c998..873a34651a2a735248a96a549eb29fe327d52b0a 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * child.c: Getting input for the statusline
  *
index 22b9a28ac81d39e9d7a3a24cf40f2ba900839fe7..90da9388a60b128b34ed2b929df8263c17984e2c 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  */
 #pragma once
index fdc37445ab4944549742ca7c580fa4f488e51de0..aeb9f0fd1b523606b542f8f917198e6547d69c8e 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * config.c: Parses the configuration (received from i3).
  *
index a60a1ebae1603e44ae0f93847e58ebc6d4fc9f00..686c0322d31c9bd119f9df6627d44dda557df1e4 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * ipc.c: Communicating with i3
  *
index 37e8e01793d75fea581bd564f58a6155770ddaf0..828d4906a695033aad2fe8fa2132b1b5a48fbfc1 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * mode.c: Handle "mode" event and show current binding mode in the bar
  *
index 73fbf33f32caf5a9ad674a0f18ebd3e903850797..e6605e1f73da2b7892e6be88b7360c31118f94e4 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * outputs.c: Maintaining the outputs list
  *
index ef13cf78dd7564c4b686e3ad0e9d958f9f581b81..41e97de2f994ef24a754148e9f676c12446efd60 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * parse_json_header.c: Parse the JSON protocol header to determine
  *                      protocol version and features.
index 1720ec3b860d68c2f4f5e86bcc7c2ce1ec8919a6..694faa483a7ac5682812094503d888ff2362f055 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  */
 #pragma once
index ac13799851c097d08a4c638cf53eb8dda8a44933..ba08cf763b79e587d9b1f3f4cad95fec4c778592 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #pragma once
index 1b8c6c729bd813ba6afb4c26f3e6af1ff5adcea2..5ed84de86e426dc3f9f70dd318a3b4d79dbfb9c2 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * workspaces.c: Maintaining the workspace lists
  *
index bb37e7d517921066922fca075ff6b591421c7834..2e34c7760e299e2f36b74e1919cab6c67c547635 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * xcb.c: Communicating with X
  *
index 41f8880dd2b736f6c0b4fa3af41723f2aae5145e..e5ce209d1562959d47862db37a9d1025822afb96 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * child.c: Getting input for the statusline
  *
index f7abaee7dff9f9aa65abab5af1fc36a3c4c65cfb..86f66cbb07fd6758235636458ac15a50a70540bb 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * config.c: Parses the configuration (received from i3).
  *
index 15a26d7b4eb42b502fa3ca1a45d01cee90bc42d3..eb48afeaaa2f2432bee7904b52ddda6c6b30fb4b 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * ipc.c: Communicating with i3
  *
index a9a972dbe6c12a37a5893b830bf7244b5ef34bca..32425319ed3c5afc59a9516d1f434a208ad59fbf 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  */
 #include <stdio.h>
@@ -111,7 +111,7 @@ int main(int argc, char **argv) {
                 socket_path = expand_path(optarg);
                 break;
             case 'v':
-                printf("i3bar version " I3_VERSION " © 2010-2014 Axel Wagner and contributors\n");
+                printf("i3bar version " I3_VERSION " © 2010 Axel Wagner and contributors\n");
                 exit(EXIT_SUCCESS);
                 break;
             case 'b':
index 0ff8ba4f0239fd3fa70d6706e108d40a8144349d..bae08913106ed9bc11409fba4c29878647a7eeaf 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * mode.c: Handle mode event and show current binding mode in the bar
  *
index 8f5c95dc2f16d7e8ffb93b763099a8cc0b65b03e..b49ff53f6892bbb7ee69fb409c0b755d4dfbeb75 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * outputs.c: Maintaining the outputs list
  *
index f5fb84ab147befeb838296fbbfa153c99ed35bfb..1cd951065c8e379f123d08671b12c769e8468e8f 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * parse_json_header.c: Parse the JSON protocol header to determine
  *                      protocol version and features.
index e30325265bb36835b2b5bdac5f8a7a76b54d2386..773f8f546c6c07de688dd54734eb4dfd8a35877f 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * workspaces.c: Maintaining the workspace lists
  *
index 45705c078428d3a09a3fbdbf9cfa7486a6536229..11a017cf386224be3054596692a48ea1eb120b99 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * xcb.c: Communicating with X
  *
@@ -420,7 +420,7 @@ void handle_button(xcb_button_press_event_t *event) {
         int offset = walk->rect.w - statusline_width - tray_width - logical_px(sb_hoff_px);
 
         x = original_x - offset;
-        if (x >= 0) {
+        if (x >= 0 && (size_t)x < statusline_width) {
             struct status_block *block;
             int sep_offset_remainder = 0;
 
index a355d3d2b65a8e1ef08bb9a97556942a4b8c12bc..85397d59a3d8cad3d6205dc8baee4ed4cdf09e50 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * This header file includes all relevant files of i3 and the most often used
  * system header files. This reduces boilerplate (the amount of code duplicated
index b83ee03faab0c3252e49c1f625048c417b9bb96c..22ebafc345a4a38cf7a54921ef83b1157d46a63d 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * assignments.c: Assignments for specific windows (for_window).
  *
index 59dab6eddd1c1eeeff16b3b5b26d5992b137ad85..00a346db7b74fff780754c497b6bbb9b7ce17939 100644 (file)
@@ -5,13 +5,19 @@ xmacro(_NET_WM_MOVERESIZE)
 xmacro(_NET_WM_STATE_FULLSCREEN)
 xmacro(_NET_WM_STATE_DEMANDS_ATTENTION)
 xmacro(_NET_WM_STATE_MODAL)
+xmacro(_NET_WM_STATE_HIDDEN)
 xmacro(_NET_WM_STATE)
 xmacro(_NET_WM_WINDOW_TYPE)
+xmacro(_NET_WM_WINDOW_TYPE_NORMAL)
 xmacro(_NET_WM_WINDOW_TYPE_DOCK)
 xmacro(_NET_WM_WINDOW_TYPE_DIALOG)
 xmacro(_NET_WM_WINDOW_TYPE_UTILITY)
 xmacro(_NET_WM_WINDOW_TYPE_TOOLBAR)
 xmacro(_NET_WM_WINDOW_TYPE_SPLASH)
+xmacro(_NET_WM_WINDOW_TYPE_MENU)
+xmacro(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
+xmacro(_NET_WM_WINDOW_TYPE_POPUP_MENU)
+xmacro(_NET_WM_WINDOW_TYPE_TOOLTIP)
 xmacro(_NET_WM_DESKTOP)
 xmacro(_NET_WM_STRUT_PARTIAL)
 xmacro(_NET_CLIENT_LIST)
index 19345f8c82ad6c6144d8c7bbde53f849bceb86eb..75a719e9469e7d84d650440c6a2146d1a08b20a5 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2014 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * bindings.h: Functions for configuring, finding, and running bindings.
  *
@@ -24,7 +24,8 @@ const char *DEFAULT_BINDING_MODE;
  *
  */
 Binding *configure_binding(const char *bindtype, const char *modifiers, const char *input_code,
-                           const char *release, const char *whole_window, const char *command, const char *mode);
+                           const char *release, const char *border, const char *whole_window,
+                           const char *command, const char *mode);
 
 /**
  * Grab the bound keys (tell X to send us keypress events for those keycodes)
index c63672a7cce954e461ab979350091d71fe62cef2..7ce80d97abcbf50f8edb998e31ce161943c38ed3 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * click.c: Button press (mouse click) events.
  *
index 263801f63d6f125de0d90c7713ec42865326e9d2..2ffa49b011e1b47043dd75bd03a8888f2e6c7e14 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * cmdparse.y: the parser for commands you send to i3 (or bind on keys)
  *
index 0f7e3635c0964b997f7ea219b930c5359fd50124..bbcd7f6f5bb91dcbda16494c92b8aa9ae7880f65 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * commands.c: all command functions (see commands_parser.c)
  *
@@ -132,6 +132,12 @@ void cmd_mode(I3_CMD, char *mode);
  */
 void cmd_move_con_to_output(I3_CMD, char *name);
 
+/**
+ * Implementation of 'move [window|container] [to] mark <str>'.
+ *
+ */
+void cmd_move_con_to_mark(I3_CMD, char *mark);
+
 /**
  * Implementation of 'floating enable|disable|toggle'
  *
index cfa44dd5a5a03621fd04fd9f081018c297ba0b6d..1acb7faebe791f999db86166b209dfe9b80636a5 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * commands.c: all command functions (see commands_parser.c)
  *
index b025adab16e0349eef40fca2e5972d033bef57c0..4813b77673a77c59a68034aff469f9b8db2ef45d 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * con.c: Functions which deal with containers directly (creating containers,
  *        searching containers, getting specific properties from containers,
@@ -42,12 +42,19 @@ bool con_is_leaf(Con *con);
  */
 bool con_has_managed_window(Con *con);
 
-/*
+/**
  * Returns true if a container should be considered split.
  *
  */
 bool con_is_split(Con *con);
 
+/**
+ * This will only return true for containers which have some parent with
+ * a tabbed / stacked parent of which they are not the currently focused child.
+ *
+ */
+bool con_is_hidden(Con *con);
+
 /**
  * Returns true if this node has regular or floating children.
  *
@@ -126,6 +133,13 @@ Con *con_by_window_id(xcb_window_t window);
  */
 Con *con_by_frame_id(xcb_window_t frame);
 
+/**
+ * Returns the container with the given mark or NULL if no such container
+ * exists.
+ *
+ */
+Con *con_by_mark(const char *mark);
+
 /**
  * Returns the first container below 'con' which wants to swallow this window
  * TODO: priority
@@ -203,6 +217,12 @@ void con_disable_fullscreen(Con *con);
  */
 void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp);
 
+/**
+ * Moves the given container to the given mark.
+ *
+ */
+bool con_move_to_mark(Con *con, const char *mark);
+
 /**
  * Returns the orientation of the given container (for stacked containers,
  * vertical orientation is used regardless of the actual orientation of the
index fb11cbe3a743bf02b77a247968a39e297740e1b3..4cc58a459c18f2a89b366be1d82f12df357f0423 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * include/config.h: Contains all structs/variables for the configurable
  * part of i3 as well as functions handling the configuration file (calling
index f50396244db58571219c91aabe2df1ca7c79f412..019b9bcdedfc9795523b4fcf1eb53d236636c316 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * config_directives.h: all config storing functions (see config_parser.c)
  *
@@ -64,10 +64,10 @@ CFGFUN(color_single, const char *colorclass, const char *color);
 CFGFUN(floating_modifier, const char *modifiers);
 CFGFUN(new_window, const char *windowtype, const char *border, const long width);
 CFGFUN(workspace, const char *workspace, const char *output);
-CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command);
+CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *border, const char *whole_window, const char *command);
 
 CFGFUN(enter_mode, const char *mode);
-CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command);
+CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *border, const char *whole_window, const char *command);
 
 CFGFUN(bar_font, const char *font);
 CFGFUN(bar_separator_symbol, const char *separator);
index 9fc3bf2ffb5ea63e2b3e22bef34a69f9472dd9d5..28c28e4882e7f2b6fa220cfe98ca4d4b391f1819 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * config_parser.h: config parser-related definitions
  *
index 50e1f1807bfc4cf2b16459a3d154f0883024f27f..6cb6babc56d5ec0668a55799bde0a3885f2f98ea 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * include/data.h: This file defines all data structures used by i3
  *
@@ -255,6 +255,10 @@ struct Binding {
         B_UPON_KEYRELEASE_IGNORE_MODS = 2,
     } release;
 
+    /** If this is true for a mouse binding, the binding should be executed
+     * when the button is pressed over the window border. */
+    bool border;
+
     /** If this is true for a mouse binding, the binding should be executed
      * when the button is pressed over any part of the window, not just the
      * title bar (default). */
@@ -378,6 +382,9 @@ struct Window {
      * default will be 'accepts focus'. */
     bool doesnt_accept_focus;
 
+    /** The _NET_WM_WINDOW_TYPE for this window. */
+    xcb_atom_t window_type;
+
     /** Whether the window says it is a dock window */
     enum { W_NODOCK = 0,
            W_DOCK_TOP = 1,
@@ -408,6 +415,7 @@ struct Match {
     struct regex *instance;
     struct regex *mark;
     struct regex *window_role;
+    xcb_atom_t window_type;
     enum {
         U_DONTCHECK = -1,
         U_LATEST = 0,
index 3e65c35e0eb01b2c08d67d6011256181ba2f3faf..3875ec6bbdc8d482d71cfad6944858655cae4559 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * debug.c: Debugging functions, especially FormatEvent, which prints unhandled
  *          events.  This code is from xcb-util.
index 6f88ae97f18cb2610590a6712ac5954e9ce8a9ed..b1a5a0e0f3176ccaed3ef222669717164744be57 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * display_version.c: displays the running i3 version, runs as part of
  *                    i3 --moreversion.
index 3b5806285b4f66badec03fd7d2bb513601cb997d..8fb7902a7d7adc911a19a0ddf4bc903f290de207 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * ewmh.c: Get/set certain EWMH properties easily.
  *
index 75ef77ba8e71f6ea3ecc01f2dacfce1b9e5c6313..32b07fa97e30be5bf3dcaeb819ec92417a8ce558 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * Faking outputs is useful in pathological situations (like network X servers
  * which don’t support multi-monitor in a useful way) and for our testsuite.
index 8330b6ace0e8504d85b5b5c0093f946d6edc8ffc..5e7b8e31361f5873347ed98a1109ecbb960a305d 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * floating.c: Floating windows.
  *
index 82f6b982fc43474c5717e5c48748a04409e8102c..d80a24f8fdbbda1d1dc7fd98bee473cc562f3a90 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * handlers.c: Small handlers for various events (keypresses, focus changes,
  *             …).
index 70ebc0006110dfd7d301a3cecc1fbae373152679..f1912fd55eb633df71f999aa3ebe793932bee62a 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * i3.h: global variables that are used all over i3.
  *
index f1b50dec011b1e07548628e35b713013eb3d48dd..8912bf130a5daf877ccb2445821524599a581ad9 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * This public header defines the different constants and message types to use
  * for the IPC interface to i3 (see docs/ipc for more information).
index 4eed319a21e86c7a95765c96c03974e9d6c6b7c5..e1c18816715e1fccddc199a19f736ed184e1b6e2 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * ipc.c: UNIX domain socket IPC (initialization, client handling, protocol).
  *
index 86cc6836f1300402ad29a26c3cddcc62968c4ff2..bbfec83b4808d725451820e492d1896807963324 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * key_press.c: key press handler
  *
index da8c8a42377d7ec09748c648cd0f88030dcf146b..a64b3981e88df6bca1e8abc968f313c54bc37e63 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * libi3: contains functions which are used by i3 *and* accompanying tools such
  * as i3-msg, i3-config-wizard, …
index 8736a50cf46559dead850d0edb66a8e3717eab2a..f8b7da20a6f7ac58144f8cc53e0a891351a015bc 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2014 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * load_layout.c: Restore (parts of) the layout, for example after an inplace
  *                restart.
index a5086dbee5ae78fa3327017763882d3bbdac39e5..e7fc8acba1341c182078a83a9657f789d0354ef8 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * log.c: Logging functions.
  *
index 18c6e374472f6b199588b966b95580743894fa6a..1ce539540be033a0eadbf3c5fd1c00fa09311a79 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * main.c: Initialization, main loop
  *
index bd1a14f76ec4184ad559356bcf6ade3a113e80d3..b0c4238155969e206f9874c6dc41f410f04636a7 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * manage.c: Initially managing new windows (or existing ones on restart).
  *
index 09975cac20fe644162930e08ea25742e1d12644f..dbd9bb795b95975d173de9bfcc4f5745ec3f766b 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * A "match" is a data structure which acts like a mask or expression to match
  * certain windows or not. For example, when using commands, you can specify a
index 939665ec41f09b73cb2be7cce20dc598a5dfb5fe..7debcf28e397c8b06877853de7f9e9cff51ed9ba 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * move.c: Moving containers into some direction.
  *
index 6514c477fc7f5ca01b5e9e6daec629eb2877743d..e0125c06f74540d7c6ef96e4d655dd52a139ecc9 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * output.c: Output (monitor) related functions.
  *
index 43f7efe826ae26820842aa5a67fc10ea67a614cc..823ddea4e98f1be582ee2a7ca91cb9137ef762cf 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * For more information on RandR, please see the X.org RandR specification at
  * http://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt
index e11d377e453ae7d8ddb7db83ce383d62414de226..2e2f22fd45f142e87af6079f1d2d9afbb00cdaad 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * regex.c: Interface to libPCRE (perl compatible regular expressions).
  *
index 1794b513894ea0c8583ff15400e1a66f679f39db..717459e98268dd8d743134e11820f62b33c78d5e 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * render.c: Renders (determines position/sizes) the layout tree, updating the
  *           various rects. Needs to be pushed to X11 (see x.c) to be visible.
index 5c795046c5fdd27c3269c1eab3aa01555145a6d5..945678d98b6d518c31e2ab597d7e2bcc35255645 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * resize.c: Interactive resizing.
  *
index 3f0229d3d8eee7ed9216662d8c9ac5cfea335159..f952834c564939c557752e11f813effc5f32e5dc 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * restore_layout.c: Everything for restored containers that is not pure state
  *                   parsing (which can be found in load_layout.c).
index 1aca73bda56ce466932628b0a5466b363fa3a41d..b385550cdbaf144274d3e4557445e9eaa9a550e2 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * scratchpad.c: Scratchpad functions (TODO: more description)
  *
index 5af697e708ff90283585893f5a81df418666282d..231681cab591d012bef2ca9075eb206c7bb6f923 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * The format of the shmlog data structure which i3 development versions use by
  * default (ringbuffer for storing the debug log).
index 184db73bc7d7d2890668aed32eba46510f252d96..56680bc48a2aaa84e3b252517ff415c2eb7ad5ce 100644 (file)
@@ -2,8 +2,8 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
- * © 2009-2010 Jan-Erik Rediger
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Jan-Erik Rediger
  *
  * sighandler.c: Interactive crash dialog upon SIGSEGV/SIGABRT/SIGFPE (offers
  *               to restart inplace).
index cb784913b303efc859a6894750673b4a596288ee..7d5d2a39644abf350b8c3191b48a9490654bfe8c 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * startup.c: Startup notification code. Ensures a startup notification context
  *            is setup when launching applications. We store the current
index b3c2a515131eef95ef964ab94ffce7a3057ee803..af3309e9092295c4aec4d55d59308970c98d8e07 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * tree.c: Everything that primarily modifies the layout tree data structure.
  *
index 270b2f229dfef7185a02a686db162ddb72e57034..01f732caed9aab3eae9571ecfc34fb58d8921ea8 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * util.c: Utility functions, which can be useful everywhere within i3 (see
  *         also libi3).
index 480cee18844362adb707ea3a447828bca216419a..7a248277abd09cf92fa564998f07602544d066f9 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * window.c: Updates window attributes (X11 hints/properties).
  *
@@ -56,6 +56,12 @@ void window_update_strut_partial(i3Window *win, xcb_get_property_reply_t *prop);
  */
 void window_update_role(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt);
 
+/**
+ * Updates the _NET_WM_WINDOW_TYPE property.
+ *
+ */
+void window_update_type(i3Window *window, xcb_get_property_reply_t *reply);
+
 /**
  * Updates the WM_HINTS (we only care about the input focus handling part).
  *
index d0f801e0039240195496c6d3245f0ff9540e43d9..82d18919c232ff4982cc4dfd78a4d370ee4ed71e 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * workspace.c: Modifying workspaces, accessing them, moving containers to
  *              workspaces.
index 07f8a725cfb3a8e3c52eefbfd94246b28951bd6d..b6855cb328ccc67a52265b7c6dfd95fa200d0466 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * x.c: Interface to X11, transfers our in-memory state to X11 (see also
  *      render.c). Basically a big state machine.
index 9f4ea91fd8f29733ff4549ad2d8fcaa9af386ece..7dab5d100c8a39014dcc5d9f11db6588d853d3ab 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * xcb.c: Helper functions for easier usage of XCB
  *
@@ -108,6 +108,16 @@ void xcb_raise_window(xcb_connection_t *conn, xcb_window_t window);
  */
 void xcb_set_window_rect(xcb_connection_t *conn, xcb_window_t window, Rect r);
 
+/**
+ * Returns the first supported _NET_WM_WINDOW_TYPE atom.
+ *
+ */
+xcb_atom_t xcb_get_preferred_window_type(xcb_get_property_reply_t *reply);
+
+/**
+ * Returns true if the given reply contains the given data.
+ *
+ */
 bool xcb_reply_contains_atom(xcb_get_property_reply_t *prop, xcb_atom_t atom);
 
 /**
index 89c2c457887ed0d660cc6518f5a0efae405fbac9..066d834aa4b39e3cd9f78d14da385e698d19c09d 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * xcb_compat.h: uses #define to create aliases for xcb functions which got
  *               renamed. Makes the code work with >= 0.3.8 xcb-util and
index bb329e4c88ca06cfb90ed1da5c63a3d0a560fb52..e0ee98138cfb2c1855037ab03b155683f13a1368 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * xcursor.c: libXcursor support for themed cursors.
  *
index 46c2a63558ccc12715ead04d1e91d0732b94e9d6..936b9653b98ae6b3eb2b2220f24657de22505dad 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * This is LEGACY code (we support RandR, which can do much more than
  * Xinerama), but necessary for the poor users of the nVidia binary
index e8422aabd2d051294d3fedcd007b94658d0722b5..93c63d8f7b641a14da94d61eb10841454721a97a 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * yajl_utils.h
  *
index 6f58d57a409c8eaa87728513c77bbd6a745bf674..a347b08f089f47ca758d02b526fc8a2d5c88b905 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2014 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include "libi3.h"
index 2c0f5771c1a9db75b5eb40027929c68f47fe58d3..225577a44017157d001323b29d9fb77b0329f535 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <stdlib.h>
index 847bc61beb30c2d474ef4ee5c96639305f4e91e3..0f30e74eb517a4cf2d2253671984fa57d952d9e6 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <assert.h>
index b093594e10484d74677752756798062b5178719b..44ad295d5fc48378a3651dba78bfaea3949f5780 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <stdlib.h>
index 8b6eeb7cff21bdb19cacb12064cb03b2c007b441..bad75c4dd87d4d6f245fc0f3d243589983c18110 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2015 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include "libi3.h"
index cf8cbe3863654c150a0b74800e3fcbd1f71e9d14..3b6976ad6b0d1669149fed67533aa53d1b1d4b7c 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <stdint.h>
index 941d4439e75177161b09d3fdca06597a6aa8c24c..a3dee9cd3ef84dddae60ac6d44cd2494ea3a4a93 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <assert.h>
index d11722f000ec54fbebc6d34b8a52d0d2c8ac98c6..ccf266db641aa673276e83b785b331d9c7f4525c 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include "libi3.h"
index 69629daa6a657b6d98abcf58824935d0dc1264fa..f493b4f11e6a6d118951afc058b9632c6621cd5b 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <sys/types.h>
index cb4edd6732b956f91e24c1738b796d5263a47c97..0ef4fced4f27b1fd1bf415727efb6f1bbdd14796 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <string.h>
index 80709ed3b255c638933e0644841accecc7eb4318..a9ba31653e07cacc1b86ed030075eccccc509a52 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <string.h>
index a4e82873151199a8f89378607f485a3910dfec48..3a56cbea853495a56a6646d3e13a6ecc52fcb167 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2015 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 
index f70c31a78fd5c7fed10a3ff556e8dc1a6cc9b90e..df54ef093c5cd2c34ce417ee0ed7cfbb6f577d4d 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <stdio.h>
index db9b6b4a42efbf287e06466295ad0e2d2e30e2e5..74460f37662360f75153048c1c0b0298327b5c74 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <string.h>
index e6297f9eed89b0282a2b104fab360921eb723b07..28575e1fb6bcaa2b4eb1625e0dff2456be8cf269 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * string.c: Define an i3String type to automagically handle UTF-8/UCS-2
  *           conversions. Some font backends need UCS-2 (X core fonts),
index eec1a0edcfd9527bc39445e6a21c1acb8a8c1222..c4032dc5816130b01dd1689b819a7914219fc1fa 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <sys/types.h>
index 9a8c478f0c7213d3f1c19ba4c370623e5015e389..3a7d0194d45f5430ea4d783a897126f8e5f6f0eb 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
 #include <err.h>
index 9a04b75c92180b07ba3920b54f22ab47b86c0b5b..9fbce99157e3087c7aa87b3e08c25959b27b1846 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.1</refmiscinfo>
+<refmiscinfo class="version">4.10.2</refmiscinfo>
 <refmiscinfo class="manual">i3 Manual</refmiscinfo>
 </refmeta>
 <refnamediv>
index 87db6cf082cebfeb04e430cc5a31ba1fe19370e4..1cd8d2f6789686dda558edb5f102e4ff3140bffd 100644 (file)
@@ -1,7 +1,7 @@
 # vim:ts=2:sw=2:expandtab
 #
 # i3 - an improved dynamic tiling window manager
-# © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+# © 2009 Michael Stapelberg and contributors (see also: LICENSE)
 #
 # parser-specs/commands.spec: Specification file for generate-command-parser.pl
 # which will generate the appropriate header files for our C parser.
@@ -41,14 +41,15 @@ state INITIAL:
   'bar' -> BAR
 
 state CRITERIA:
-  ctype = 'class' -> CRITERION
-  ctype = 'instance' -> CRITERION
+  ctype = 'class'       -> CRITERION
+  ctype = 'instance'    -> CRITERION
   ctype = 'window_role' -> CRITERION
-  ctype = 'con_id' -> CRITERION
-  ctype = 'id' -> CRITERION
-  ctype = 'con_mark' -> CRITERION
-  ctype = 'title' -> CRITERION
-  ctype = 'urgent' -> CRITERION
+  ctype = 'con_id'      -> CRITERION
+  ctype = 'id'          -> CRITERION
+  ctype = 'window_type' -> CRITERION
+  ctype = 'con_mark'    -> CRITERION
+  ctype = 'title'       -> CRITERION
+  ctype = 'urgent'      -> CRITERION
   ']' -> call cmd_criteria_match_windows(); INITIAL
 
 state CRITERION:
@@ -265,6 +266,7 @@ state RENAME_WORKSPACE_NEW_NAME:
 # move <direction> [<pixels> [px]]
 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
 # move [window|container] [to] output <str>
+# move [window|container] [to] mark <str>
 # move [window|container] [to] scratchpad
 # move workspace to [output] <str>
 # move scratchpad
@@ -280,6 +282,8 @@ state MOVE:
       -> MOVE_WORKSPACE
   'output'
       -> MOVE_TO_OUTPUT
+  'mark'
+      -> MOVE_TO_MARK
   'scratchpad'
       -> call cmd_move_scratchpad()
   direction = 'left', 'right', 'up', 'down'
@@ -321,6 +325,10 @@ state MOVE_TO_OUTPUT:
   output = string
       -> call cmd_move_con_to_output($output)
 
+state MOVE_TO_MARK:
+  mark = string
+      -> call cmd_move_con_to_mark($mark)
+
 state MOVE_WORKSPACE_TO_OUTPUT:
   'output'
       ->
index d27e0792127a6f78b863995941994cf66523439b..422efe485947c23fb30d20598fe8a1a53de80467 100644 (file)
@@ -1,7 +1,7 @@
 # vim:ts=2:sw=2:expandtab
 #
 # i3 - an improved dynamic tiling window manager
-# © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+# © 2009 Michael Stapelberg and contributors (see also: LICENSE)
 #
 # parser-specs/config.spec: Specification file for generate-command-parser.pl
 # which will generate the appropriate header files for our C parser.
@@ -167,6 +167,7 @@ state CRITERIA:
   ctype = 'window_role' -> CRITERION
   ctype = 'con_id'      -> CRITERION
   ctype = 'id'          -> CRITERION
+  ctype = 'window_type' -> CRITERION
   ctype = 'con_mark'    -> CRITERION
   ctype = 'title'       -> CRITERION
   ctype = 'urgent'      -> CRITERION
@@ -300,6 +301,8 @@ state FONT:
 state BINDING:
   release = '--release'
       ->
+  border = '--border'
+      ->
   whole_window = '--whole-window'
       ->
   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
@@ -312,10 +315,12 @@ state BINDING:
 state BINDCOMMAND:
   release = '--release'
       ->
+  border = '--border'
+      ->
   whole_window = '--whole-window'
       ->
   command = string
-      -> call cfg_binding($bindtype, $modifiers, $key, $release, $whole_window, $command)
+      -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command)
 
 ################################################################################
 # Mode configuration
@@ -349,6 +354,8 @@ state MODE_IGNORE_LINE:
 state MODE_BINDING:
   release = '--release'
       ->
+  border = '--border'
+      ->
   whole_window = '--whole-window'
       ->
   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
@@ -361,10 +368,12 @@ state MODE_BINDING:
 state MODE_BINDCOMMAND:
   release = '--release'
       ->
+  border = '--border'
+      ->
   whole_window = '--whole-window'
       ->
   command = string
-      -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $whole_window, $command); MODE
+      -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $command); MODE
 
 ################################################################################
 # Bar configuration (i3bar)
index 631ff42561f7b527ee80ec659787263c9669ebc6..4dd027779ed03541710a0e3e055f929d23b7d827 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/zsh
 # This script is used to prepare a new release of i3.
 
-export RELEASE_VERSION="4.10.1"
-export PREVIOUS_VERSION="4.10"
-export RELEASE_BRANCH="next"
+export RELEASE_VERSION="4.10.2"
+export PREVIOUS_VERSION="4.10.1"
+export RELEASE_BRANCH="master"
 
 if [ ! -e "../i3.github.io" ]
 then
@@ -135,6 +135,10 @@ debsign -k4AC8EE1D ${TMPDIR}/debian/*.changes
 # Section 3: website
 ################################################################################
 
+# Ensure we are in the correct branch for copying the docs.
+cd ${TMPDIR}/i3
+git checkout ${RELEASE_BRANCH}
+
 cd ${TMPDIR}
 git clone --quiet ${STARTDIR}/../i3.github.io
 cd i3.github.io
@@ -143,6 +147,7 @@ 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,Verify you are using i3 ≥ .*,Verify you are using i3 ≥ ${RELEASE_VERSION},g" docs/debugging.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
@@ -172,6 +177,7 @@ git commit -a -m "update docs for ${RELEASE_VERSION}"
 
 git remote remove origin
 git remote add origin git@github.com:i3/i3.github.io.git
+git config --add remote.origin.push "+refs/heads/master:refs/heads/master"
 
 ################################################################################
 # Section 4: prepare release announcement email
@@ -182,12 +188,14 @@ cat >email.txt <<EOT
 From: Michael Stapelberg <michael@i3wm.org>
 To: i3-announce@i3.zekjur.net
 Subject: i3 v${RELEASE_VERSION} released
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
 
 Hi,
 
 I just released i3 v${RELEASE_VERSION}. Release notes follow:
 EOT
-cat ${TMPDIR}/i3/RELEASE-NOTES-${RELEASE_VERSION}.txt >>email.txt
+cat ${TMPDIR}/i3/RELEASE-NOTES-${RELEASE_VERSION} >>email.txt
 
 ################################################################################
 # Section 5: final push instructions
@@ -199,6 +207,7 @@ echo "When satisfied, run:"
 echo "  cd ${TMPDIR}/i3"
 echo "  git checkout next"
 echo "  vi debian/changelog"
+echo "  git commit -a -m \"debian: update changelog\""
 echo "  git push"
 echo ""
 echo "  cd ${TMPDIR}/i3.github.io"
@@ -208,7 +217,7 @@ echo "  cd ${TMPDIR}/debian"
 echo "  dput *.changes"
 echo ""
 echo "  cd ${TMPDIR}"
-echo "  sendmail < email.txt"
+echo "  sendmail -t < email.txt"
 echo ""
 echo "Announce on:"
 echo "  twitter"
index 96834f648539d4bcb06c1778a4b6be65117845f4..babe890e9250c439419b45278405d9d6e0a8ed93 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * assignments.c: Assignments for specific windows (for_window).
  *
index cbac2dfd96dfd0f3826dcb669ab9b5400fb720f1..5815908c46ece42c3ba524d71e8210f274fc3ac4 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2014 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * bindings.c: Functions for configuring, finding and, running bindings.
  */
@@ -49,10 +49,12 @@ static struct Mode *mode_from_name(const char *name) {
  *
  */
 Binding *configure_binding(const char *bindtype, const char *modifiers, const char *input_code,
-                           const char *release, const char *whole_window, const char *command, const char *modename) {
+                           const char *release, const char *border, const char *whole_window,
+                           const char *command, const char *modename) {
     Binding *new_binding = scalloc(sizeof(Binding));
     DLOG("bindtype %s, modifiers %s, input code %s, release %s\n", bindtype, modifiers, input_code, release);
     new_binding->release = (release != NULL ? B_UPON_KEYRELEASE : B_UPON_KEYPRESS);
+    new_binding->border = (border != NULL);
     new_binding->whole_window = (whole_window != NULL);
     if (strcmp(bindtype, "bindsym") == 0) {
         new_binding->input_type = (strncasecmp(input_code, "button", (sizeof("button") - 1)) == 0
@@ -429,7 +431,7 @@ CommandResult *run_binding(Binding *bind, Con *con) {
     if (con == NULL)
         command = sstrdup(bind->command);
     else
-        sasprintf(&command, "[con_id=\"%d\"] %s", con, bind->command);
+        sasprintf(&command, "[con_id=\"%p\"] %s", con, bind->command);
 
     Binding *bind_cp = binding_copy(bind);
     CommandResult *result = parse_command(command, NULL);
index 3cd367cc725ee8b439cde59b35f4829a92892ad8..690bd1f8aca2525b383654cd5b40cee37e7f6be2 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * click.c: Button press (mouse click) events.
  *
@@ -185,12 +185,13 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod
 
     /* if the user has bound an action to this click, it should override the
      * default behavior. */
-    if (dest == CLICK_DECORATION || dest == CLICK_INSIDE) {
+    if (dest == CLICK_DECORATION || dest == CLICK_INSIDE || dest == CLICK_BORDER) {
         Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event);
         /* clicks over a window decoration will always trigger the binding and
          * clicks on the inside of the window will only trigger a binding if
          * the --whole-window flag was given for the binding. */
-        if (bind && (dest == CLICK_DECORATION || bind->whole_window)) {
+        if (bind && ((dest == CLICK_DECORATION || bind->whole_window) ||
+                     (dest == CLICK_BORDER && bind->border))) {
             CommandResult *result = run_binding(bind, con);
 
             /* ASYNC_POINTER eats the event */
index 79071d6bb5f451dbae214fcb6fd2a53dbde7813f..3263dd0394b0d73216151f454e31bbb214f6bb22 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * commands.c: all command functions (see commands_parser.c)
  *
@@ -363,6 +363,31 @@ void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue) {
         return;
     }
 
+    if (strcmp(ctype, "window_type") == 0) {
+        if (strcasecmp(cvalue, "normal") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_NORMAL;
+        else if (strcasecmp(cvalue, "dialog") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_DIALOG;
+        else if (strcasecmp(cvalue, "utility") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_UTILITY;
+        else if (strcasecmp(cvalue, "toolbar") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_TOOLBAR;
+        else if (strcasecmp(cvalue, "splash") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_SPLASH;
+        else if (strcasecmp(cvalue, "menu") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_MENU;
+        else if (strcasecmp(cvalue, "dropdown_menu") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
+        else if (strcasecmp(cvalue, "popup_menu") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_POPUP_MENU;
+        else if (strcasecmp(cvalue, "tooltip") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_TOOLTIP;
+        else
+            ELOG("unknown window_type value \"%s\"\n", cvalue);
+
+        return;
+    }
+
     if (strcmp(ctype, "con_mark") == 0) {
         current_match->mark = regex_new(cvalue);
         return;
@@ -1100,12 +1125,10 @@ void cmd_unmark(I3_CMD, char *mark) {
         }
         DLOG("removed all window marks");
     } else {
-        Con *con;
-        TAILQ_FOREACH(con, &all_cons, all_cons) {
-            if (con->mark && strcmp(con->mark, mark) == 0) {
-                FREE(con->mark);
-                con->mark_changed = true;
-            }
+        Con *con = con_by_mark(mark);
+        if (con != NULL) {
+            FREE(con->mark);
+            con->mark_changed = true;
         }
         DLOG("removed window mark %s\n", mark);
     }
@@ -1169,6 +1192,26 @@ void cmd_move_con_to_output(I3_CMD, char *name) {
     ysuccess(true);
 }
 
+/*
+ * Implementation of 'move [container|window] [to] mark <str>'.
+ *
+ */
+void cmd_move_con_to_mark(I3_CMD, char *mark) {
+    DLOG("moving window to mark \"%s\"\n", mark);
+
+    HANDLE_EMPTY_MATCH;
+
+    bool result = true;
+    owindow *current;
+    TAILQ_FOREACH(current, &owindows, owindows) {
+        DLOG("moving matched window %p / %s to mark \"%s\"\n", current->con, current->con->name, mark);
+        result &= con_move_to_mark(current->con, mark);
+    }
+
+    cmd_output->needs_tree_render = true;
+    ysuccess(result);
+}
+
 /*
  * Implementation of 'floating enable|disable|toggle'
  *
index fa4c2360101513e4796490c9720ff9b63533915f..9ae75abea21ff28a1fb53501ece991a2037e46d8 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * commands_parser.c: hand-written parser to parse commands (commands are what
  * you bind on keys and what you can send to i3 using the IPC interface, like
index dab8d29d439a36e56c21587819e03de0dfaaba99..05f608bd0e9299ce7e6e7adc7ae0af4581c1351f 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * con.c: Functions which deal with containers directly (creating containers,
  *        searching containers, getting specific properties from containers,
@@ -70,20 +70,10 @@ Con *con_new(Con *parent, i3Window *window) {
     return new;
 }
 
-/*
- * Attaches the given container to the given parent. This happens when moving
- * a container or when inserting a new container at a specific place in the
- * tree.
- *
- * ignore_focus is to just insert the Con at the end (useful when creating a
- * new split container *around* some containers, that is, detaching and
- * attaching them in order without wanting to mess with the focus in between).
- *
- */
-void con_attach(Con *con, Con *parent, bool ignore_focus) {
+static void _con_attach(Con *con, Con *parent, Con *previous, bool ignore_focus) {
     con->parent = parent;
     Con *loop;
-    Con *current = NULL;
+    Con *current = previous;
     struct nodes_head *nodes_head = &(parent->nodes_head);
     struct focus_head *focus_head = &(parent->focus_head);
 
@@ -155,8 +145,7 @@ void con_attach(Con *con, Con *parent, bool ignore_focus) {
         /* Insert the container after the tiling container, if found.
          * When adding to a CT_OUTPUT, just append one after another. */
         if (current && parent->type != CT_OUTPUT) {
-            DLOG("Inserting con = %p after last focused tiling con %p\n",
-                 con, current);
+            DLOG("Inserting con = %p after con %p\n", con, current);
             TAILQ_INSERT_AFTER(nodes_head, current, con, nodes);
         } else
             TAILQ_INSERT_TAIL(nodes_head, con, nodes);
@@ -170,6 +159,20 @@ add_to_focus_head:
     con_force_split_parents_redraw(con);
 }
 
+/*
+ * Attaches the given container to the given parent. This happens when moving
+ * a container or when inserting a new container at a specific place in the
+ * tree.
+ *
+ * ignore_focus is to just insert the Con at the end (useful when creating a
+ * new split container *around* some containers, that is, detaching and
+ * attaching them in order without wanting to mess with the focus in between).
+ *
+ */
+void con_attach(Con *con, Con *parent, bool ignore_focus) {
+    _con_attach(con, parent, NULL, ignore_focus);
+}
+
 /*
  * Detaches the given container from its current parent
  *
@@ -257,6 +260,29 @@ bool con_is_split(Con *con) {
     }
 }
 
+/*
+ * This will only return true for containers which have some parent with
+ * a tabbed / stacked parent of which they are not the currently focused child.
+ *
+ */
+bool con_is_hidden(Con *con) {
+    Con *current = con;
+
+    /* ascend to the workspace level and memorize the highest-up container
+     * which is stacked or tabbed. */
+    while (current != NULL && current->type != CT_WORKSPACE) {
+        Con *parent = current->parent;
+        if (parent != NULL && (parent->layout == L_TABBED || parent->layout == L_STACKED)) {
+            if (TAILQ_FIRST(&(parent->focus_head)) != current)
+                return true;
+        }
+
+        current = parent;
+    }
+
+    return false;
+}
+
 /*
  * Returns true if this node accepts a window (if the node swallows windows,
  * it might already have swallowed enough and cannot hold any more).
@@ -460,6 +486,21 @@ Con *con_by_frame_id(xcb_window_t frame) {
     return NULL;
 }
 
+/*
+ * Returns the container with the given mark or NULL if no such container
+ * exists.
+ *
+ */
+Con *con_by_mark(const char *mark) {
+    Con *con;
+    TAILQ_FOREACH(con, &all_cons, all_cons) {
+        if (con->mark != NULL && strcmp(con->mark, mark) == 0)
+            return con;
+    }
+
+    return NULL;
+}
+
 /*
  * Returns the first container below 'con' which wants to swallow this window
  * TODO: priority
@@ -682,28 +723,14 @@ void con_disable_fullscreen(Con *con) {
     con_set_fullscreen_mode(con, CF_NONE);
 }
 
-/*
- * Moves the given container to the currently focused container on the given
- * workspace.
- *
- * The fix_coordinates flag will translate the current coordinates (offset from
- * the monitor position basically) to appropriate coordinates on the
- * destination workspace.
- * Not enabling this behaviour comes in handy when this function gets called by
- * floating_maybe_reassign_ws, which will only "move" a floating window when it
- * *already* changed its coordinates to a different output.
- *
- * The dont_warp flag disables pointer warping and will be set when this
- * function is called while dragging a floating window.
- *
- * TODO: is there a better place for this function?
- *
- */
-void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp) {
+static bool _con_move_to_con(Con *con, Con *target, bool behind_focused, bool fix_coordinates, bool dont_warp) {
+    Con *orig_target = target;
+
     /* Prevent moving if this would violate the fullscreen focus restrictions. */
-    if (!con_fullscreen_permits_focusing(workspace)) {
+    Con *target_ws = con_get_workspace(target);
+    if (!con_fullscreen_permits_focusing(target_ws)) {
         LOG("Cannot move out of a fullscreen container");
-        return;
+        return false;
     }
 
     if (con_is_floating(con)) {
@@ -712,27 +739,23 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
     }
 
     Con *source_ws = con_get_workspace(con);
-    if (workspace == source_ws) {
-        DLOG("Not moving, already there\n");
-        return;
-    }
 
     if (con->type == CT_WORKSPACE) {
         /* Re-parent all of the old workspace's floating windows. */
         Con *child;
         while (!TAILQ_EMPTY(&(source_ws->floating_head))) {
             child = TAILQ_FIRST(&(source_ws->floating_head));
-            con_move_to_workspace(child, workspace, true, true);
+            con_move_to_workspace(child, target_ws, true, true);
         }
 
         /* If there are no non-floating children, ignore the workspace. */
         if (con_is_leaf(con))
-            return;
+            return false;
 
         con = workspace_encapsulate(con);
         if (con == NULL) {
             ELOG("Workspace failed to move its contents into a container!\n");
-            return;
+            return false;
         }
     }
 
@@ -744,34 +767,31 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
     Con *current_ws = con_get_workspace(focused);
 
     Con *source_output = con_get_output(con),
-        *dest_output = con_get_output(workspace);
+        *dest_output = con_get_output(target_ws);
 
     /* 1: save the container which is going to be focused after the current
      * container is moved away */
     Con *focus_next = con_next_focused(con);
 
-    /* 2: get the focused container of this workspace */
-    Con *next = con_descend_focused(workspace);
-
-    /* 3: we go up one level, but only when next is a normal container */
-    if (next->type != CT_WORKSPACE) {
-        DLOG("next originally = %p / %s / type %d\n", next, next->name, next->type);
-        next = next->parent;
+    /* 2: we go up one level, but only when target is a normal container */
+    if (target->type != CT_WORKSPACE) {
+        DLOG("target originally = %p / %s / type %d\n", target, target->name, target->type);
+        target = target->parent;
     }
 
-    /* 4: if the target container is floating, we get the workspace instead.
+    /* 3: if the target container is floating, we get the workspace instead.
      * Only tiling windows need to get inserted next to the current container.
      * */
-    Con *floatingcon = con_inside_floating(next);
+    Con *floatingcon = con_inside_floating(target);
     if (floatingcon != NULL) {
         DLOG("floatingcon, going up even further\n");
-        next = floatingcon->parent;
+        target = floatingcon->parent;
     }
 
     if (con->type == CT_FLOATING_CON) {
-        Con *ws = con_get_workspace(next);
+        Con *ws = con_get_workspace(target);
         DLOG("This is a floating window, using workspace %p / %s\n", ws, ws->name);
-        next = ws;
+        target = ws;
     }
 
     if (source_output != dest_output) {
@@ -785,8 +805,8 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
         /* If moving to a visible workspace, call show so it can be considered
          * focused. Must do before attaching because workspace_show checks to see
          * if focused container is in its area. */
-        if (workspace_is_visible(workspace)) {
-            workspace_show(workspace);
+        if (workspace_is_visible(target_ws)) {
+            workspace_show(target_ws);
 
             /* Don’t warp if told so (when dragging floating windows with the
              * mouse for example) */
@@ -799,29 +819,29 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
 
     /* If moving a fullscreen container and the destination already has a
      * fullscreen window on it, un-fullscreen the target's fullscreen con. */
-    Con *fullscreen = con_get_fullscreen_con(workspace, CF_OUTPUT);
+    Con *fullscreen = con_get_fullscreen_con(target_ws, CF_OUTPUT);
     if (con->fullscreen_mode != CF_NONE && fullscreen != NULL) {
         con_toggle_fullscreen(fullscreen, CF_OUTPUT);
         fullscreen = NULL;
     }
 
-    DLOG("Re-attaching container to %p / %s\n", next, next->name);
-    /* 5: re-attach the con to the parent of this focused container */
+    DLOG("Re-attaching container to %p / %s\n", target, target->name);
+    /* 4: re-attach the con to the parent of this focused container */
     Con *parent = con->parent;
     con_detach(con);
-    con_attach(con, next, false);
+    _con_attach(con, target, behind_focused ? NULL : orig_target, !behind_focused);
 
-    /* 6: fix the percentages */
+    /* 5: fix the percentages */
     con_fix_percent(parent);
     con->percent = 0.0;
-    con_fix_percent(next);
+    con_fix_percent(target);
 
-    /* 7: focus the con on the target workspace, but only within that
+    /* 6: focus the con on the target workspace, but only within that
      * workspace, that is, don’t move focus away if the target workspace is
      * invisible.
      * We don’t focus the con for i3 pseudo workspaces like __i3_scratch and
      * we don’t focus when there is a fullscreen con on that workspace. */
-    if (!con_is_internal(workspace) && !fullscreen) {
+    if (!con_is_internal(target_ws) && !fullscreen) {
         /* We need to save the focused workspace on the output in case the
          * new workspace is hidden and it's necessary to immediately switch
          * back to the originally-focused workspace. */
@@ -833,7 +853,7 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
             con_focus(old_focus);
     }
 
-    /* 8: when moving to another workspace, we leave the focus on the current
+    /* 7: when moving to another workspace, we leave the focus on the current
      * workspace. (see also #809) */
 
     /* Descend focus stack in case focus_next is a workspace which can
@@ -846,7 +866,7 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
     if (source_ws == current_ws)
         con_focus(con_descend_focused(focus_next));
 
-    /* 9. If anything within the container is associated with a startup sequence,
+    /* 8. If anything within the container is associated with a startup sequence,
      * delete it so child windows won't be created on the old workspace. */
     struct Startup_Sequence *sequence;
     xcb_get_property_cookie_t cookie;
@@ -880,13 +900,78 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
 
     CALL(parent, on_remove_child);
 
-    /* 10. If the container was marked urgent, move the urgency hint. */
+    /* 9. If the container was marked urgent, move the urgency hint. */
     if (urgent) {
         workspace_update_urgent_flag(source_ws);
         con_set_urgency(con, true);
     }
 
     ipc_send_window_event("move", con);
+    return true;
+}
+
+/*
+ * Moves the given container to the given mark.
+ *
+ */
+bool con_move_to_mark(Con *con, const char *mark) {
+    Con *target = con_by_mark(mark);
+    if (target == NULL) {
+        DLOG("found no container with mark \"%s\"\n", mark);
+        return false;
+    }
+
+    /* For floating target containers, we just send the window to the same workspace. */
+    if (con_is_floating(target)) {
+        DLOG("target container is floating, moving container to target's workspace.\n");
+        con_move_to_workspace(con, con_get_workspace(target), true, false);
+        return true;
+    }
+
+    /* For split containers, we use the currently focused container within it.
+     * This allows setting marks on, e.g., tabbed containers which will move
+     * con to a new tab behind the focused tab. */
+    if (con_is_split(target)) {
+        DLOG("target is a split container, descending to the currently focused child.\n");
+        target = TAILQ_FIRST(&(target->focus_head));
+    }
+
+    if (con == target) {
+        DLOG("cannot move the container to itself, aborting.\n");
+        return false;
+    }
+
+    return _con_move_to_con(con, target, false, true, false);
+}
+
+/*
+ * Moves the given container to the currently focused container on the given
+ * workspace.
+ *
+ * The fix_coordinates flag will translate the current coordinates (offset from
+ * the monitor position basically) to appropriate coordinates on the
+ * destination workspace.
+ * Not enabling this behaviour comes in handy when this function gets called by
+ * floating_maybe_reassign_ws, which will only "move" a floating window when it
+ * *already* changed its coordinates to a different output.
+ *
+ * The dont_warp flag disables pointer warping and will be set when this
+ * function is called while dragging a floating window.
+ *
+ * TODO: is there a better place for this function?
+ *
+ */
+void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp) {
+    assert(workspace->type == CT_WORKSPACE);
+
+    Con *source_ws = con_get_workspace(con);
+    if (workspace == source_ws) {
+        DLOG("Not moving, already there\n");
+        return;
+    }
+
+    Con *target = con_descend_focused(workspace);
+    _con_move_to_con(con, target, true, fix_coordinates, dont_warp);
 }
 
 /*
index 8a1cb99c168e1934bc28063d641ded33d47b47b3..6eb67a121fe6f377469674ed0db3ed58340fbf40 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * config.c: Configuration file (calling the parser (src/config_parser.c) with
  *           the correct path, switching key bindings mode).
index 398e53bb7c8cb9c7186f2050ba80b6686708e76b..ff1c280e4f6d7fac4adb51c70510b6d5722694a8 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * config_directives.c: all config storing functions (see config_parser.c)
  *
@@ -89,6 +89,31 @@ CFGFUN(criteria_add, const char *ctype, const char *cvalue) {
         return;
     }
 
+    if (strcmp(ctype, "window_type") == 0) {
+        if (strcasecmp(cvalue, "normal") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_NORMAL;
+        else if (strcasecmp(cvalue, "dialog") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_DIALOG;
+        else if (strcasecmp(cvalue, "utility") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_UTILITY;
+        else if (strcasecmp(cvalue, "toolbar") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_TOOLBAR;
+        else if (strcasecmp(cvalue, "splash") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_SPLASH;
+        else if (strcasecmp(cvalue, "menu") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_MENU;
+        else if (strcasecmp(cvalue, "dropdown_menu") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
+        else if (strcasecmp(cvalue, "popup_menu") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_POPUP_MENU;
+        else if (strcasecmp(cvalue, "tooltip") == 0)
+            current_match->window_type = A__NET_WM_WINDOW_TYPE_TOOLTIP;
+        else
+            ELOG("unknown window_type value \"%s\"\n", cvalue);
+
+        return;
+    }
+
     if (strcmp(ctype, "con_mark") == 0) {
         current_match->mark = regex_new(cvalue);
         return;
@@ -171,8 +196,8 @@ CFGFUN(font, const char *font) {
     font_pattern = sstrdup(font);
 }
 
-CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command) {
-    configure_binding(bindtype, modifiers, key, release, whole_window, command, DEFAULT_BINDING_MODE);
+CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *border, const char *whole_window, const char *command) {
+    configure_binding(bindtype, modifiers, key, release, border, whole_window, command, DEFAULT_BINDING_MODE);
 }
 
 /*******************************************************************************
@@ -181,8 +206,8 @@ CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, co
 
 static char *current_mode;
 
-CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command) {
-    configure_binding(bindtype, modifiers, key, release, whole_window, command, current_mode);
+CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *border, const char *whole_window, const char *command) {
+    configure_binding(bindtype, modifiers, key, release, border, whole_window, command, current_mode);
 }
 
 CFGFUN(enter_mode, const char *modename) {
index f325481275b7f07d09e4dbf02ffbc3d8ade03a63..a9baef2710bc386f98fe4c0004e4649ff82db16d 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * config_parser.c: hand-written parser to parse configuration directives.
  *
index f3bc106de210681639a1125ba42634e52409e11a..bb880b2f52e1ff67b7fe6c4e82510c51afdb6c75 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * debug.c: Debugging functions, especially FormatEvent, which prints unhandled
  *          events.  This code is from xcb-util.
index a539dad366adf3b447ccb61f817cfdf08cf35abc..6ece3f742dde32f9916b66a061661fee0e86b6d5 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * display_version.c: displays the running i3 version, runs as part of
  *                    i3 --moreversion.
index 844a0db921ada15d78cea84818ef82b282da19ac..a1d2489ee60d93aef759dcf00343c4cc4446ea31 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * ewmh.c: Get/set certain EWMH properties easily.
  *
@@ -234,6 +234,6 @@ void ewmh_setup_hints(void) {
     /* I’m not entirely sure if we need to keep _NET_WM_NAME on root. */
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3");
 
-    /* only send the first 24 atoms (last one is _NET_CLOSE_WINDOW) increment that number when adding supported atoms */
-    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTED, XCB_ATOM_ATOM, 32, 24, supported_atoms);
+    /* only send the first 30 atoms (last one is _NET_CLOSE_WINDOW) increment that number when adding supported atoms */
+    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTED, XCB_ATOM_ATOM, 32, 30, supported_atoms);
 }
index 4f2740992b9540639b0fd5009a1a95382487129e..b4f92cd404f78f4048ee0ad789e4100c84983f30 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * Faking outputs is useful in pathological situations (like network X servers
  * which don’t support multi-monitor in a useful way) and for our testsuite.
index d01cb43dfec887257d5e842e477583ba1e572513..f5641fffa3b81941e2da4ce5e043f8529ba535e8 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * floating.c: Floating windows.
  *
index c80c279efe43857b83e9a4e4246e72f3681dc5cb..e7dde581d08e2e73ae7338edee86ab39704dfd02 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * handlers.c: Small handlers for various events (keypresses, focus changes,
  *             …).
@@ -880,7 +880,7 @@ static void handle_client_message(xcb_client_message_event_t *event) {
                 floating_drag_window(con->parent, &fake);
                 break;
             case _NET_WM_MOVERESIZE_SIZE_TOPLEFT... _NET_WM_MOVERESIZE_SIZE_LEFT:
-                floating_resize_window(con->parent, FALSE, &fake);
+                floating_resize_window(con->parent, false, &fake);
                 break;
             default:
                 DLOG("_NET_WM_MOVERESIZE direction %d not implemented\n", direction);
@@ -892,15 +892,15 @@ static void handle_client_message(xcb_client_message_event_t *event) {
     }
 }
 
-#if 0
-int handle_window_type(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window,
-                        xcb_atom_t atom, xcb_get_property_reply_t *property) {
-        /* TODO: Implement this one. To do this, implement a little test program which sleep(1)s
-         before changing this property. */
-        ELOG("_NET_WM_WINDOW_TYPE changed, this is not yet implemented.\n");
-        return 0;
+bool handle_window_type(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window,
+                        xcb_atom_t atom, xcb_get_property_reply_t *reply) {
+    Con *con;
+    if ((con = con_by_window_id(window)) == NULL || con->window == NULL)
+        return false;
+
+    window_update_type(con->window, reply);
+    return true;
 }
-#endif
 
 /*
  * Handles the size hints set by a window, but currently only the part necessary for displaying
@@ -1264,7 +1264,8 @@ static struct property_handler_t property_handlers[] = {
     {0, UINT_MAX, handle_transient_for},
     {0, 128, handle_windowrole_change},
     {0, 128, handle_class_change},
-    {0, UINT_MAX, handle_strut_partial_change}};
+    {0, UINT_MAX, handle_strut_partial_change},
+    {0, UINT_MAX, handle_window_type}};
 #define NUM_HANDLERS (sizeof(property_handlers) / sizeof(struct property_handler_t))
 
 /*
@@ -1284,6 +1285,7 @@ void property_handlers_init(void) {
     property_handlers[6].atom = A_WM_WINDOW_ROLE;
     property_handlers[7].atom = XCB_ATOM_WM_CLASS;
     property_handlers[8].atom = A__NET_WM_STRUT_PARTIAL;
+    property_handlers[9].atom = A__NET_WM_WINDOW_TYPE;
 }
 
 static void property_notify(uint8_t state, xcb_window_t window, xcb_atom_t atom) {
index cfa9fd16834d65fae62dc5238d707aaf0d7e983c..76c1da899ce7610489a28eefe98446010eb3cd1c 100644 (file)
--- a/src/i3.mk
+++ b/src/i3.mk
@@ -74,25 +74,25 @@ i3: libi3.a $(i3_OBJECTS)
 
 install-i3: i3
        echo "[i3] Install"
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
        $(INSTALL) -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/i3
-       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/include/i3
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/include/i3
        $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions
        $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/applications
-       $(INSTALL) -m 0755 i3 $(DESTDIR)$(PREFIX)/bin/
-       $(LN) -sf i3 $(DESTDIR)$(PREFIX)/bin/i3-with-shmlog
-       $(INSTALL) -m 0755 i3-migrate-config-to-v4 $(DESTDIR)$(PREFIX)/bin/
-       $(INSTALL) -m 0755 i3-sensible-editor $(DESTDIR)$(PREFIX)/bin/
-       $(INSTALL) -m 0755 i3-sensible-pager $(DESTDIR)$(PREFIX)/bin/
-       $(INSTALL) -m 0755 i3-sensible-terminal $(DESTDIR)$(PREFIX)/bin/
-       $(INSTALL) -m 0755 i3-save-tree $(DESTDIR)$(PREFIX)/bin/
-       $(INSTALL) -m 0755 i3-dmenu-desktop $(DESTDIR)$(PREFIX)/bin/
+       $(INSTALL) -m 0755 i3 $(DESTDIR)$(EXEC_PREFIX)/bin/
+       $(LN) -sf i3 $(DESTDIR)$(EXEC_PREFIX)/bin/i3-with-shmlog
+       $(INSTALL) -m 0755 i3-migrate-config-to-v4 $(DESTDIR)$(EXEC_PREFIX)/bin/
+       $(INSTALL) -m 0755 i3-sensible-editor $(DESTDIR)$(EXEC_PREFIX)/bin/
+       $(INSTALL) -m 0755 i3-sensible-pager $(DESTDIR)$(EXEC_PREFIX)/bin/
+       $(INSTALL) -m 0755 i3-sensible-terminal $(DESTDIR)$(EXEC_PREFIX)/bin/
+       $(INSTALL) -m 0755 i3-save-tree $(DESTDIR)$(EXEC_PREFIX)/bin/
+       $(INSTALL) -m 0755 i3-dmenu-desktop $(DESTDIR)$(EXEC_PREFIX)/bin/
        test -e $(DESTDIR)$(SYSCONFDIR)/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)$(SYSCONFDIR)/i3/config
        test -e $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes || $(INSTALL) -m 0644 i3.config.keycodes $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes
        $(INSTALL) -m 0644 i3.xsession.desktop $(DESTDIR)$(PREFIX)/share/xsessions/i3.desktop
        $(INSTALL) -m 0644 i3-with-shmlog.xsession.desktop $(DESTDIR)$(PREFIX)/share/xsessions/i3-with-shmlog.desktop
        $(INSTALL) -m 0644 i3.applications.desktop $(DESTDIR)$(PREFIX)/share/applications/i3.desktop
-       $(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(PREFIX)/include/i3/
+       $(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(EXEC_PREFIX)/include/i3/
 
 clean-i3:
        echo "[i3] Clean"
index f8138f0a995bb47685b61f024f2a8c9f6e80a7d2..a60b19004780bb9d9c764608abc83d80e238dde0 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * ipc.c: UNIX domain socket IPC (initialization, client handling, protocol).
  *
index 95e5079eef44101e8a5cf97c1b88a00a4b4d84fe..88d09a0ce510429db8a3713ed9c0b28954371821 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * key_press.c: key press handler
  *
index c4d39fcee57fa569be1ac07fced152b57b56b55f..e4c4531d3c82f7e4cbb5726b3cbebccfb92ad349 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * load_layout.c: Restore (parts of) the layout, for example after an inplace
  *                restart.
index 6f44fa96e37f79fcfc848e377ba657a8e0df73a8..7cf988438063ca5df2aaacce329e7d1e35224cb6 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * log.c: Logging functions.
  *
index ac40e7a389bc2eb41c303a2dd28637e4fea8007c..86e40831902eef2051eb940d7fdd8b33cb91f01e 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * main.c: Initialization, main loop
  *
@@ -261,11 +261,11 @@ int main(int argc, char *argv[]) {
                 only_check_config = true;
                 break;
             case 'v':
-                printf("i3 version %s © 2009-2014 Michael Stapelberg and contributors\n", i3_version);
+                printf("i3 version %s © 2009 Michael Stapelberg and contributors\n", i3_version);
                 exit(EXIT_SUCCESS);
                 break;
             case 'm':
-                printf("Binary i3 version:  %s © 2009-2014 Michael Stapelberg and contributors\n", i3_version);
+                printf("Binary i3 version:  %s © 2009 Michael Stapelberg and contributors\n", i3_version);
                 display_running_version();
                 exit(EXIT_SUCCESS);
                 break;
@@ -474,6 +474,12 @@ int main(int argc, char *argv[]) {
     root_screen = xcb_aux_get_screen(conn, conn_screen);
     root = root_screen->root;
 
+/* Place requests for the atoms we need as soon as possible */
+#define xmacro(atom) \
+    xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
+#include "atoms.xmacro"
+#undef xmacro
+
     /* By default, we use the same depth and visual as the root window, which
      * usually is TrueColor (24 bit depth) and the corresponding visual.
      * However, we also check if a 32 bit depth and visual are available (for
@@ -491,6 +497,20 @@ int main(int argc, char *argv[]) {
     xcb_get_geometry_cookie_t gcookie = xcb_get_geometry(conn, root);
     xcb_query_pointer_cookie_t pointercookie = xcb_query_pointer(conn, root);
 
+/* Setup NetWM atoms */
+#define xmacro(name)                                                                       \
+    do {                                                                                   \
+        xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(conn, name##_cookie, NULL); \
+        if (!reply) {                                                                      \
+            ELOG("Could not get atom " #name "\n");                                        \
+            exit(-1);                                                                      \
+        }                                                                                  \
+        A_##name = reply->atom;                                                            \
+        free(reply);                                                                       \
+    } while (0);
+#include "atoms.xmacro"
+#undef xmacro
+
     load_configuration(conn, override_configpath, false);
 
     if (config.ipc_socket_path == NULL) {
@@ -512,12 +532,6 @@ int main(int argc, char *argv[]) {
     }
     DLOG("root geometry reply: (%d, %d) %d x %d\n", greply->x, greply->y, greply->width, greply->height);
 
-/* Place requests for the atoms we need as soon as possible */
-#define xmacro(atom) \
-    xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
-#include "atoms.xmacro"
-#undef xmacro
-
     xcursor_load_cursors();
 
     /* Set a cursor for the root window (otherwise the root window will show no
@@ -547,20 +561,6 @@ int main(int argc, char *argv[]) {
 
     restore_connect();
 
-/* Setup NetWM atoms */
-#define xmacro(name)                                                                       \
-    do {                                                                                   \
-        xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(conn, name##_cookie, NULL); \
-        if (!reply) {                                                                      \
-            ELOG("Could not get atom " #name "\n");                                        \
-            exit(-1);                                                                      \
-        }                                                                                  \
-        A_##name = reply->atom;                                                            \
-        free(reply);                                                                       \
-    } while (0);
-#include "atoms.xmacro"
-#undef xmacro
-
     property_handlers_init();
 
     ewmh_setup_hints();
index 3499963b97647d4b6fa7796cd0978fc8feb5f3fa..9d27ddea90149c22e32e77cd748aa01fa17bdfac 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * manage.c: Initially managing new windows (or existing ones on restart).
  *
@@ -210,6 +210,9 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
     /* check if the window needs WM_TAKE_FOCUS */
     cwindow->needs_take_focus = window_supports_protocol(cwindow->id, A_WM_TAKE_FOCUS);
 
+    /* read the preferred _NET_WM_WINDOW_TYPE atom */
+    cwindow->window_type = xcb_get_preferred_window_type(type_reply);
+
     /* Where to start searching for a container that swallows the new one? */
     Con *search_at = croot;
 
index dc4d422f27550d9754ea791977d00c899148c0c6..f1bc8430d45fca43db596b293dd71bfed959304d 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * A "match" is a data structure which acts like a mask or expression to match
  * certain windows or not. For example, when using commands, you can specify a
  */
 void match_init(Match *match) {
     memset(match, 0, sizeof(Match));
-    match->dock = -1;
+    match->dock = M_DONTCHECK;
     match->urgent = U_DONTCHECK;
+    /* we use this as the placeholder value for "not set". */
+    match->window_type = UINT32_MAX;
 }
 
 /*
@@ -48,6 +50,7 @@ bool match_is_empty(Match *match) {
             match->window_role == NULL &&
             match->urgent == U_DONTCHECK &&
             match->id == XCB_NONE &&
+            match->window_type == UINT32_MAX &&
             match->con_id == NULL &&
             match->dock == -1 &&
             match->floating == M_ANY);
@@ -129,6 +132,14 @@ bool match_matches_window(Match *match, i3Window *window) {
         }
     }
 
+    if (match->window_type != UINT32_MAX) {
+        if (window->window_type == match->window_type) {
+            LOG("window_type matches (%i)\n", match->window_type);
+        } else {
+            return false;
+        }
+    }
+
     Con *con = NULL;
     if (match->urgent == U_LATEST) {
         /* if the window isn't urgent, no sense in searching */
@@ -161,7 +172,7 @@ bool match_matches_window(Match *match, i3Window *window) {
         LOG("urgent matches oldest\n");
     }
 
-    if (match->dock != -1) {
+    if (match->dock != M_DONTCHECK) {
         if ((window->dock == W_DOCK_TOP && match->dock == M_DOCK_TOP) ||
             (window->dock == W_DOCK_BOTTOM && match->dock == M_DOCK_BOTTOM) ||
             ((window->dock == W_DOCK_TOP || window->dock == W_DOCK_BOTTOM) &&
index e4da191a656752932b0c5fc420bbc12f6a7435ba..bd228a1cc19a19692f48e3f3dd7fb9b6c920f39a 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * move.c: Moving containers into some direction.
  *
index 822a0f8891004b5c8c8b14cc4c8f68deace51f3b..ec5d5f4791643af05a96df7238a819f72a3dc571 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * output.c: Output (monitor) related functions.
  *
index a4a0f6fd6d36fe7c626d836e7bc23d8c34573cdb..29183695c99a705d5a10febf5483aef96d34113e 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * For more information on RandR, please see the X.org RandR specification at
  * http://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt
index 60dee5cc92a24d57e42eddefb78a7436a3ed728b..9549a98b54ba36980fe956b8957e63d4e21f1c6b 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * regex.c: Interface to libPCRE (perl compatible regular expressions).
  *
index d7d576673e4b65bb13dcf9ddfbf1e5e20e2bf070..76dfa69c7d2f0d30e192b4caafe5d868cf457121 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * render.c: Renders (determines position/sizes) the layout tree, updating the
  *           various rects. Needs to be pushed to X11 (see x.c) to be visible.
index 4ed835d57ac37c681cdbe78c1d2b059c7a467be0..994fd69262fc205ab6b081cfe7efd8b33b691e33 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * resize.c: Interactive resizing.
  *
index 53a70d69afe7345c8ed792951303e98aa7c4b18d..f56372a690ac5427e140a05e2747fccc813234d1 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * restore_layout.c: Everything for restored containers that is not pure state
  *                   parsing (which can be found in load_layout.c).
index 75b8e56c2bbbfe6064189e563eccc72ebee7acba..06a7cc739452c2f04869ae49a8cdf38ce5521167 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * scratchpad.c: Moving windows to the scratchpad and making them visible again.
  *
index e971f6bdd18c8f8f3b2e38b0aeb165d50a6bb574..4b1307c9de145ce472f964e2760ae72222c3d190 100644 (file)
@@ -4,8 +4,8 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
- * © 2009-2010 Jan-Erik Rediger
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Jan-Erik Rediger
  *
  * sighandler.c: Interactive crash dialog upon SIGSEGV/SIGABRT/SIGFPE (offers
  *               to restart inplace).
index aa347bd75fe86096096b7bc0b6148f7859fe8a91..41f18d006ee23fbd981ef9f0f20a07d2323264cd 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * startup.c: Startup notification code. Ensures a startup notification context
  *            is setup when launching applications. We store the current
index 753b02fcd35734073f7afa4e241045323bae054f..92b56e6c310909afe95ea828a796f1b7d9e36259 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * tree.c: Everything that primarily modifies the layout tree data structure.
  *
index c891a6bc5c9678c998c4cf2a7cca348d40b56cfa..0a8ba6e2785194b0453d27923d6833bd3387de46 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * util.c: Utility functions, which can be useful everywhere within i3 (see
  *         also libi3).
index d7d31b36b595a0868b29c017aa558cfb26a3ea27..6e385ada754e9dac38c9d9242adc6983fa89c59a 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2015 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * Stores the latest Git commit identifier so that it can be linked into i3
  * and used dynamically without recompiling every object file.
index 5485bcc31fd0006b0dee655549a45a0c38867f2b..29cd11eb599ddd68abce6b1932d839bb95ed9319 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * window.c: Updates window attributes (X11 hints/properties).
  *
@@ -232,6 +232,23 @@ void window_update_role(i3Window *win, xcb_get_property_reply_t *prop, bool befo
     free(prop);
 }
 
+/*
+ * Updates the _NET_WM_WINDOW_TYPE property.
+ *
+ */
+void window_update_type(i3Window *window, xcb_get_property_reply_t *reply) {
+    xcb_atom_t new_type = xcb_get_preferred_window_type(reply);
+    if (new_type == XCB_NONE) {
+        DLOG("cannot read _NET_WM_WINDOW_TYPE from window.\n");
+        return;
+    }
+
+    window->window_type = new_type;
+    LOG("_NET_WM_WINDOW_TYPE changed to %i", window->window_type);
+
+    run_assignments(window);
+}
+
 /*
  * Updates the WM_HINTS (we only care about the input focus handling part).
  *
@@ -254,8 +271,10 @@ void window_update_hints(i3Window *win, xcb_get_property_reply_t *prop, bool *ur
         return;
     }
 
-    win->doesnt_accept_focus = !hints.input;
-    LOG("WM_HINTS.input changed to \"%d\"\n", hints.input);
+    if (hints.flags & XCB_ICCCM_WM_HINT_INPUT) {
+        win->doesnt_accept_focus = !hints.input;
+        LOG("WM_HINTS.input changed to \"%d\"\n", hints.input);
+    }
 
     if (urgency_hint != NULL)
         *urgency_hint = (xcb_icccm_wm_hints_get_urgency(&hints) != 0);
index 4a16f3d1c7b31d587466bcc4b27cc0570ae80b75..9034f6d5957cd643da1809a8beba50835df26f7a 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * workspace.c: Modifying workspaces, accessing them, moving containers to
  *              workspaces.
diff --git a/src/x.c b/src/x.c
index d29d4befeb5fb944ae748954760d0d7120cb258e..2dcffe6b15929ae8d25d6a656ae1017d8d122a20 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * x.c: Interface to X11, transfers our in-memory state to X11 (see also
  *      render.c). Basically a big state machine.
@@ -36,6 +36,7 @@ typedef struct con_state {
     bool mapped;
     bool unmap_now;
     bool child_mapped;
+    bool is_hidden;
 
     /** The con for which this state is. */
     Con *con;
@@ -611,6 +612,33 @@ void x_deco_recurse(Con *con) {
         x_draw_decoration(con);
 }
 
+/*
+ * Sets or removes the _NET_WM_STATE_HIDDEN property on con if necessary.
+ *
+ */
+static void set_hidden_state(Con *con) {
+    if (con->window == NULL) {
+        return;
+    }
+
+    con_state *state = state_for_frame(con->frame);
+    bool should_be_hidden = con_is_hidden(con);
+    if (should_be_hidden == state->is_hidden)
+        return;
+
+    unsigned int num = 0;
+    uint32_t values[1];
+    if (should_be_hidden) {
+        DLOG("setting _NET_WM_STATE_HIDDEN for con = %p\n", con);
+        values[num++] = A__NET_WM_STATE_HIDDEN;
+    } else {
+        DLOG("removing _NET_WM_STATE_HIDDEN for con = %p\n", con);
+    }
+
+    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, con->window->id, A__NET_WM_STATE, XCB_ATOM_ATOM, 32, num, values);
+    state->is_hidden = should_be_hidden;
+}
+
 /*
  * This function pushes the properties of each node of the layout tree to
  * X11 if they have changed (like the map state, position of the window, …).
@@ -814,6 +842,8 @@ void x_push_node(Con *con) {
         fake_absolute_configure_notify(con);
     }
 
+    set_hidden_state(con);
+
     /* Handle all children and floating windows of this node. We recurse
      * in focus order to display the focused client in a stack first when
      * switching workspaces (reduces flickering). */
index 5dda5ccee1bc6d940842af8100fb04209923ff03..303d6af1cf2c9b583fff8653bd69fe230e00e457 100644 (file)
--- a/src/xcb.c
+++ b/src/xcb.c
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * xcb.c: Helper functions for easier usage of XCB
  *
@@ -154,6 +154,35 @@ void xcb_set_window_rect(xcb_connection_t *conn, xcb_window_t window, Rect r) {
     add_ignore_event(cookie.sequence, -1);
 }
 
+/*
+ * Returns the first supported _NET_WM_WINDOW_TYPE atom.
+ *
+ */
+xcb_atom_t xcb_get_preferred_window_type(xcb_get_property_reply_t *reply) {
+    if (reply == NULL || xcb_get_property_value_length(reply) == 0)
+        return XCB_NONE;
+
+    xcb_atom_t *atoms;
+    if ((atoms = xcb_get_property_value(reply)) == NULL)
+        return XCB_NONE;
+
+    for (int i = 0; i < xcb_get_property_value_length(reply) / (reply->format / 8); i++) {
+        if (atoms[i] == A__NET_WM_WINDOW_TYPE_NORMAL ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_DIALOG ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_UTILITY ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_TOOLBAR ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_SPLASH ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_MENU ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_DROPDOWN_MENU ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_POPUP_MENU ||
+            atoms[i] == A__NET_WM_WINDOW_TYPE_TOOLTIP) {
+            return atoms[i];
+        }
+    }
+
+    return XCB_NONE;
+}
+
 /*
  * Returns true if the given reply contains the given atom.
  *
index 0a8da42545c5384f405b7de67a60675e7b419ccc..1e1e23b0dedadd2d6ae342e71a8edded2d541088 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * xcursor.c: xcursor support for themed cursors.
  *
index 9e412e0330db13a788068c1bcb3c34534047fb40..ec030230760b39f927e7a7fd3048c26d7bce6f3f 100644 (file)
@@ -4,7 +4,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * This is LEGACY code (we support RandR, which can do much more than
  * Xinerama), but necessary for the poor users of the nVidia binary
index 911558e51c658721ae138e37503c558f9b4dfc66..c1244e08745bfff08211a741d0a833d0acbc79e3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 # vim:ts=4:sw=4:expandtab
-# © 2010-2012 Michael Stapelberg and contributors
+# © 2010 Michael Stapelberg and contributors
 package complete_run;
 use strict;
 use warnings;
index 050e11623f95e250b4bfe6e7fe0e15e4c1261a47..b8dae3b1b1d0b6e84f19bd6b4bc9ea170860e0e1 100644 (file)
@@ -50,12 +50,15 @@ sub recv_take_focus {
 }
 
 subtest 'Window without WM_TAKE_FOCUS', sub {
-    fresh_workspace;
+    my $ws = fresh_workspace;
 
     my $window = open_window;
 
     ok(!recv_take_focus($window), 'did not receive ClientMessage');
 
+    my $con = shift get_ws_content($ws);
+    ok($con->{focused}, 'con is focused');
+
     done_testing;
 };
 
@@ -72,7 +75,7 @@ subtest 'Window without WM_TAKE_FOCUS', sub {
 # list), the window cannot accept input focus, so we should not try to focus
 # the window at all.
 subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
-    fresh_workspace;
+    my $ws = fresh_workspace;
 
     my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
 
@@ -88,6 +91,9 @@ subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
 
     ok(!recv_take_focus($window), 'did not receive ClientMessage');
 
+    my $con = shift get_ws_content($ws);
+    ok($con->{focused}, 'con is focused');
+
     done_testing;
 };
 
@@ -97,7 +103,7 @@ subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
 # nearly identical presently, so this is currently used also as a proxy test
 # for the latter case.
 subtest 'Window with WM_TAKE_FOCUS and unspecified InputHint', sub {
-    fresh_workspace;
+    my $ws = fresh_workspace;
 
     my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
 
@@ -105,6 +111,9 @@ subtest 'Window with WM_TAKE_FOCUS and unspecified InputHint', sub {
 
     ok(!recv_take_focus($window), 'did not receive ClientMessage');
 
+    my $con = shift get_ws_content($ws);
+    ok($con->{focused}, 'con is focused');
+
     done_testing;
 };
 
index ada7c5c5bd67c98f79d2be3d088027d54f1c3016..b684d41fca41f7e10c645a6400ad08ddcc4ad806 100644 (file)
@@ -287,9 +287,6 @@ exit_gracefully($pid);
 # 8: check that the role criterion works properly
 ##############################################################
 
-# this configuration is broken because "asdf" is not a valid integer
-# the for_window should therefore recognize this error and don’t add the
-# assignment
 $config = <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
@@ -329,9 +326,6 @@ exit_gracefully($pid);
 #    *after* the window has been mapped
 ##############################################################
 
-# this configuration is broken because "asdf" is not a valid integer
-# the for_window should therefore recognize this error and don’t add the
-# assignment
 $config = <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
@@ -370,5 +364,77 @@ is($content[0]->{border}, 'none', 'no border (window_role 2)');
 
 exit_gracefully($pid);
 
+##############################################################
+# 10: check that the criterion 'window_type' works
+##############################################################
+
+# test all window types
+my %window_types = (
+    'normal'        => '_NET_WM_WINDOW_TYPE_NORMAL',
+    'dialog'        => '_NET_WM_WINDOW_TYPE_DIALOG',
+    'utility'       => '_NET_WM_WINDOW_TYPE_UTILITY',
+    'toolbar'       => '_NET_WM_WINDOW_TYPE_TOOLBAR',
+    'splash'        => '_NET_WM_WINDOW_TYPE_SPLASH',
+    'menu'          => '_NET_WM_WINDOW_TYPE_MENU',
+    'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU',
+    'popup_menu'    => '_NET_WM_WINDOW_TYPE_POPUP_MENU',
+    'tooltip'       => '_NET_WM_WINDOW_TYPE_TOOLTIP'
+);
+
+while (my ($window_type, $atom) = each %window_types) {
+
+    $config = <<"EOT";
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+for_window [window_type="$window_type"] floating enable, mark branded
+EOT
+
+    $pid = launch_with_config($config);
+    $tmp = fresh_workspace;
+
+    $window = open_window(window_type => $x->atom(name => $atom));
+
+    my @nodes = @{get_ws($tmp)->{floating_nodes}};
+    cmp_ok(@nodes, '==', 1, 'one floating container on this workspace');
+    is($nodes[0]->{nodes}[0]->{mark}, 'branded', "mark set (window_type = $atom)");
+
+    exit_gracefully($pid);
+
+}
+
+##############################################################
+# 11: check that the criterion 'window_type' works if the
+#     _NET_WM_WINDOW_TYPE is changed after managing.
+##############################################################
+
+while (my ($window_type, $atom) = each %window_types) {
+
+    $config = <<"EOT";
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+for_window [window_type="$window_type"] floating enable, mark branded
+EOT
+
+    $pid = launch_with_config($config);
+    $tmp = fresh_workspace;
+
+    $window = open_window();
+
+    my $atomname = $x->atom(name => '_NET_WM_WINDOW_TYPE');
+    my $atomtype = $x->atom(name => 'ATOM');
+    $x->change_property(PROP_MODE_REPLACE, $window->id, $atomname->id, $atomtype->id,
+      32, 1, pack('L1', $x->atom(name => $atom)->id));
+    $x->flush;
+    sync_with_i3;
+
+    my @nodes = @{get_ws($tmp)->{floating_nodes}};
+    cmp_ok(@nodes, '==', 1, 'one floating container on this workspace');
+    is($nodes[0]->{nodes}[0]->{mark}, 'branded', "mark set (window_type = $atom)");
+
+    exit_gracefully($pid);
+
+}
+
+##############################################################
 
 done_testing;
index 6d67731a1e71a9914485962ebc3fc73215d1b042..094caeaa5f13437c9ee80813b07f93c1461dfb0c 100644 (file)
@@ -150,7 +150,7 @@ is(parser_calls('unknown_literal'),
    'error for unknown literal ok');
 
 is(parser_calls('move something to somewhere'),
-   "ERROR: Expected one of these tokens: 'window', 'container', 'to', 'workspace', 'output', 'scratchpad', 'left', 'right', 'up', 'down', 'position', 'absolute'\n" .
+   "ERROR: Expected one of these tokens: 'window', 'container', 'to', 'workspace', 'output', 'mark', 'scratchpad', 'left', 'right', 'up', 'down', 'position', 'absolute'\n" .
    "ERROR: Your command: move something to somewhere\n" .
    "ERROR:                    ^^^^^^^^^^^^^^^^^^^^^^",
    'error for unknown literal ok');
index 9ec8b5ebe75de6f4f4b9265541a5f8f73c50dd7f..7568de48394e4ba4c09edcce2af289fca191ee32 100644 (file)
@@ -47,16 +47,20 @@ mode "meh" {
     bindsym --release Mod1+x exec foo
     bindsym --whole-window button3 nop
     bindsym --release --whole-window button3 nop
+    bindsym --border button3 nop
+    bindsym --release --border button3 nop
 }
 EOT
 
 my $expected = <<'EOT';
 cfg_enter_mode(meh)
-cfg_mode_binding(bindsym, Mod1,Shift, x, (null), (null), resize grow)
-cfg_mode_binding(bindcode, Mod1, 44, (null), (null), resize shrink)
-cfg_mode_binding(bindsym, Mod1, x, --release, (null), exec foo)
-cfg_mode_binding(bindsym, (null), button3, (null), --whole-window, nop)
-cfg_mode_binding(bindsym, (null), button3, --release, --whole-window, nop)
+cfg_mode_binding(bindsym, Mod1,Shift, x, (null), (null), (null), resize grow)
+cfg_mode_binding(bindcode, Mod1, 44, (null), (null), (null), resize shrink)
+cfg_mode_binding(bindsym, Mod1, x, --release, (null), (null), exec foo)
+cfg_mode_binding(bindsym, (null), button3, (null), (null), --whole-window, nop)
+cfg_mode_binding(bindsym, (null), button3, --release, (null), --whole-window, nop)
+cfg_mode_binding(bindsym, (null), button3, (null), --border, (null), nop)
+cfg_mode_binding(bindsym, (null), button3, --release, --border, (null), nop)
 EOT
 
 is(parser_calls($config),
@@ -624,7 +628,7 @@ EOT
 
 $expected = <<'EOT';
 cfg_enter_mode(yo)
-cfg_mode_binding(bindsym, (null), x, (null), (null), resize shrink left)
+cfg_mode_binding(bindsym, (null), x, (null), (null), (null), resize shrink left)
 ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'bindsym', 'bindcode', 'bind', '}'
 ERROR: CONFIG: (in file <stdin>)
 ERROR: CONFIG: Line   1: mode "yo" {
index 22a2eb4e2504c2e531ecb3ec76877be48930178d..c023bca479dd15e19e5247c56ccf39ae63a9f84c 100644 (file)
 # Bug still in: 4.8-16-g6888a1f
 use i3test;
 
-my $ws = fresh_workspace;
+my ($ws, $win1, $win2, $win3, $ws_con);
 
-my $win1 = open_window;
-my $win2 = open_window;
-my $win3 = open_window;
+###############################################################################
+# Tets moving with 'id' criterion.
+###############################################################################
+
+$ws = fresh_workspace;
+
+$win1 = open_window;
+$win2 = open_window;
+$win3 = open_window;
 
 # move win1 from the left to the right
 cmd '[id="' . $win1->{id} . '"] move right';
 
 # now they should be switched, with win2 still being focused
-my $ws_con = get_ws($ws);
+$ws_con = get_ws($ws);
 
 # win2 should be on the left
 is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with criteria');
 is($x->input_focus, $win3->{id}, 'it should not disturb focus');
 
+###############################################################################
+# Tets moving with 'window_type' criterion.
+###############################################################################
+
+# test all window types
+my %window_types = ( 
+    'normal'        => '_NET_WM_WINDOW_TYPE_NORMAL',
+    'dialog'        => '_NET_WM_WINDOW_TYPE_DIALOG',
+    'utility'       => '_NET_WM_WINDOW_TYPE_UTILITY',
+    'toolbar'       => '_NET_WM_WINDOW_TYPE_TOOLBAR',
+    'splash'        => '_NET_WM_WINDOW_TYPE_SPLASH',
+    'menu'          => '_NET_WM_WINDOW_TYPE_MENU',
+    'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU',
+    'popup_menu'    => '_NET_WM_WINDOW_TYPE_POPUP_MENU',
+    'tooltip'       => '_NET_WM_WINDOW_TYPE_TOOLTIP'
+);
+
+while (my ($window_type, $atom) = each %window_types) {
+
+    $ws = fresh_workspace;
+
+    $win1 = open_window(window_type => $x->atom(name => $atom));
+    $win2 = open_window;
+    $win3 = open_window;
+
+    cmd '[window_type="' . $window_type . '"] move right';
+
+    $ws_con = get_ws($ws);
+    is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with window_type = ' . $window_type);
+    is($x->input_focus, $win3->{id}, 'it should not disturb focus');
+
+}
+
+###############################################################################
+
 done_testing;
diff --git a/testcases/t/243-move-to-mark.t b/testcases/t/243-move-to-mark.t
new file mode 100644 (file)
index 0000000..58105d7
--- /dev/null
@@ -0,0 +1,341 @@
+#!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)
+#
+# Tests for the 'move [window|container] to mark' command
+# Ticket: #1643
+use i3test;
+
+# In the following tests descriptions, we will always use the following names:
+#  * 'S' for the source container which is going to be moved,
+#  * 'M' for the marked target container to which 'S' will be moved.
+
+my ($A, $B, $S, $M, $F, $source_ws, $target_ws, $ws);
+my ($nodes, $focus);
+my $cmd_result;
+
+my $_NET_WM_STATE_REMOVE = 0;
+my $_NET_WM_STATE_ADD = 1;
+my $_NET_WM_STATE_TOGGLE = 2;
+
+sub set_urgency {
+    my ($win, $urgent_flag) = @_; 
+    my $msg = pack "CCSLLLLLL",
+        X11::XCB::CLIENT_MESSAGE, # response_type
+        32, # format
+        0, # sequence
+        $win->id, # window
+        $x->atom(name => '_NET_WM_STATE')->id, # message type
+        ($urgent_flag ? $_NET_WM_STATE_ADD : $_NET_WM_STATE_REMOVE), # data32[0]
+        $x->atom(name => '_NET_WM_STATE_DEMANDS_ATTENTION')->id, # 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);
+}
+
+###############################################################################
+# Given 'M' and 'S' in a horizontal split, when 'S' is moved to 'M', then
+# verify that nothing changed.
+###############################################################################
+
+$ws = fresh_workspace;
+$M = open_window;
+cmd 'mark target';
+$S = open_window;
+
+cmd 'move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($ws);
+is(@{$nodes}, 2, 'there are two containers');
+is($nodes->[0]->{window}, $M->{id}, 'M is left of S');
+is($nodes->[1]->{window}, $S->{id}, 'S is right of M');
+
+###############################################################################
+# Given 'S' and 'M' in a horizontal split, when 'S' is moved to 'M', then
+# both containers switch places.
+###############################################################################
+
+$ws = fresh_workspace;
+$S = open_window;
+$M = open_window;
+cmd 'mark target';
+cmd 'focus left';
+
+cmd 'move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($ws);
+is(@{$nodes}, 2, 'there are two containers');
+is($nodes->[0]->{window}, $M->{id}, 'M is left of S');
+is($nodes->[1]->{window}, $S->{id}, 'S is right of M');
+
+###############################################################################
+# Given 'S' and no container 'M' exists, when 'S' is moved to 'M', then
+# the command is unsuccessful.
+###############################################################################
+
+$ws = fresh_workspace;
+$S = open_window;
+
+$cmd_result = cmd 'move container to mark absent';
+
+is($cmd_result->[0]->{success}, 0, 'command was unsuccessful');
+
+###############################################################################
+# Given 'S' and 'M' on different workspaces, when 'S' is moved to 'M', then
+# 'S' ends up on the same workspace as 'M'.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+$target_ws = fresh_workspace;
+$M = open_window;
+cmd 'mark target';
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($source_ws);
+is(@{$nodes}, 0, 'source workspace is empty');
+
+($nodes, $focus) = get_ws_content($target_ws);
+is(@{$nodes}, 2, 'both containers are on the target workspace');
+is($nodes->[0]->{window}, $M->{id}, 'M is left of S');
+is($nodes->[1]->{window}, $S->{id}, 'S is right of M');
+
+###############################################################################
+# Given 'S' and 'M' on different workspaces and 'S' is urgent, when 'S' is 
+# moved to 'M', then the urgency flag is transferred to the target workspace.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+$F = open_window;
+$target_ws = fresh_workspace;
+$M = open_window;
+cmd 'mark target';
+cmd 'workspace ' . $source_ws;
+set_urgency($S, 1);
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+$source_ws = get_ws($source_ws);
+$target_ws = get_ws($target_ws);
+ok(!$source_ws->{urgent}, 'source workspace is no longer urgent');
+ok($target_ws->{urgent}, 'target workspace is urgent');
+
+###############################################################################
+# Given 'S' and 'M' where 'M' is inside a tabbed container, when 'S' is moved
+# to 'M', then 'S' ends up as a new tab.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+
+# open tabbed container ['A' 'M' 'B']
+$target_ws = fresh_workspace;
+$A = open_window;
+cmd 'layout tabbed';
+$M = open_window;
+cmd 'mark target';
+$B = open_window;
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($target_ws);
+is(@{$nodes}, 1, 'there is a tabbed container');
+
+$nodes = $nodes->[0]->{nodes};
+is(@{$nodes}, 4, 'all four containers are on the target workspace');
+is($nodes->[0]->{window}, $A->{id}, 'A is the first tab');
+is($nodes->[1]->{window}, $M->{id}, 'M is the second tab');
+is($nodes->[2]->{window}, $S->{id}, 'S is the third tab');
+is($nodes->[3]->{window}, $B->{id}, 'B is the fourth tab');
+
+###############################################################################
+# Given 'S' and 'M' where 'M' is a tabbed container where the currently focused
+# tab is a nested layout, when 'S' is moved to 'M', then 'S' is a new tab
+# within 'M'.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+
+$target_ws = fresh_workspace;
+$A = open_window;
+cmd 'layout tabbed';
+cmd 'focus parent';
+cmd 'mark target';
+cmd 'focus child';
+$B = open_window;
+cmd 'split h';
+$F = open_window;
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($target_ws);
+is(@{$nodes}, 1, 'there is a tabbed container');
+
+$nodes = $nodes->[0]->{nodes};
+is(@{$nodes}, 3, 'there are three tabs');
+
+is($nodes->[0]->{window}, $A->{id}, 'A is the first tab');
+is($nodes->[2]->{window}, $S->{id}, 'S is the third tab');
+
+###############################################################################
+# Given 'S' and 'M' where 'M' is inside a split container inside a tabbed
+# container, when 'S' is moved to 'M', then 'S' ends up as a container
+# within the same tab as 'M'.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+
+# open tabbed container ['A'['B' 'M']]
+$target_ws = fresh_workspace;
+$A = open_window;
+cmd 'layout tabbed';
+$B = open_window;
+cmd 'split h';
+$M = open_window;
+cmd 'mark target';
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($target_ws);
+is(@{$nodes}, 1, 'there is a tabbed container');
+
+$nodes = $nodes->[0]->{nodes};
+is(@{$nodes}, 2, 'there are two tabs');
+
+$nodes = $nodes->[1]->{nodes};
+is(@{$nodes}, 3, 'the tab with the marked children has three children');
+is($nodes->[0]->{window}, $B->{id}, 'B is the first tab');
+is($nodes->[1]->{window}, $M->{id}, 'M is the second tab');
+is($nodes->[2]->{window}, $S->{id}, 'S is the third tab');
+
+###############################################################################
+# Given 'S', 'A' and 'B' where 'A' and 'B' are inside the tabbed container 'M',
+# when 'S' is moved to 'M', then 'S' ends up as a new tab in 'M'.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+$target_ws = fresh_workspace;
+$A = open_window;
+cmd 'layout tabbed';
+$B = open_window;
+cmd 'focus parent';
+cmd 'mark target';
+cmd 'focus child';
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($target_ws);
+is(@{$nodes}, 1, 'there is a tabbed container');
+
+$nodes = $nodes->[0]->{nodes};
+is(@{$nodes}, 3, 'there are three tabs');
+
+is($nodes->[0]->{window}, $A->{id}, 'A is the first tab');
+is($nodes->[1]->{window}, $B->{id}, 'B is the second tab');
+is($nodes->[2]->{window}, $S->{id}, 'S is the third tab');
+
+###############################################################################
+# Given 'S', 'A', 'F' and 'M', where 'M' is a workspace containing a tabbed
+# container, when 'S' is moved to 'M', then 'S' does not end up as a tab, but
+# rather as a new window next to the tabbed container.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+$target_ws = fresh_workspace;
+$A = open_window;
+cmd 'layout tabbed';
+$F = open_window;
+$M = $target_ws;
+cmd 'focus parent';
+cmd 'focus parent';
+cmd 'mark target';
+cmd 'focus ' . $source_ws;
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($target_ws);
+is(@{$nodes}, 2, 'there is a tabbed container and a window');
+is($nodes->[1]->{window}, $S->{id}, 'S is the second window');
+
+###############################################################################
+# Given 'S' and 'M' where 'S' is floating and 'M' on a different workspace,
+# when 'S' is moved to 'M', then 'S' is a floating container on the same
+# workspaces as 'M'.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_floating_window;
+$target_ws = fresh_workspace;
+$M = open_window;
+cmd 'mark target';
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+is(@{get_ws($target_ws)->{floating_nodes}}, 1, 'target workspace has the container now');
+
+###############################################################################
+# Given 'S' and 'M' where 'M' is floating and on a different workspace,
+# when 'S' is moved to 'M', then 'S' ends up as a tiling container on the
+# same workspace as 'M'.
+###############################################################################
+
+$source_ws = fresh_workspace;
+$S = open_window;
+$target_ws = fresh_workspace;
+$M = open_floating_window;
+cmd 'mark target';
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+($nodes, $focus) = get_ws_content($target_ws);
+is(@{$nodes}, 1, 'tiling container moved to the target workspace');
+
+###############################################################################
+# Given 'S' and 'M' are the same container, when 'S' is moved to 'M', then
+# the command is ignored.
+###############################################################################
+
+$ws = fresh_workspace;
+$S = open_window;
+$M = $S;
+cmd 'mark target';
+
+cmd '[id="' . $S->{id} . '"] move container to mark target';
+sync_with_i3;
+
+does_i3_live;
+
+###############################################################################
+
+done_testing;
diff --git a/testcases/t/243-net-wm-state-hidden.t b/testcases/t/243-net-wm-state-hidden.t
new file mode 100644 (file)
index 0000000..3f2301c
--- /dev/null
@@ -0,0 +1,201 @@
+#!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)
+#
+# Tests for setting and removing the _NET_WM_STATE_HIDDEN atom properly.
+# Ticket: #1648
+use i3test;
+use X11::XCB qw(:all);
+
+sub is_hidden {
+    sync_with_i3;
+    my $atom = $x->atom(name => '_NET_WM_STATE_HIDDEN');
+
+    my ($con) = @_;
+    my $cookie = $x->get_property(
+        0,
+        $con->{id},
+        $x->atom(name => '_NET_WM_STATE')->id,
+        GET_PROPERTY_TYPE_ANY,
+        0,
+        4096
+    );
+
+    my $reply = $x->get_property_reply($cookie->{sequence});
+    my $len = $reply->{length};
+    return 0 if $len == 0;
+
+    my @atoms = unpack("L$len", $reply->{value});
+    for (my $i = 0; $i < $len; $i++) {
+        return 1 if $atoms[$i] == $atom->id;
+    }
+
+    return 0;
+}
+
+my ($tabA, $tabB, $tabC, $subtabA, $subtabB, $windowA, $windowB);
+
+###############################################################################
+# Given two containers next to each other, when focusing one, then the other
+# one does not have _NET_WM_STATE_HIDDEN set.
+###############################################################################
+
+fresh_workspace;
+$windowA = open_window;
+$windowB = open_window;
+
+ok(!is_hidden($windowA), 'left window does not have _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($windowB), 'right window does not have _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+# Given two containers on different workspaces, when one is focused, then
+# the other one does not have _NET_WM_STATE_HIDDEN set.
+###############################################################################
+
+fresh_workspace;
+$windowA = open_window;
+fresh_workspace;
+$windowB = open_window;
+
+ok(!is_hidden($windowA), 'left window does not have _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($windowB), 'right window does not have _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+# Given two containers in the same tabbed container, when one is focused, then
+# (only) the other one has _NET_WM_STATE_HIDDEN set.
+# Given the other tab is focused, then the atom is transferred.
+###############################################################################
+
+fresh_workspace;
+$tabA = open_window;
+cmd 'layout tabbed';
+$tabB = open_window;
+
+ok(is_hidden($tabA), 'unfocused tab has _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($tabB), 'focused tab does not have _NET_WM_STATE_HIDDEN set');
+
+cmd 'focus left';
+
+ok(!is_hidden($tabA), 'focused tab does not have _NET_WM_STATE_HIDDEN set');
+ok(is_hidden($tabB), 'unfocused tab has _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+# Given three containers in the same stacked container, when the focused tab
+# is moved to another workspace, then the now focused tab does not have
+# _NET_WM_STATE_HIDDEN set anymore.
+###############################################################################
+
+fresh_workspace;
+$tabA = open_window;
+cmd 'layout stacked';
+$tabB = open_window;
+$tabC = open_window;
+cmd 'move window to workspace unused';
+
+ok(is_hidden($tabA), 'unfocused tab has _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($tabB), 'focused tab does not have _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($tabC), 'moved window does not have _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+# Given three containers in the same stacked container, when a not focused
+# tab is moved to another workspace, then it does not have _NET_WM_STATE_HIDDEN
+# set anymore.
+###############################################################################
+
+fresh_workspace;
+$tabA = open_window;
+cmd 'layout stacked';
+$tabB = open_window;
+cmd 'mark moveme';
+$tabC = open_window;
+cmd '[con_mark="moveme"] move window to workspace unused';
+
+ok(is_hidden($tabA), 'unfocused tab has _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($tabB), 'moved window does not have _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($tabC), 'focused tab does not have _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+# Given a tabbed container and some other container, when the latter is moved
+# into the tabbed container, then all other tabs have _NET_WM_STATE_HIDDEN
+# set.
+###############################################################################
+
+fresh_workspace;
+$tabA = open_window;
+cmd 'layout tabbed';
+$tabB = open_window;
+cmd 'focus parent';
+cmd 'split h';
+$tabC = open_window;
+cmd 'move left';
+
+ok(is_hidden($tabA), 'unfocused tab has _NET_WM_STATE_HIDDEN set');
+ok(is_hidden($tabB), 'unfocused tab has _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($tabC), 'focused tab does not have _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+# Given a stacked container nested inside another tabbed container with the
+# inner one being in the currently focused tab, then the focused tab of the
+# inner container does not have _NET_WM_STATE_HIDDEN set.
+###############################################################################
+
+fresh_workspace;
+$tabA = open_window;
+cmd 'layout tabbed';
+$tabB = open_window;
+cmd 'split h';
+open_window;
+cmd 'split v';
+cmd 'layout stacked';
+$subtabA = open_window;
+$subtabB = open_window;
+
+ok(is_hidden($tabA), 'unfocused outer tab has _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($tabB), 'focused outer tab does not have _NET_WM_STATE_HIDDEN set');
+ok(is_hidden($subtabA), 'unfocused inner tab has _NET_WM_STATE_HIDDEN set');
+ok(!is_hidden($subtabB), 'focused inner tab does not have _NET_WM_STATE_HIDDEN set');
+
+cmd 'focus left';
+
+ok(!is_hidden($subtabB), 'focused inner tab does not have _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+# Given a stacked container nested inside another tabbed container with the
+# inner one being in a currently not focused tab, then all tabs of the inner
+# container have _NET_WM_STATE_HIDDEN set.
+###############################################################################
+
+fresh_workspace;
+$tabA = open_window;
+cmd 'layout tabbed';
+$tabB = open_window;
+cmd 'split h';
+open_window;
+cmd 'split v';
+cmd 'layout stacked';
+$subtabA = open_window;
+$subtabB = open_window;
+cmd 'focus parent';
+cmd 'focus parent';
+cmd 'focus left';
+
+ok(!is_hidden($tabA), 'focused outer tab does not have _NET_WM_STATE_HIDDEN set');
+ok(is_hidden($tabB), 'unfocused outer tab has _NET_WM_STATE_HIDDEN set');
+ok(is_hidden($subtabA), 'unfocused inner tab has _NET_WM_STATE_HIDDEN set');
+ok(is_hidden($subtabB), 'unfocused inner tab has _NET_WM_STATE_HIDDEN set');
+
+###############################################################################
+
+done_testing;