Update to i3-4.7

This commit is contained in:
dcoppa 2014-01-11 16:04:43 +00:00
parent 17d31c4036
commit 2c1b362375
31 changed files with 505 additions and 480 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.74 2013/11/22 19:02:50 dcoppa Exp $
# $OpenBSD: Makefile,v 1.75 2014/01/11 16:04:43 dcoppa Exp $
COMMENT = improved dynamic tiling window manager
DISTNAME = i3-4.6
REVISION = 5
DISTNAME = i3-4.7
CATEGORIES = x11
EXTRACT_SUFX = .tar.bz2
@ -16,9 +15,10 @@ PERMIT_PACKAGE_CDROM = Yes
WANTLIB = X11 Xcursor c>=68.3 cairo ev fontconfig freetype \
glib-2.0 gobject-2.0 m pango-1.0 pangocairo-1.0 \
pangoft2-1.0 pcre startup-notification-1 xcb \
xcb-atom xcb-aux xcb-event xcb-icccm xcb-keysyms \
xcb-property xcb-randr xcb-xinerama yajl z
pangoft2-1.0 pcre pthread startup-notification-1 \
xcb xcb-atom xcb-aux xcb-event xcb-icccm \
xcb-keysyms xcb-property xcb-randr xcb-xinerama \
yajl z
MODULES = devel/gettext
@ -55,6 +55,7 @@ post-configure:
${WRKSRC}/i3-nagbar/main.c \
${WRKSRC}/i3.config \
${WRKSRC}/i3.config.keycodes \
${WRKSRC}/libi3/get_exe_path.c \
${WRKSRC}/src/commands.c \
${WRKSRC}/src/config.c

View File

@ -1,2 +1,2 @@
SHA256 (i3-4.6.tar.bz2) = 9dIRhEHOyLYj0YYQ83k8Vd+dpq8VtN+FI+hjCQlpVuE=
SIZE (i3-4.6.tar.bz2) = 891862
SHA256 (i3-4.7.tar.bz2) = 4prK/ffH00g8E+qA5FtAf2IkSzVeQlxxYf38kVyfg8U=
SIZE (i3-4.7.tar.bz2) = 896723

View File

