]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 30 Aug 2013 18:01:04 +0000 (20:01 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 30 Aug 2013 18:01:04 +0000 (20:01 +0200)
12 files changed:
DEPENDS
common.mk
debian/changelog
debian/control
debian/rules
docs/userguide
include/xcursor.h
src/commands.c
src/floating.c
src/workspace.c
src/xcursor.c
testcases/t/515-create-workspace.t [new file with mode: 0644]

diff --git a/DEPENDS b/DEPENDS
index 4b0902723a179ee6d1a4ed31102b61eeceb78bd0..083372c7ec17e950e7887ea22c9d08c1ae6f3e54 100644 (file)
--- a/DEPENDS
+++ b/DEPENDS
 │ pkg-config  │ 0.25   │ 0.26   │ http://pkgconfig.freedesktop.org/      │
 │ libxcb      │ 1.1.93 │ 1.7    │ http://xcb.freedesktop.org/dist/       │
 │ xcb-util    │ 0.3.3  │ 0.3.8  │ http://xcb.freedesktop.org/dist/       │
+│ util-cursor³│ 0.0.99 │ 0.0.99 │ http://xcb.freedesktop.org/dist/       │
 │ libev       │ 4.0    │ 4.11   │ http://libev.schmorp.de/               │
 │ yajl        │ 1.0.8  │ 2.0.1  │ http://lloyd.github.com/yajl/          │
 │ asciidoc    │ 8.3.0  │ 8.6.4  │ http://www.methods.co.nz/asciidoc/     │
 │ xmlto       │ 0.0.23 │ 0.0.23 │ http://www.methods.co.nz/asciidoc/     │
 │ Pod::Simple²│ 3.22   │ 3.22   │ http://search.cpan.org/~dwheeler/Pod-Simple-3.23/
 │ docbook-xml │ 4.5    │ 4.5    │ http://www.methods.co.nz/asciidoc/     │
-│ libxcursor  │ 1.1.11 │ 1.1.11 │ http://ftp.x.org/pub/current/src/lib/  │
 │ Xlib        │ 1.3.3  │ 1.4.3  │ http://ftp.x.org/pub/current/src/lib/  │
 │ PCRE        │ 8.12   │ 8.12   │ http://www.pcre.org/                   │
 │ libsn¹      │ 0.10   │ 0.12   │ http://freedesktop.org/wiki/Software/startup-notification
@@ -26,6 +26,8 @@
  ¹ libsn = libstartup-notification
  ² Pod::Simple is a Perl module required for converting the testsuite
    documentation to HTML. See http://michael.stapelberg.de/cpan/#Pod::Simple
+ ³ xcb-util-cursor, to be precise. Might be considered part of xcb-util, or not
+   :-).
 
  i3bar, i3-msg, i3-input, i3-nagbar and i3-config-wizard do not introduce any
  new dependencies.
index de5c7e9894221e01986972caa17c57a89972acbc..0214abfa52d9e18d956abff02ac851afb5edfc84 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -111,8 +111,8 @@ X11_CFLAGS := $(call cflags_for_lib, x11)
 X11_LIBS   := $(call ldflags_for_lib, x11,X11)
 
 # Xcursor
-XCURSOR_CFLAGS := $(call cflags_for_lib, xcursor)
-XCURSOR_LIBS   := $(call ldflags_for_lib, xcursor,Xcursor)
+XCURSOR_CFLAGS := $(call cflags_for_lib, xcb-cursor)
+XCURSOR_LIBS   := $(call ldflags_for_lib, xcb-cursor,xcb-cursor)
 
 # yajl
 YAJL_CFLAGS := $(call cflags_for_lib, yajl)
index 80a20e3c2d092e10066df87bb3a5db21d72d528e..f38553639d37113021bc93c7348db0c018c45706 100644 (file)
@@ -1,8 +1,22 @@
-i3-wm (4.5.2-1) experimental; urgency=low
+i3-wm (4.6.1-1) unstable; urgency=low
 
-  * NOT YET RELEASED
+  * NOT YET RELEASED.
 
- -- Michael Stapelberg <stapelberg@debian.org>  Mon, 18 Mar 2013 23:01:30 +0100
+ -- Michael Stapelberg <stapelberg@debian.org>  Wed, 07 Aug 2013 20:53:26 +0200
+
+i3-wm (4.6-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Michael Stapelberg <stapelberg@debian.org>  Wed, 07 Aug 2013 20:53:26 +0200
+
+i3-wm (4.5.1-2) unstable; urgency=low
+
+  * experimental to unstable because i3-wm 4.5.1 was only in experimental due
+    to the freeze.
+  * bump standards-version to 3.9.4 (no changes necessary)
+
+ -- Michael Stapelberg <stapelberg@debian.org>  Tue, 14 May 2013 20:48:16 +0200
 
 i3-wm (4.5.1-1) experimental; urgency=low
 
index f9ecb5582319e63446cddc6c93ed6ff33c5a44b8..558b01270b748aa80d87882ebb505fe816ae4a29 100644 (file)
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 7.0.50~),
                libxcb-xinerama0-dev (>= 1.1),
                libxcb-randr0-dev,
                libxcb-icccm4-dev,
-               libxcursor-dev,
+               libxcb-cursor-dev,
                asciidoc (>= 8.4.4),
                xmlto,
                docbook-xml,
@@ -21,7 +21,7 @@ Build-Depends: debhelper (>= 7.0.50~),
                libcairo2-dev,
                libpango1.0-dev,
                libpod-simple-perl
-Standards-Version: 3.9.3
+Standards-Version: 3.9.4
 Homepage: http://i3wm.org/
 
 Package: i3
index 3ae79dddf30ae59db5de256e4db3422b10e19f2d..55c72b514ead804081879a20e9362bf8150c06ce 100755 (executable)
@@ -38,7 +38,7 @@ override_dh_auto_build:
        $(MAKE) -C docs
 
 override_dh_installchangelogs:
-       dh_installchangelogs RELEASE-NOTES-4.5.1
+       dh_installchangelogs RELEASE-NOTES-4.6
 
 override_dh_install:
        $(MAKE) DESTDIR=$(CURDIR)/debian/i3-wm/ install
index 7e5f51eefefcb4eb743a9f64babb74828668db5f..76ac73ac4baaf01fea040ef8f9a71ac983d62435 100644 (file)
@@ -570,11 +570,12 @@ set $m Mod1
 bindsym $m+Shift+r restart
 ------------------------
 
-Variables are directly replaced in the file when parsing. There is no fancy
-handling and there are absolutely no plans to change this. If you need a more
-dynamic configuration you should create a little script which generates a
-configuration file and run it before starting i3 (for example in your
-+~/.xsession+ file).
+Variables are directly replaced in the file when parsing. Variables expansion
+is not recursive so it is not possible to define a variable with a value
+containing another variable. There is no fancy handling and there are
+absolutely no plans to change this. If you need a more dynamic configuration
+you should create a little script which generates a configuration file and run
+it before starting i3 (for example in your +~/.xsession+ file).
 
 === Automatically putting clients on specific workspaces
 
index bfe37c3944cf098e22b91aa461cb92e7db5dde5c..868fee7823647dadc30a0718269ec792e816ef2c 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-2013 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * xcursor.c: libXcursor support for themed cursors.
  *
@@ -10,7 +10,7 @@
 #ifndef I3_XCURSOR_CURSOR_H
 #define I3_XCURSOR_CURSOR_H
 