@ -1,14 +1,25 @@
$OpenBSD: patch-common_mk,v 1.13 2012/09/21 17:16:14 dcoppa Exp $
--- common.mk.orig Wed Sep 19 18:08:09 2012
+++ common.mk Fri Sep 21 15:20:57 2012
$OpenBSD: patch-common_mk,v 1.14 2014/01/11 16:04:43 dcoppa Exp $
--- common.mk.orig Sun Dec 22 21:12:41 2013
+++ common.mk Fri Jan 10 16:40:03 2014
@@ -1,5 +1,5 @@
UNAME=$(shell uname)
-DEBUG=1
+DEBUG=0
COVERAGE=0
INSTALL=install
FLEX=flex
@@ -161,20 +161,13 @@ I3_LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/us
ifndef PREFIX
@@ -109,8 +109,8 @@ X11_CFLAGS := $(call cflags_for_lib, x11)
X11_LIBS := $(call ldflags_for_lib, x11,X11)
# Xcursor
-XCURSOR_CFLAGS := $(call cflags_for_lib, xcb-cursor)
-XCURSOR_LIBS := $(call ldflags_for_lib, xcb-cursor,xcb-cursor)
+XCURSOR_CFLAGS := $(call cflags_for_lib, xcursor)
+XCURSOR_LIBS := $(call ldflags_for_lib, xcursor,Xcursor)
# yajl
YAJL_CFLAGS := $(call cflags_for_lib, yajl)
@@ -159,20 +159,13 @@ I3_LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/us
endif
ifeq ($(UNAME),OpenBSD)

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-i3-config-wizard_main_c,v 1.8 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- i3-config-wizard/main.c.orig Sun Dec 22 21:12:41 2013
+++ i3-config-wizard/main.c Fri Jan 10 21:41:56 2014
@@ -420,7 +420,7 @@ static char *rewrite_binding(const char *input) {
/*
- * Having verboselog() and errorlog() is necessary when using libi3.
+ * Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
*
*/
void verboselog(char *fmt, ...) {
@@ -437,6 +437,9 @@ void errorlog(char *fmt, ...) {
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
+}
+
+void debuglog(char *fmt, ...) {
}
/*

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-i3-input_main_c,v 1.3 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- i3-input/main.c.orig Sun Dec 22 21:12:46 2013
+++ i3-input/main.c Fri Jan 10 21:41:56 2014
@@ -57,7 +57,7 @@ xcb_screen_t *root_screen;
static xcb_get_input_focus_cookie_t focus_cookie;
/*
- * Having verboselog() and errorlog() is necessary when using libi3.
+ * Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
*
*/
void verboselog(char *fmt, ...) {
@@ -74,6 +74,9 @@ void errorlog(char *fmt, ...) {
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
+}
+
+void debuglog(char *fmt, ...) {
}
/*

View File

@ -1,8 +1,38 @@
$OpenBSD: patch-i3-nagbar_main_c,v 1.3 2013/08/13 10:01:54 dcoppa Exp $
--- i3-nagbar/main.c.orig Wed Aug 7 20:50:24 2013
+++ i3-nagbar/main.c Mon Aug 12 15:58:31 2013
@@ -169,7 +169,7 @@ static void handle_button_release(xcb_connection_t *co
symlink(get_exe_path(argv0), link_path);
$OpenBSD: patch-i3-nagbar_main_c,v 1.4 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- i3-nagbar/main.c.orig Sun Dec 22 21:12:41 2013
+++ i3-nagbar/main.c Fri Jan 10 21:41:56 2014
@@ -61,7 +61,7 @@ xcb_connection_t *conn;
xcb_screen_t *root_screen;
/*
- * Having verboselog() and errorlog() is necessary when using libi3.
+ * Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
*
*/
void verboselog(char *fmt, ...) {
@@ -80,6 +80,9 @@ void errorlog(char *fmt, ...) {
va_end(args);
}
+void debuglog(char *fmt, ...) {
+}
+
/*
* Starts the given application by passing it through a shell. We use double fork
* to avoid zombie processes. As the started applications parent exits (immediately),
@@ -164,7 +167,7 @@ static void handle_button_release(xcb_connection_t *co
symlink(exe_path, link_path);
char *terminal_cmd;
- sasprintf(&terminal_cmd, "i3-sensible-terminal -e %s", link_path);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-i3bar_include_util_h,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- i3bar/include/util.h.orig Sun Dec 22 21:12:41 2013
+++ i3bar/include/util.h Fri Jan 10 21:41:56 2014
@@ -48,6 +48,9 @@
} \
} while (0)
+#if defined(DLOG)
+#undef DLOG
+#endif
/* Use cool logging-macros */
#define DLOG(fmt, ...) do { \
if (config.verbose) { \

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-i3bar_src_main_c,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- i3bar/src/main.c.orig Sun Dec 22 21:12:41 2013
+++ i3bar/src/main.c Fri Jan 10 21:41:56 2014
@@ -18,7 +18,7 @@
#include "common.h"
/*
- * Having verboselog() and errorlog() is necessary when using libi3.
+ * Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
*
*/
void verboselog(char *fmt, ...) {
@@ -35,6 +35,9 @@ void errorlog(char *fmt, ...) {
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
+}
+
+void debuglog(char *fmt, ...) {
}
/*

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-i3bar_src_xcb_c,v 1.12 2014/01/11 16:04:43 dcoppa Exp $
commit 23b1da598ebac70d82070abb557bef0fd3fabce9
Author: Tony Crisci <tony@dubstepdish.com>
Date: Thu Dec 26 00:30:21 2013 -0500
i3bar: Set `mapped` flag on trayclient creation
When a trayclient is first created as a structure in memory, explicitly
set the `mapped` flag to false. Otherwise it may initialize to `true` in
some circumstances without actually being mapped, causing a request to
be mapped from the client to be ignored.
Create the trayclient in memory before handling a request to be mapped
immediately.
--- i3bar/src/xcb.c.orig Sun Dec 22 21:12:41 2013
+++ i3bar/src/xcb.c Fri Jan 10 20:18:08 2014
@@ -603,17 +603,18 @@ static void handle_client_message(xcb_client_message_e
* exits/crashes. */
xcb_change_save_set(xcb_connection, XCB_SET_MODE_INSERT, client);
+ trayclient *tc = smalloc(sizeof(trayclient));
+ tc->win = client;
+ tc->xe_version = xe_version;
+ tc->mapped = false;
+ TAILQ_INSERT_TAIL(output->trayclients, tc, tailq);
+
if (map_it) {
DLOG("Mapping dock client\n");
xcb_map_window(xcb_connection, client);
} else {
DLOG("Not mapping dock client yet\n");
}
- trayclient *tc = smalloc(sizeof(trayclient));
- tc->win = client;
- tc->xe_version = xe_version;
- TAILQ_INSERT_TAIL(output->trayclients, tc, tailq);
-
/* Trigger an update to copy the statusline text to the appropriate
* position */
configure_trayclients();

View File

@ -0,0 +1,36 @@
$OpenBSD: patch-include_libi3_h,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- include/libi3.h.orig Sun Dec 22 21:12:41 2013
+++ include/libi3.h Fri Jan 10 21:41:56 2014
@@ -72,12 +72,19 @@ struct Font {
/* Since this file also gets included by utilities which dont use the i3 log
* infrastructure, we define a fallback. */
#if !defined(LOG)
-void verboselog(char *fmt, ...);
+void verboselog(char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
#define LOG(fmt, ...) verboselog("[libi3] " __FILE__ " " fmt, ##__VA_ARGS__)
#endif
#if !defined(ELOG)
-void errorlog(char *fmt, ...);
+void errorlog(char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
#define ELOG(fmt, ...) errorlog("[libi3] ERROR: " fmt, ##__VA_ARGS__)
+#endif
+#if !defined(DLOG)
+void debuglog(char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
+#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif
/**

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-include_log_h,v 1.4 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- include/log.h.orig Sun Dec 22 21:12:41 2013
+++ include/log.h Fri Jan 10 21:41:56 2014
@@ -21,6 +21,9 @@
#if defined(ELOG)
#undef ELOG
#endif
+#if defined(DLOG)
+#undef DLOG
+#endif
/** ##__VA_ARGS__ means: leave out __VA_ARGS__ completely if it is empty, that
is, delete the preceding comma */
#define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__)

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-include_window_h,v 1.3 2013/09/25 09:58:14 dcoppa Exp $
commit 1a1d42153408822d267d0cb4718b22d8ff116f27
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Sep 24 07:47:36 2013 +0200
Bugfix: correctly recognize assigned windows as urgent
--- include/window.h.orig Wed Aug 7 20:50:24 2013
+++ include/window.h Wed Sep 25 11:37:50 2013
@@ -61,6 +61,6 @@ void window_update_role(i3Window *win, xcb_get_propert
* Updates the WM_HINTS (we only care about the input focus handling part).
*
*/
-void window_update_hints(i3Window *win, xcb_get_property_reply_t *prop);
+void window_update_hints(i3Window *win, xcb_get_property_reply_t *prop, bool *urgency_hint);
#endif

View File

@ -1,30 +0,0 @@
$OpenBSD: patch-include_x_h,v 1.1 2013/09/02 06:15:34 dcoppa Exp $
commit 103ab83131d30614ea9337e752548a834773bfc6
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Aug 27 20:21:11 2013 +0200
Revert "raise fullscreen windows on top of all other X11 windows"
This reverts commit 0659a0d98ca98fcd134c277c6a61ca3c9a04544e.
It was a fix for dzen2 setups, but broke several other use cases.
Because dzen2 is not really important since most people use i3bar
nowadays, let's revert this.
--- include/x.h.orig Wed Aug 7 20:50:24 2013
+++ include/x.h Mon Sep 2 07:42:58 2013
@@ -93,12 +93,8 @@ void x_push_changes(Con *con);
* Raises the specified container in the internal stack of X windows. The
* next call to x_push_changes() will make the change visible in X11.
*
- * If above_all is true, the X11 window will be raised to the top
- * of the stack. This should only be used for precisely one fullscreen
- * window per output.
- *
*/
-void x_raise_con(Con *con, bool above_all);
+void x_raise_con(Con *con);
/**
* Sets the WM_NAME property (so, no UTF8, but used only for debugging anyways)

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-include_xcursor_h,v 1.3 2014/01/11 16:04:43 dcoppa Exp $
Revert to libXcursor
--- include/xcursor.h.orig Sun Dec 22 21:12:41 2013
+++ include/xcursor.h Fri Jan 10 16:43:33 2014
@@ -10,7 +10,7 @@
#ifndef I3_XCURSOR_CURSOR_H
#define I3_XCURSOR_CURSOR_H
-#include <xcb/xcb_cursor.h>
+#include <X11/Xlib.h>
enum xcursor_cursor_t {
XCURSOR_CURSOR_POINTER = 0,
@@ -26,7 +26,7 @@ enum xcursor_cursor_t {
};
void xcursor_load_cursors(void);
-xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c);
+Cursor xcursor_get_cursor(enum xcursor_cursor_t c);
int xcursor_get_xcb_cursor(enum xcursor_cursor_t c);
/**

View File

@ -0,0 +1,39 @@
$OpenBSD: patch-libi3_font_c,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- libi3/font.c.orig Sun Dec 22 21:12:41 2013
+++ libi3/font.c Fri Jan 10 21:41:56 2014
@@ -30,6 +30,10 @@ static double pango_font_red;
static double pango_font_green;
static double pango_font_blue;
+/* Necessary to track whether the dpi changes and trigger a LOG() message,
+ * which is more easily visible to users. */
+static double logged_dpi = 0.0;
+
static PangoLayout *create_layout_with_dpi(cairo_t *cr) {
PangoLayout *layout;
PangoContext *context;
@@ -37,7 +41,12 @@ static PangoLayout *create_layout_with_dpi(cairo_t *cr
context = pango_cairo_create_context(cr);
const double dpi = (double)root_screen->height_in_pixels * 25.4 /
(double)root_screen->height_in_millimeters;
- LOG("X11 root window dictates %f DPI\n", dpi);
+ if (logged_dpi != dpi) {
+ logged_dpi = dpi;
+ LOG("X11 root window dictates %f DPI\n", dpi);
+ } else {
+ DLOG("X11 root window dictates %f DPI\n", dpi);
+ }
pango_cairo_context_set_resolution(context, dpi);
layout = pango_layout_new(context);
g_object_unref(context);

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-libi3_get_exe_path_c,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
--- libi3/get_exe_path.c.orig Fri Jan 10 18:23:37 2014
+++ libi3/get_exe_path.c Fri Jan 10 18:31:19 2014
@@ -97,5 +97,5 @@ char *get_exe_path(const char *argv0) {
free(tmp);
/* Last resort: maybe its in /usr/bin? */
- return sstrdup("/usr/bin/i3-nagbar");
+ return sstrdup("${TRUEPREFIX}/bin/i3-nagbar");
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-man_i3-dmenu-desktop_1,v 1.1 2013/05/16 18:42:30 dcoppa Exp $
--- man/i3-dmenu-desktop.1.orig Wed May 15 09:09:28 2013
+++ man/i3-dmenu-desktop.1 Wed May 15 09:12:05 2013
@@ -89,7 +89,7 @@ notifications.
$OpenBSD: patch-man_i3-dmenu-desktop_1,v 1.2 2014/01/11 16:04:43 dcoppa Exp $
--- man/i3-dmenu-desktop.1.orig Sun Dec 22 21:12:52 2013
+++ man/i3-dmenu-desktop.1 Fri Jan 10 16:31:33 2014
@@ -98,7 +98,7 @@ notifications.
.PP
The .desktop files are searched in \f(CW$XDG_DATA_HOME\fR/applications (by default
\&\f(CW$HOME\fR/.local/share/applications) and in the \*(L"applications\*(R" subdirectory of each
@ -10,9 +10,9 @@ $OpenBSD: patch-man_i3-dmenu-desktop_1,v 1.1 2013/05/16 18:42:30 dcoppa Exp $
.PP
Files with the same name in \f(CW$XDG_DATA_HOME\fR/applications take precedence over
files in \f(CW$XDG_DATA_DIRS\fR, so that you can overwrite parts of the system-wide
@@ -103,7 +103,7 @@ file respectively) by appending it to the name of the
@@ -112,7 +112,7 @@ file respectively) by appending it to the name of the
want to launch \*(L"\s-1GNU\s0 Emacs 24\*(R" with the patch /tmp/foobar.txt, you would type
\&\*(L"emacs\*(R", press \s-1TAB\s0, type \*(L" /tmp/foobar.txt\*(R" and press \s-1ENTER\s0.
\&\*(L"emacs\*(R", press \s-1TAB,\s0 type \*(L" /tmp/foobar.txt\*(R" and press \s-1ENTER.\s0
.PP
-\&.desktop files with Terminal=true are started using \fIi3\-sensible\-terminal\fR\|(1).
+\&.desktop files with Terminal=true are started using \fIxterm\fR\|(1).

View File

@ -1,12 +1,19 @@
$OpenBSD: patch-man_i3-dump-log_1,v 1.1 2013/06/02 11:24:06 dcoppa Exp $
--- man/i3-dump-log.1.orig Thu May 23 13:55:30 2013
+++ man/i3-dump-log.1 Thu May 23 13:56:12 2013
@@ -31,7 +31,7 @@
$OpenBSD: patch-man_i3-dump-log_1,v 1.2 2014/01/11 16:04:43 dcoppa Exp $
--- man/i3-dump-log.1.orig Sun Dec 22 21:12:52 2013
+++ man/i3-dump-log.1 Fri Jan 10 17:03:23 2014
@@ -31,14 +31,12 @@
i3-dump-log \- dumps the i3 SHM log
.SH "SYNOPSIS"
.sp
-i3\-dump\-log [\-s <socketpath>]
-i3\-dump\-log [\-s <socketpath>] [\-f]
+i3\-dump\-log [\-hVv]
.SH "DESCRIPTION"
.sp
Debug versions of i3 automatically use 1% of your RAM (but 25 MiB max) to store full debug log output\&. This is extremely helpful for bugreports and figuring out what is going on, without permanently logging to a file\&.
.sp
With i3\-dump\-log, you can dump the SHM log to stdout\&.
-.sp
-The \-f flag works like tail \-f, i\&.e\&. the process does not terminate after dumping the log, but prints new lines as they appear\&.
.SH "EXAMPLE"
.sp
i3\-dump\-log | gzip \-9 > /tmp/i3\-log\&.gz

View File

@ -1,15 +1,15 @@
$OpenBSD: patch-man_i3-migrate-config-to-v4_1,v 1.9 2013/08/13 10:01:55 dcoppa Exp $
$OpenBSD: patch-man_i3-migrate-config-to-v4_1,v 1.10 2014/01/11 16:04:43 dcoppa Exp $
Fix fatal error: "argument count wrong: line arguments >= 2 (have 1)"
--- man/i3-migrate-config-to-v4.1.orig Mon Mar 18 22:43:47 2013
+++ man/i3-migrate-config-to-v4.1 Mon May 13 08:27:23 2013
@@ -7,7 +7,7 @@
.\" Source: i3 4.6
.\" Source: i3 4.7
.\" Language: English
.\"
-.TH "I3\-MIGRATE\-CONFIG\" "1" "08/07/2013" "i3 4\&.6" "i3 Manual"
+.TH "I3\-MIGRATE\-CONFIG" "1" "08/07/2013" "i3 4\&.6" "i3 Manual"
-.TH "I3\-MIGRATE\-CONFIG\" "1" "12/22/2013" "i3 4\&.7" "i3 Manual"
+.TH "I3\-MIGRATE\-CONFIG" "1" "12/22/2013" "i3 4\&.7" "i3 Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------

View File

@ -1,14 +1,7 @@
$OpenBSD: patch-src_commands_c,v 1.8 2013/08/13 10:01:56 dcoppa Exp $
commit 69d7adcf499aa716586e4b920dfd60e10f9233b0
Author: Franck Michea <franck.michea@gmail.com>
Date: Mon Jul 29 22:45:27 2013 +0200
Add missing return after error reporting.
--- src/commands.c.orig Wed Aug 7 20:50:24 2013
+++ src/commands.c Mon Aug 12 16:00:47 2013
@@ -175,7 +175,7 @@ void cmd_MIGRATION_start_nagbar(void) {
$OpenBSD: patch-src_commands_c,v 1.9 2014/01/11 16:04:43 dcoppa Exp $
--- src/commands.c.orig Sun Dec 22 21:12:41 2013
+++ src/commands.c Fri Jan 10 16:31:33 2014
@@ -194,7 +194,7 @@ void cmd_MIGRATION_start_nagbar(void) {
/* child */
if (migration_pid == 0) {
char *pageraction;
@ -17,11 +10,3 @@ Add missing return after error reporting.
char *argv[] = {
NULL, /* will be replaced by the executable path */
"-t",
@@ -1796,6 +1796,7 @@ void cmd_move_window_to_center(I3_CMD, char *method) {
ystr("error");
ystr("Cannot change position. The window/container is not floating.");
y(map_close);
+ return;
}
if (strcmp(method, "absolute") == 0) {

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-src_con_c,v 1.12 2013/11/22 19:02:50 dcoppa Exp $
commit 57822e3ed43c011ad8d28c09b31c014cd930fe9b
Author: Tony Crisci <tony@dubstepdish.com>
Date: Fri Nov 22 10:00:49 2013 -0500
Remove-child callback skips output content cons
Every container 'above' (in the hierarchy) the workspace content should
not be closed when the last child was removed.
Add a check for output content containers and do not handle them. These
cons are at the root of the output container with dockarea siblings.
They may be run through this callback when an output is killed with
RandR.
Fixes an issue that caused content cons to become urgent when the output
is killed with RandR.
--- src/con.c.orig Wed Aug 7 20:50:24 2013
+++ src/con.c Fri Nov 22 19:50:19 2013
@@ -1354,8 +1354,9 @@ static void con_on_remove_child(Con *con) {
* not be closed when the last child was removed */
if (con->type == CT_OUTPUT ||
con->type == CT_ROOT ||
- con->type == CT_DOCKAREA) {
- DLOG("not handling, type = %d\n", con->type);
+ con->type == CT_DOCKAREA ||
+ (con->parent != NULL && con->parent->type == CT_OUTPUT)) {
+ DLOG("not handling, type = %d, name = %s\n", con->type, con->name);
return;
}

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_floating_c,v 1.19 2014/01/11 16:04:43 dcoppa Exp $
Revert to libXcursor
--- src/floating.c.orig Sun Dec 22 21:12:41 2013
+++ src/floating.c Fri Jan 10 16:40:03 2014
@@ -583,7 +583,7 @@ drag_result_t drag_pointer(Con *con, const xcb_button_
if (con != NULL)
memcpy(&old_rect, &(con->rect), sizeof(Rect));
- xcb_cursor_t xcursor = (cursor && xcursor_supported) ?
+ Cursor xcursor = (cursor && xcursor_supported) ?
xcursor_get_cursor(cursor) : XCB_NONE;
/* Grab the pointer */

View File

@ -1,119 +0,0 @@
$OpenBSD: patch-src_handlers_c,v 1.16 2013/10/10 16:34:58 dcoppa Exp $
commit 0b168ee499e6065969ddd3359f95dfdf7e14350c
Author: Kacper Kowalik (Xarthisius) <xarthisius@gentoo.org>
Date: Thu Aug 8 20:48:21 2013 +0200
Include float.h for DBL_EPSILON
commit 93463bc3932e820bc86383fc4de1a07c82356967
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Fri Aug 30 19:59:57 2013 +0200
Bugfix: update root geometry on output changes for "fullscreen global"
commit 05e46848f07460f18574d51eba0b182b177ab2d2
Author: Tony Crisci <tony@dubstepdish.com>
Date: Wed Oct 9 12:49:15 2013 -0400
Reply to _NET_REQUEST_FRAME_EXTENTS correctly
Reply to _NET_REQUEST_FRAME_EXTENTS by settings _NET_FRAME_EXTENTS
property of the window to the widths of the respective borders added
by i3.
commit 1a1d42153408822d267d0cb4718b22d8ff116f27
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Sep 24 07:47:36 2013 +0200
Bugfix: correctly recognize assigned windows as urgent
--- src/handlers.c.orig Wed Aug 7 20:50:24 2013
+++ src/handlers.c Thu Oct 10 18:11:55 2013
@@ -13,6 +13,7 @@
#include "all.h"
#include <time.h>
+#include <float.h>
#include <sys/time.h>
#include <xcb/randr.h>
#include <X11/XKBlib.h>
@@ -422,6 +423,19 @@ int handle_configure_event(void *prophs, xcb_connectio
static void handle_screen_change(xcb_generic_event_t *e) {
DLOG("RandR screen change\n");
+ /* The geometry of the root window is used for "fullscreen global" and
+ * changes when new outputs are added. */
+ xcb_get_geometry_cookie_t cookie = xcb_get_geometry(conn, root);
+ xcb_get_geometry_reply_t *reply = xcb_get_geometry_reply(conn, cookie, NULL);
+ if (reply == NULL) {
+ ELOG("Could not get geometry of the root window, exiting\n");
+ exit(1);
+ }
+ DLOG("root geometry reply: (%d, %d) %d x %d\n", reply->x, reply->y, reply->width, reply->height);
+
+ croot->rect.width = reply->width;
+ croot->rect.height = reply->height;
+
randr_query_outputs();
scratchpad_fix_resolution();
@@ -703,24 +717,13 @@ static void handle_client_message(xcb_client_message_e
// says the application must cope with an estimate that is not entirely
// accurate.
DLOG("_NET_REQUEST_FRAME_EXTENTS for window 0x%08x\n", event->window);
- xcb_get_geometry_reply_t *geometry;
- xcb_get_geometry_cookie_t cookie = xcb_get_geometry(conn, event->window);
- if (!(geometry = xcb_get_geometry_reply(conn, cookie, NULL))) {
- ELOG("Could not get geometry of X11 window 0x%08x while handling "
- "the _NET_REQUEST_FRAME_EXTENTS ClientMessage\n",
- event->window);
- return;
- }
-
- DLOG("Current geometry = x=%d, y=%d, width=%d, height=%d\n",
- geometry->x, geometry->y, geometry->width, geometry->height);
-
+ /* The reply data: approximate frame size */
Rect r = {
- 0, // left
- geometry->width + 4, // right
- 0, // top
- geometry->height + config.font.height + 5, // bottom
+ config.default_border_width, /* left */
+ config.default_border_width, /* right */
+ config.font.height + 5, /* top */
+ config.default_border_width /* bottom */
};
xcb_change_property(
conn,
@@ -869,24 +872,13 @@ static bool handle_hints(void *data, xcb_connection_t
return false;
}
- xcb_icccm_wm_hints_t hints;
-
+ bool urgency_hint;
if (reply == NULL)
- if (!(reply = xcb_get_property_reply(conn, xcb_icccm_get_wm_hints(conn, window), NULL)))
- return false;
-
- if (!xcb_icccm_get_wm_hints_from_reply(&hints, reply))
- return false;
-
- /* Update the flag on the client directly */
- bool hint_urgent = (xcb_icccm_wm_hints_get_urgency(&hints) != 0);
- con_set_urgency(con, hint_urgent);
-
+ reply = xcb_get_property_reply(conn, xcb_icccm_get_wm_hints(conn, window), NULL);
+ window_update_hints(con->window, reply, &urgency_hint);
+ con_set_urgency(con, urgency_hint);
tree_render();
- if (con->window)
- window_update_hints(con->window, reply);
- else free(reply);
return true;
}

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-src_log_c,v 1.6 2013/08/13 10:01:57 dcoppa Exp $
$OpenBSD: patch-src_log_c,v 1.7 2014/01/11 16:04:43 dcoppa Exp $
OpenBSD lacks pthread_condattr_setpshared()
OpenBSD lacks pthread_condattr_setpshared() and posix_fallocate()
--- src/log.c.orig Wed Aug 7 20:50:24 2013
+++ src/log.c Mon Aug 12 15:24:01 2013
--- src/log.c.orig Sun Dec 22 21:12:41 2013
+++ src/log.c Fri Jan 10 16:48:15 2014
@@ -20,7 +20,9 @@
#include <sys/mman.h>
#include <sys/stat.h>
@ -14,7 +14,16 @@ OpenBSD lacks pthread_condattr_setpshared()
#if defined(__APPLE__)
#include <sys/types.h>
#include <sys/sysctl.h>
@@ -148,11 +150,13 @@ void open_logbuffer(void) {
@@ -129,7 +131,7 @@ void open_logbuffer(void) {
return;
}
-#if defined(__APPLE__)
+#if defined(__OpenBSD__) || defined(__APPLE__)
if (ftruncate(logbuffer_shm, logbuffer_size) == -1) {
fprintf(stderr, "Could not ftruncate SHM segment for the i3 log: %s\n", strerror(errno));
#else
@@ -154,11 +156,13 @@ void open_logbuffer(void) {
header = (i3_shmlog_header*)logbuffer;
@ -28,7 +37,7 @@ OpenBSD lacks pthread_condattr_setpshared()
logwalk = logbuffer + sizeof(i3_shmlog_header);
loglastwrap = logbuffer + logbuffer_size;
@@ -258,8 +262,10 @@ static void vlog(const bool print, const char *fmt, va
@@ -264,8 +268,10 @@ static void vlog(const bool print, const char *fmt, va
store_log_markers();

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-src_manage_c,v 1.13 2013/09/25 09:58:14 dcoppa Exp $
commit 1a1d42153408822d267d0cb4718b22d8ff116f27
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Sep 24 07:47:36 2013 +0200
Bugfix: correctly recognize assigned windows as urgent
--- src/manage.c.orig Wed Aug 7 20:50:24 2013
+++ src/manage.c Wed Sep 25 11:37:50 2013
@@ -220,7 +220,8 @@ void manage_window(xcb_window_t window, xcb_get_window
window_update_transient_for(cwindow, xcb_get_property_reply(conn, transient_cookie, NULL));
window_update_strut_partial(cwindow, xcb_get_property_reply(conn, strut_cookie, NULL));
window_update_role(cwindow, xcb_get_property_reply(conn, role_cookie, NULL), true);
- window_update_hints(cwindow, xcb_get_property_reply(conn, wm_hints_cookie, NULL));
+ bool urgency_hint;
+ window_update_hints(cwindow, xcb_get_property_reply(conn, wm_hints_cookie, NULL), &urgency_hint);
xcb_get_property_reply_t *startup_id_reply;
startup_id_reply = xcb_get_property_reply(conn, startup_id_cookie, NULL);
@@ -468,6 +469,12 @@ void manage_window(xcb_window_t window, xcb_get_window
/* Send an event about window creation */
ipc_send_window_new_event(nc);
+
+ /* Windows might get managed with the urgency hint already set (Pidgin is
+ * known to do that), so check for that and handle the hint accordingly.
+ * This code needs to be in this part of manage_window() because the window
+ * needs to be on the final workspace first. */
+ con_set_urgency(nc, urgency_hint);
geom_out:
free(geom);

View File

@ -1,79 +0,0 @@
$OpenBSD: patch-src_render_c,v 1.5 2013/09/02 06:15:34 dcoppa Exp $
commit 103ab83131d30614ea9337e752548a834773bfc6
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Aug 27 20:21:11 2013 +0200
Revert "raise fullscreen windows on top of all other X11 windows"
This reverts commit 0659a0d98ca98fcd134c277c6a61ca3c9a04544e.
It was a fix for dzen2 setups, but broke several other use cases.
Because dzen2 is not really important since most people use i3bar
nowadays, let's revert this.
--- src/render.c.orig Wed Aug 7 20:50:24 2013
+++ src/render.c Mon Sep 2 07:42:58 2013
@@ -70,7 +70,7 @@ static void render_l_output(Con *con) {
Con *fullscreen = con_get_fullscreen_con(ws, CF_OUTPUT);
if (fullscreen) {
fullscreen->rect = con->rect;
- x_raise_con(fullscreen, true);
+ x_raise_con(fullscreen);
render_con(fullscreen, true);
return;
}
@@ -110,7 +110,7 @@ static void render_l_output(Con *con) {
DLOG("child at (%d, %d) with (%d x %d)\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height);
- x_raise_con(child, false);
+ x_raise_con(child);
render_con(child, false);
}
}
@@ -208,7 +208,7 @@ void render_con(Con *con, bool render_fullscreen) {
}
if (fullscreen) {
fullscreen->rect = rect;
- x_raise_con(fullscreen, false);
+ x_raise_con(fullscreen);
render_con(fullscreen, true);
return;
}
@@ -299,7 +299,7 @@ void render_con(Con *con, bool render_fullscreen) {
}
DLOG("floating child at (%d,%d) with %d x %d\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height);
- x_raise_con(child, false);
+ x_raise_con(child);
render_con(child, false);
}
}
@@ -408,7 +408,7 @@ void render_con(Con *con, bool render_fullscreen) {
DLOG("child at (%d, %d) with (%d x %d)\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height);
- x_raise_con(child, false);
+ x_raise_con(child);
render_con(child, false);
i++;
}
@@ -416,7 +416,7 @@ void render_con(Con *con, bool render_fullscreen) {
/* in a stacking or tabbed container, we ensure the focused client is raised */
if (con->layout == L_STACKED || con->layout == L_TABBED) {
TAILQ_FOREACH_REVERSE(child, &(con->focus_head), focus_head, focused)
- x_raise_con(child, false);
+ x_raise_con(child);
if ((child = TAILQ_FIRST(&(con->focus_head)))) {
/* By rendering the stacked container again, we handle the case
* that we have a non-leaf-container inside the stack. In that
@@ -430,7 +430,7 @@ void render_con(Con *con, bool render_fullscreen) {
* top of every stack window. That way, when a new window is opened in
* the stack, the old window will not obscure part of the decoration
* (its unmapped afterwards). */
- x_raise_con(con, false);
+ x_raise_con(con);
}
}
}

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-src_startup_c,v 1.3 2013/08/16 11:39:49 dcoppa Exp $
$OpenBSD: patch-src_startup_c,v 1.4 2014/01/11 16:04:43 dcoppa Exp $
On OpenBSD, time_t is long long.
--- src/startup.c.orig Wed Aug 7 20:50:24 2013
+++ src/startup.c Fri Aug 16 13:18:23 2013
@@ -104,8 +104,8 @@ static int _prune_startup_sequences(void) {
--- src/startup.c.orig Sun Dec 22 21:12:41 2013
+++ src/startup.c Fri Jan 10 16:31:33 2014
@@ -105,8 +105,8 @@ static int _prune_startup_sequences(void) {
*/
void startup_sequence_delete(struct Startup_Sequence *sequence) {
assert(sequence != NULL);
@ -15,7 +15,7 @@ On OpenBSD, time_t is long long.
/* Unref the context, will be free()d */
sn_launcher_context_unref(sequence->context);
@@ -246,8 +246,8 @@ void startup_monitor_event(SnMonitorEvent *event, void
@@ -239,8 +239,8 @@ void startup_monitor_event(SnMonitorEvent *event, void
/* Mark the given sequence for deletion in 30 seconds. */
time_t current_time = time(NULL);
sequence->delete_at = current_time + 30;

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_tree_c,v 1.7 2013/09/02 06:15:34 dcoppa Exp $
commit 2481b9dcd73e91969033abb2b6f83aed608aeea1
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Sun Sep 1 13:35:04 2013 +0200
Bugfix: don't flatten tabbed/stacked containers
--- src/tree.c.orig Wed Aug 7 20:50:24 2013
+++ src/tree.c Mon Sep 2 07:53:09 2013
@@ -702,6 +702,8 @@ void tree_flatten(Con *con) {
* the cons parent to be redundant */
if (!con_is_split(con) ||
!con_is_split(child) ||
+ (con->layout != L_SPLITH && con->layout != L_SPLITV) ||
+ (child->layout != L_SPLITH && child->layout != L_SPLITV) ||
con_orientation(con) == con_orientation(child) ||
con_orientation(child) != con_orientation(parent))
goto recurse;

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-src_window_c,v 1.3 2013/09/25 09:58:15 dcoppa Exp $
commit 1a1d42153408822d267d0cb4718b22d8ff116f27
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Sep 24 07:47:36 2013 +0200
Bugfix: correctly recognize assigned windows as urgent
--- src/window.c.orig Wed Aug 7 20:50:24 2013
+++ src/window.c Wed Sep 25 11:37:50 2013
@@ -228,7 +228,10 @@ void window_update_role(i3Window *win, xcb_get_propert
* Updates the WM_HINTS (we only care about the input focus handling part).
*
*/
-void window_update_hints(i3Window *win, xcb_get_property_reply_t *prop) {
+void window_update_hints(i3Window *win, xcb_get_property_reply_t *prop, bool *urgency_hint) {
+ if (urgency_hint != NULL)
+ *urgency_hint = false;
+
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
DLOG("WM_HINTS not set.\n");
FREE(prop);
@@ -245,6 +248,9 @@ void window_update_hints(i3Window *win, xcb_get_proper
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);
free(prop);
}

View File

@ -1,54 +0,0 @@
$OpenBSD: patch-src_x_c,v 1.14 2013/09/02 06:15:34 dcoppa Exp $
commit 103ab83131d30614ea9337e752548a834773bfc6
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Aug 27 20:21:11 2013 +0200
Revert "raise fullscreen windows on top of all other X11 windows"
This reverts commit 0659a0d98ca98fcd134c277c6a61ca3c9a04544e.
It was a fix for dzen2 setups, but broke several other use cases.
Because dzen2 is not really important since most people use i3bar
nowadays, let's revert this.
--- src/x.c.orig Wed Aug 7 20:50:24 2013
+++ src/x.c Mon Sep 2 07:42:58 2013
@@ -36,7 +36,6 @@ typedef struct con_state {
bool mapped;
bool unmap_now;
bool child_mapped;
- bool above_all;
/** The con for which this state is. */
Con *con;
@@ -900,10 +899,6 @@ void x_push_changes(Con *con) {
xcb_configure_window(conn, prev->id, mask, values);
}
- if (state->above_all) {
- DLOG("above all: 0x%08x\n", state->id);
- xcb_configure_window(conn, state->id, XCB_CONFIG_WINDOW_STACK_MODE, (uint32_t[]){ XCB_STACK_MODE_ABOVE });
- }
state->initial = false;
}
@@ -1029,17 +1024,11 @@ void x_push_changes(Con *con) {
* Raises the specified container in the internal stack of X windows. The
* next call to x_push_changes() will make the change visible in X11.
*
- * If above_all is true, the X11 window will be raised to the top
- * of the stack. This should only be used for precisely one fullscreen
- * window per output.
- *
*/
-void x_raise_con(Con *con, bool above_all) {
+void x_raise_con(Con *con) {
con_state *state;
state = state_for_frame(con->frame);
//DLOG("raising in new stack: %p / %s / %s / xid %08x\n", con, con->name, con->window ? con->window->name_json : "", state->id);
-
- state->above_all = above_all;
CIRCLEQ_REMOVE(&state_head, state, state);
CIRCLEQ_INSERT_HEAD(&state_head, state, state);

View File

@ -0,0 +1,86 @@
$OpenBSD: patch-src_xcursor_c,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
Revert to libXcursor
--- src/xcursor.c.orig Sun Dec 22 21:12:41 2013
+++ src/xcursor.c Fri Jan 10 18:00:16 2014
@@ -10,14 +10,14 @@
*
*/
#include <assert.h>
-#include <xcb/xcb_cursor.h>
+#include <X11/Xcursor/Xcursor.h>
+#include <X11/cursorfont.h>
#include "i3.h"
#include "xcb.h"
#include "xcursor.h"
-static xcb_cursor_context_t *ctx;
-static xcb_cursor_t cursors[XCURSOR_CURSOR_MAX];
+static Cursor cursors[XCURSOR_CURSOR_MAX];
static const int xcb_cursors[XCURSOR_CURSOR_MAX] = {
XCB_CURSOR_LEFT_PTR,
@@ -26,28 +26,27 @@ static const int xcb_cursors[XCURSOR_CURSOR_MAX] = {
XCB_CURSOR_WATCH
};
-void xcursor_load_cursors(void) {
- if (xcb_cursor_context_new(conn, root_screen, &ctx) < 0) {
+static Cursor load_cursor(const char *name) {
+ Cursor c = XcursorLibraryLoadCursor(xlibdpy, name);
+ if (c == None) {
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
+ 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");
+}
+
/*
* Sets the cursor of the root window to the 'pointer' cursor.
*
@@ -56,11 +55,13 @@ void xcursor_load_cursors(void) {
*
*/
void xcursor_set_root_cursor(int cursor_id) {
- xcb_change_window_attributes(conn, root, XCB_CW_CURSOR,
- (uint32_t[]){ xcursor_get_cursor(cursor_id) });
+ XSetWindowAttributes attributes;
+ attributes.cursor = xcursor_get_cursor(cursor_id);
+ XChangeWindowAttributes(xlibdpy, DefaultRootWindow(xlibdpy), CWCursor, &attributes);
+ XFlush(xlibdpy);
}
-xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c) {
+Cursor xcursor_get_cursor(enum xcursor_cursor_t c) {
assert(c >= 0 && c < XCURSOR_CURSOR_MAX);
return cursors[c];
}