-#include <X11/Xlib.h>
+#include <xcb/xcb_cursor.h>
 
 enum xcursor_cursor_t {
     XCURSOR_CURSOR_POINTER = 0,
@@ -26,7 +26,7 @@ enum xcursor_cursor_t {
 };
 
 void xcursor_load_cursors(void);
-Cursor xcursor_get_cursor(enum xcursor_cursor_t c);
+xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c);
 int xcursor_get_xcb_cursor(enum xcursor_cursor_t c);
 
 /**
index cde1cd7c115f34139c6f6e8d38e32b77d82833f1..f42742462c8fb75a68386d5d6507983b01aa9651 100644 (file)
@@ -1521,7 +1521,7 @@ void cmd_fullscreen(I3_CMD, char *fullscreen_mode) {
     HANDLE_EMPTY_MATCH;
 
     TAILQ_FOREACH(current, &owindows, owindows) {
-        printf("matching: %p / %s\n", current->con, current->con->name);
+        DLOG("matching: %p / %s\n", current->con, current->con->name);
         con_toggle_fullscreen(current->con, (strcmp(fullscreen_mode, "global") == 0 ? CF_GLOBAL : CF_OUTPUT));
     }
 
@@ -1950,7 +1950,7 @@ void cmd_rename_workspace(I3_CMD, char *old_name, char *new_name) {
  *
  */
 bool cmd_bar_mode(char *bar_mode, char *bar_id) {
-    int mode;
+    int mode = M_DOCK;
     bool toggle = false;
     if (strcmp(bar_mode, "dock") == 0)
         mode = M_DOCK;
@@ -1995,7 +1995,7 @@ bool cmd_bar_mode(char *bar_mode, char *bar_id) {
  *
  */
 bool cmd_bar_hidden_state(char *bar_hidden_state, char *bar_id) {
-    int hidden_state;
+    int hidden_state = S_SHOW;
     bool toggle = false;
     if (strcmp(bar_hidden_state, "hide") == 0)
         hidden_state = S_HIDE;
index 643f204b64110a12aede45c4bf4b6ee9e4851f86..97b7d8842be26d1794fd54e53e54e8c443630d31 100644 (file)
@@ -569,7 +569,7 @@ void drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_window_t
     if (con != NULL)
         memcpy(&old_rect, &(con->rect), sizeof(Rect));
 
-    Cursor xcursor = (cursor && xcursor_supported) ?
+    xcb_cursor_t xcursor = (cursor && xcursor_supported) ?
         xcursor_get_cursor(cursor) : XCB_NONE;
 
     /* Grab the pointer */
index af9325f78b6bc4b299ee7fff2ed853703cfd6c50..3f70ced7bb32f1150306ebb5b341c7a08e43fa61 100644 (file)
@@ -197,17 +197,16 @@ Con *create_workspace_on_output(Output *output, Con *content) {
         while (exists) {
             c++;
 
-            FREE(ws->name);
-            sasprintf(&(ws->name), "%d", c);
+            ws->num = c;
 
             current = NULL;
             TAILQ_FOREACH(out, &(croot->nodes_head), nodes)
-                GREP_FIRST(current, output_get_content(out), !strcasecmp(child->name, ws->name));
+                GREP_FIRST(current, output_get_content(out), child->num == ws->num);
             exists = (current != NULL);
 
-            DLOG("result for ws %s / %d: exists = %d\n", ws->name, c, exists);
+            DLOG("result for ws %d: exists = %d\n", c, exists);
         }
-        ws->num = c;
+        sasprintf(&(ws->name), "%d", c);
     }
     con_attach(ws, content, false);
 
index 90fd69dd237a67cc7470f238af33a693e6175aad..dcbe2ad0d8cd5c0c9b678dab97d394e7e94bcdae 100644 (file)
@@ -4,20 +4,20 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
  *
- * xcursor.c: libXcursor support for themed cursors.
+ * xcursor.c: xcursor support for themed cursors.
  *
  */
 #include <assert.h>
-#include <X11/Xcursor/Xcursor.h>
-#include <X11/cursorfont.h>
+#include <xcb/xcb_cursor.h>
 
 #include "i3.h"
 #include "xcb.h"
 #include "xcursor.h"
 
-static Cursor cursors[XCURSOR_CURSOR_MAX];
+static xcb_cursor_context_t *ctx;
+static xcb_cursor_t cursors[XCURSOR_CURSOR_MAX];
 
 static const int xcb_cursors[XCURSOR_CURSOR_MAX] = {
     XCB_CURSOR_LEFT_PTR,
@@ -26,23 +26,26 @@ static const int xcb_cursors[XCURSOR_CURSOR_MAX] = {
     XCB_CURSOR_WATCH
 };
 
-static Cursor load_cursor(const char *name) {
-    Cursor c = XcursorLibraryLoadCursor(xlibdpy, name);
-    if (c == None)
-        xcursor_supported = false;
-    return c;
-}
-
 void xcursor_load_cursors(void) {
-    cursors[XCURSOR_CURSOR_POINTER]             = load_cursor("left_ptr");
-    cursors[XCURSOR_CURSOR_RESIZE_HORIZONTAL]   = load_cursor("sb_h_double_arrow");
-    cursors[XCURSOR_CURSOR_RESIZE_VERTICAL]     = load_cursor("sb_v_double_arrow");
-    cursors[XCURSOR_CURSOR_WATCH]               = load_cursor("watch");
-    cursors[XCURSOR_CURSOR_MOVE]                = load_cursor("fleur");
-    cursors[XCURSOR_CURSOR_TOP_LEFT_CORNER]     = load_cursor("top_left_corner");
-    cursors[XCURSOR_CURSOR_TOP_RIGHT_CORNER]    = load_cursor("top_right_corner");
-    cursors[XCURSOR_CURSOR_BOTTOM_LEFT_CORNER]  = load_cursor("bottom_left_corner");
-    cursors[XCURSOR_CURSOR_BOTTOM_RIGHT_CORNER] = load_cursor("bottom_right_corner");
+    if (xcb_cursor_context_new(conn, root_screen, &ctx) < 0) {
+        ELOG("xcursor support unavailable\n");
+        xcursor_supported = false;
+        return;
+    }
+#define LOAD_CURSOR(constant, name) \
+    do { \
+        cursors[constant] = xcb_cursor_load_cursor(ctx, name); \
+    } while (0)
+    LOAD_CURSOR(XCURSOR_CURSOR_POINTER, "left_ptr");
+    LOAD_CURSOR(XCURSOR_CURSOR_RESIZE_HORIZONTAL, "sb_h_double_arrow");
+    LOAD_CURSOR(XCURSOR_CURSOR_RESIZE_VERTICAL, "sb_v_double_arrow");
+    LOAD_CURSOR(XCURSOR_CURSOR_WATCH, "watch");
+    LOAD_CURSOR(XCURSOR_CURSOR_MOVE, "fleur");
+    LOAD_CURSOR(XCURSOR_CURSOR_TOP_LEFT_CORNER, "top_left_corner");
+    LOAD_CURSOR(XCURSOR_CURSOR_TOP_RIGHT_CORNER, "top_right_corner");
+    LOAD_CURSOR(XCURSOR_CURSOR_BOTTOM_LEFT_CORNER, "bottom_left_corner");
+    LOAD_CURSOR(XCURSOR_CURSOR_BOTTOM_RIGHT_CORNER, "bottom_right_corner");
+#undef LOAD_CURSOR
 }
 
 /*
@@ -51,19 +54,13 @@ void xcursor_load_cursors(void) {
  * This function is called when i3 is initialized, because with some login
  * managers, the root window will not have a cursor otherwise.
  *
- * We have a separate xcursor function to use the same X11 connection as the
- * xcursor_load_cursors() function. If we mix the Xlib and the XCB connection,
- * races might occur (even though we flush the Xlib connection).
- *
  */
 void xcursor_set_root_cursor(int cursor_id) {
-    XSetWindowAttributes attributes;
-    attributes.cursor = xcursor_get_cursor(cursor_id);
-    XChangeWindowAttributes(xlibdpy, DefaultRootWindow(xlibdpy), CWCursor, &attributes);
-    XFlush(xlibdpy);
+    xcb_change_window_attributes(conn, root, XCB_CW_CURSOR,
+        (uint32_t[]){ xcursor_get_cursor(cursor_id) });
 }
 
-Cursor xcursor_get_cursor(enum xcursor_cursor_t c) {
+xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c) {
     assert(c >= 0 && c < XCURSOR_CURSOR_MAX);
     return cursors[c];
 }
diff --git a/testcases/t/515-create-workspace.t b/testcases/t/515-create-workspace.t
new file mode 100644 (file)
index 0000000..be790bf
--- /dev/null
@@ -0,0 +1,40 @@
+#!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 that new workspace names are taken from the config,
+# then from the first free number starting with 1.
+#
+use i3test i3_autostart => 0;
+
+my $config = <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+fake-outputs 1024x768+0+0,1024x768+1024+0
+
+bindsym 1 workspace 1: eggs
+EOT
+my $pid = launch_with_config($config);
+
+my $i3 = i3(get_socket_path());
+my $ws = $i3->get_workspaces->recv;
+
+is($ws->[0]->{name}, '1: eggs', 'new workspace uses config name');
+is($ws->[1]->{name}, '2', 'naming continues with next free number');
+
+exit_gracefully($pid);
+
+done_testing;