Major update to i3-4.1

This commit is contained in:
dcoppa 2011-12-01 16:00:01 +00:00
parent 213abb2bae
commit 9db4a18991
41 changed files with 665 additions and 840 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.19 2011/11/06 20:23:24 dcoppa Exp $
# $OpenBSD: Makefile,v 1.20 2011/12/01 16:00:01 dcoppa Exp $
COMMENT = improved dynamic tiling window manager
DISTNAME = i3-4.0.2
DISTNAME = i3-4.1
CATEGORIES = x11
@ -20,10 +20,13 @@ PERMIT_DISTFILES_FTP = Yes
WANTLIB += X11 Xcursor c ev m xcb xcb-atom xcb-aux
WANTLIB += xcb-event xcb-icccm xcb-keysyms
WANTLIB += xcb-property xcb-randr xcb-xinerama yajl
WANTLIB += pcre startup-notification-1
MODULES = converters/libiconv
LIB_DEPENDS = devel/libev \
devel/libyajl>=2.0.0
devel/libyajl>=2.0.0 \
devel/pcre \
devel/startup-notification
BUILD_DEPENDS = devel/bison \
devel/flex
RUN_DEPENDS = x11/dmenu
@ -45,11 +48,19 @@ FAKE_FLAGS = PREFIX=${PREFIX} \
pre-configure:
${SUBST_CMD} ${WRKSRC}/i3.config \
${WRKSRC}/i3.config.keycodes \
${WRKSRC}/src/config.c
${WRKSRC}/src/cfgparse.y \
${WRKSRC}/src/config.c
post-install:
@rm -f ${WRKBUILD}/man/i3-wsbar.1
${INSTALL_MAN} ${WRKBUILD}/{i3bar/doc,man}/*.1 \
${PREFIX}/man/man1/
${SUBST_CMD} -o ${SHAREOWN} -g ${SHAREGRP} \
-c ${WRKBUILD}/man/i3-config-wizard.1 \
${PREFIX}/man/man1/i3-config-wizard.1
${SUBST_CMD} -o ${SHAREOWN} -g ${SHAREGRP} \
-c ${WRKBUILD}/man/i3.1 \
${PREFIX}/man/man1/i3.1
@rm -f ${PREFIX}/man/man1/i3-wsbar.1 \
${PREFIX}/man/man1/i3-sensible*.1
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (i3-4.0.2.tar.bz2) = ixc1BIJNMSqVTMsysJKwaA==
RMD160 (i3-4.0.2.tar.bz2) = Sl6s7G8SsPsV9sGycRUgs9nUF0I=
SHA1 (i3-4.0.2.tar.bz2) = M3OaYGsGJW9xqgVRaHM24BZEoNU=
SHA256 (i3-4.0.2.tar.bz2) = 5laXfahqBRscEDJ8yk9AChynzL0GcOowfywb4cEm/EY=
SIZE (i3-4.0.2.tar.bz2) = 475512
MD5 (i3-4.1.tar.bz2) = GgXWBWJFBsK0ufEnL9hKWg==
RMD160 (i3-4.1.tar.bz2) = G3hYmV4iR+V9dOIxQ4ex/VIxvs8=
SHA1 (i3-4.1.tar.bz2) = 6KpR0yAos/B2uXhcS0aRG1C6aZY=
SHA256 (i3-4.1.tar.bz2) = O08h2b9m+ORYhSHfpwbYzD/hmZl2pV+1psE6YhoUVaA=
SIZE (i3-4.1.tar.bz2) = 564086

View File

@ -1,18 +1,21 @@
$OpenBSD: patch-Makefile,v 1.4 2011/11/06 20:23:25 dcoppa Exp $
--- Makefile.orig Wed Sep 14 11:28:41 2011
+++ Makefile Wed Sep 14 11:34:03 2011
@@ -22,24 +22,19 @@ SUBDIRS=i3-msg i3-input i3-nagbar i3-config-wizard i3b
$OpenBSD: patch-Makefile,v 1.5 2011/12/01 16:00:01 dcoppa Exp $
--- Makefile.orig Fri Nov 11 23:41:20 2011
+++ Makefile Thu Dec 1 14:48:23 2011
@@ -22,13 +22,11 @@ SUBDIRS:=i3-msg i3-input i3-nagbar i3-config-wizard i3
# Depend on the specific file (.c for each .o) and on all headers
src/%.o: src/%.c ${HEADERS}
- echo "CC $<"
- echo "[i3] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="((uint64_t)1 << $(shell awk '/$(shell basename $< .c)/ { print NR; exit 0; }' loglevels.tmp))" -c -o $@ $<
all: i3 subdirs
i3: src/cfgparse.y.o src/cfgparse.yy.o src/cmdparse.y.o src/cmdparse.yy.o ${FILES}
- echo "LINK i3"
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
i3: libi3/libi3.a src/cfgparse.y.o src/cfgparse.yy.o src/cmdparse.y.o src/cmdparse.yy.o ${FILES}
- echo "[i3] LINK i3"
$(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
libi3/%.a: libi3/*.c
@@ -36,13 +34,10 @@ libi3/%.a: libi3/*.c
subdirs:
for dir in $(SUBDIRS); do \
@ -22,45 +25,48 @@ $OpenBSD: patch-Makefile,v 1.4 2011/11/06 20:23:25 dcoppa Exp $
done
loglevels.h:
- echo "LOGLEVELS"
- echo "[i3] LOGLEVELS"
for file in $$(ls src/*.c src/*.y src/*.l | grep -v 'cfgparse.\(tab\|yy\).c'); \
do \
echo $$(basename $$file .c); \
@@ -51,40 +46,35 @@ loglevels.h:
@@ -54,43 +49,34 @@ loglevels.h:
echo "};") > include/loglevels.h;
src/cfgparse.yy.o: src/cfgparse.l src/cfgparse.y.o ${HEADERS}
- echo "LEX $<"
- echo "[i3] LEX $<"
- flex -i -o$(@:.o=.c) $<
+ gflex -i -o$(@:.o=.c) $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.l/ { print NR }' loglevels.tmp))" -c -o $@ $(@:.o=.c)
src/cmdparse.yy.o: src/cmdparse.l src/cmdparse.y.o ${HEADERS}
- echo "LEX $<"
- echo "[i3] LEX $<"
- flex -Pcmdyy -i -o$(@:.o=.c) $<
+ gflex -Pcmdyy -i -o$(@:.o=.c) $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cmdparse.l/ { print NR }' loglevels.tmp))" -c -o $@ $(@:.o=.c)
src/cfgparse.y.o: src/cfgparse.y ${HEADERS}
- echo "YACC $<"
- echo "[i3] YACC $<"
bison --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.y/ { print NR }' loglevels.tmp))" -c -o $@ $(<:.y=.tab.c)
src/cmdparse.y.o: src/cmdparse.y ${HEADERS}
- echo "YACC $<"
- echo "[i3] YACC $<"
bison -p cmdyy --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cmdparse.y/ { print NR }' loglevels.tmp))" -c -o $@ $(<:.y=.tab.c)
install: all
- echo "INSTALL"
- echo "[i3] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/i3
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/include/i3
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions
- $(INSTALL) -m 0755 i3 $(DESTDIR)$(PREFIX)/bin/
- $(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/
- 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.welcome $(DESTDIR)$(SYSCONFDIR)/i3/welcome
@ -70,13 +76,12 @@ $OpenBSD: patch-Makefile,v 1.4 2011/11/06 20:23:25 dcoppa Exp $
+ ${INSTALL_SCRIPT} i3-migrate-config-to-v4 $(DESTDIR)$(PREFIX)/bin/
+ test -e $(DESTDIR)$(SYSCONFDIR)/i3/config || ${INSTALL_DATA} i3.config $(DESTDIR)$(SYSCONFDIR)/i3/config
+ test -e $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes || ${INSTALL_DATA} i3.config.keycodes $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes
+ ${INSTALL_DATA} i3.welcome $(DESTDIR)$(SYSCONFDIR)/i3/welcome
+ ${INSTALL_DATA} i3.desktop $(DESTDIR)$(PREFIX)/share/xsessions/
+ ${INSTALL_DATA} include/i3/ipc.h $(DESTDIR)$(PREFIX)/include/i3/
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install; \
done
@@ -120,16 +110,12 @@ clean:
@@ -127,16 +113,12 @@ clean:
$(MAKE) -C docs clean
$(MAKE) -C man clean
for dir in $(SUBDIRS); do \

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-common_mk,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
--- common.mk.orig Sun Aug 28 19:48:21 2011
+++ common.mk Mon Oct 31 16:23:50 2011
@@ -1,75 +1,31 @@
$OpenBSD: patch-common_mk,v 1.6 2011/12/01 16:00:01 dcoppa Exp $
--- common.mk.orig Fri Nov 11 23:41:26 2011
+++ common.mk Wed Nov 30 16:51:08 2011
@@ -1,90 +1,30 @@
UNAME=$(shell uname)
-DEBUG=1
+DEBUG=0
@ -18,20 +18,26 @@ $OpenBSD: patch-common_mk,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
- endif
+ SYSCONFDIR=/etc
endif
-TERM_EMU=xterm
+TERM_EMU=${X11BASE}/bin/xterm
# The escaping is absurd, but we need to escape for shell, sed, make, define
GIT_VERSION:="4.0.2 (2011-08-28, branch \\\"release-4.0.2\\\")"
VERSION:=4.0.2
GIT_VERSION:="4.1 (2011-11-11, branch \\\"release-4.1\\\")"
VERSION:=4.1
-ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
-$(error "pkg-config was not found")
-endif
-
-# An easier way to get CFLAGS and LDFLAGS falling back in case there's
-# no pkg-config support for certain libraries
-cflags_for_lib = $(shell pkg-config --silence-errors --cflags $(1))
-ldflags_for_lib = $(shell pkg-config --exists $(1) && pkg-config --libs $(1) || echo -l$(2))
-# no pkg-config support for certain libraries.
-#
-# NOTE that you must not use a blank after comma when calling this:
-# $(call ldflags_for_lib name, fallback) # bad
-# $(call ldflags_for_lib name,fallback) # good
-# Otherwise, the compiler will get -l foo instead of -lfoo
-#
-# 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 += -std=c99
CFLAGS += -pipe
@ -41,7 +47,7 @@ $OpenBSD: patch-common_mk,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
CFLAGS += -Wunused-value
-CFLAGS += -Iinclude
-CFLAGS += $(call cflags_for_lib, xcb-keysyms)
-ifeq ($(shell pkg-config --exists xcb-util || echo 1),1)
-ifeq ($(shell pkg-config --exists xcb-util 2>/dev/null || echo 1),1)
+CFLAGS += -I$(TOPDIR)/include
CPPFLAGS += -DXCB_COMPAT
-CFLAGS += $(call cflags_for_lib, xcb-atom)
@ -57,44 +63,52 @@ $OpenBSD: patch-common_mk,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
-CFLAGS += $(call cflags_for_lib, x11)
-CFLAGS += $(call cflags_for_lib, yajl)
-CFLAGS += $(call cflags_for_lib, libev)
-CFLAGS += $(call cflags_for_lib, libpcre)
-CFLAGS += $(call cflags_for_lib, libstartup-notification-1.0)
CPPFLAGS += -DI3_VERSION=\"${GIT_VERSION}\"
CPPFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\"
CPPFLAGS += -DTERM_EMU=\"$(TERM_EMU)\"
-
-ifeq ($(shell pkg-config --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
CPPFLAGS += -DPCRE_HAS_UCP=1
-endif
-LIBS += -lm
-LIBS += $(call ldflags_for_lib, xcb-event, xcb-event)
-LIBS += $(call ldflags_for_lib, xcb-keysyms, xcb-keysyms)
-ifeq ($(shell pkg-config --exists xcb-util || echo 1),1)
-LIBS += $(call ldflags_for_lib, xcb-atom, xcb-atom)
-LIBS += $(call ldflags_for_lib, xcb-aux, xcb-aux)
-LIBS += -L $(TOPDIR)/libi3 -li3
-LIBS += $(call ldflags_for_lib, xcb-event,xcb-event)
-LIBS += $(call ldflags_for_lib, xcb-keysyms,xcb-keysyms)
-ifeq ($(shell pkg-config --exists xcb-util 2>/dev/null || echo 1),1)
-LIBS += $(call ldflags_for_lib, xcb-atom,xcb-atom)
-LIBS += $(call ldflags_for_lib, xcb-aux,xcb-aux)
-else
-LIBS += $(call ldflags_for_lib, xcb-util)
-endif
-LIBS += $(call ldflags_for_lib, xcb-icccm, xcb-icccm)
-LIBS += $(call ldflags_for_lib, xcb-xinerama, xcb-xinerama)
-LIBS += $(call ldflags_for_lib, xcb-randr, xcb-randr)
-LIBS += $(call ldflags_for_lib, xcb, xcb)
-LIBS += $(call ldflags_for_lib, xcursor, Xcursor)
-LIBS += $(call ldflags_for_lib, x11, X11)
-LIBS += $(call ldflags_for_lib, yajl, yajl)
-LIBS += $(call ldflags_for_lib, libev, ev)
+LIBS += -lX11 -lXcursor -lev -lm -lxcb -lxcb-atom -lxcb-aux -lxcb-event -lxcb-icccm -lxcb-keysyms -lxcb-property -lxcb-randr -lxcb-xinerama -lyajl
-LIBS += $(call ldflags_for_lib, xcb-icccm,xcb-icccm)
-LIBS += $(call ldflags_for_lib, xcb-xinerama,xcb-xinerama)
-LIBS += $(call ldflags_for_lib, xcb-randr,xcb-randr)
-LIBS += $(call ldflags_for_lib, xcb,xcb)
-LIBS += $(call ldflags_for_lib, xcursor,Xcursor)
-LIBS += $(call ldflags_for_lib, x11,X11)
-LIBS += $(call ldflags_for_lib, yajl,yajl)
-LIBS += $(call ldflags_for_lib, libev,ev)
-LIBS += $(call ldflags_for_lib, libpcre,pcre)
-LIBS += $(call ldflags_for_lib, libstartup-notification-1.0,startup-notification-1)
+LIBS += -L$(TOPDIR)/libi3 -li3 -lX11 -lXcursor -lev -lm -lxcb -lxcb-atom -lxcb-aux -lxcb-event -lxcb-icccm -lxcb-keysyms -lxcb-property -lxcb-randr -lxcb-xinerama -lyajl -lpcre -lstartup-notification-1
# Please test if -Wl,--as-needed works on your platform and send me a patch.
# it is known not to work on Darwin (Mac OS X)
@@ -84,9 +40,9 @@ LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/p
@@ -99,9 +39,9 @@ LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/p
endif
ifeq ($(UNAME),OpenBSD)
-CFLAGS += -I${X11BASE}/include
+CFLAGS += -I${X11BASE}/include -I${LOCALBASE}/include
+CFLAGS += -I${X11BASE}/include -I${LOCALBASE}/include -I${LOCALBASE}/include/startup-notification-1.0
LIBS += -liconv
-LDFLAGS += -L${X11BASE}/lib
+LDFLAGS += -L${X11BASE}/lib -L${LOCALBASE}/lib
endif
ifeq ($(UNAME),FreeBSD)
@@ -118,9 +74,6 @@ ifeq ($(COVERAGE),1)
@@ -133,9 +73,6 @@ ifeq ($(COVERAGE),1)
CFLAGS += -fprofile-arcs -ftest-coverage
LIBS += -lgcov
endif

View File

@ -1,33 +1,36 @@
$OpenBSD: patch-i3-config-wizard_Makefile,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
--- i3-config-wizard/Makefile.orig Wed Sep 14 12:32:31 2011
+++ i3-config-wizard/Makefile Wed Sep 14 12:33:33 2011
@@ -10,30 +10,25 @@ HEADERS:=$(wildcard *.h)
$OpenBSD: patch-i3-config-wizard_Makefile,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
--- i3-config-wizard/Makefile.orig Wed Nov 30 16:07:46 2011
+++ i3-config-wizard/Makefile Wed Nov 30 16:08:51 2011
@@ -12,33 +12,28 @@ CPPFLAGS += -I$(TOPDIR)/include
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "CC $<"
- echo "[i3-config-wizard] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-config-wizard
i3-config-wizard: cfgparse.y.o cfgparse.yy.o ${FILES}
- echo "LINK i3-config-wizard"
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
i3-config-wizard: $(TOPDIR)/libi3/libi3.a cfgparse.y.o cfgparse.yy.o ${FILES}
- echo "[i3-config-wizard] LINK i3-config-wizard"
$(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
$(MAKE) -C $(TOPDIR)/libi3
cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS}
- echo "LEX $<"
- echo "[i3-config-wizard] LEX $<"
- flex -i -o$(@:.o=.c) $<
+ gflex -i -o$(@:.o=.c) $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(@:.o=.c)
cfgparse.y.o: cfgparse.y ${HEADERS}
- echo "YACC $<"
- echo "[i3-config-wizard] YACC $<"
bison --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)
install: all
- echo "INSTALL"
- echo "[i3-config-wizard] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 i3-config-wizard $(DESTDIR)$(PREFIX)/bin/
+ ${INSTALL_PROGRAM} i3-config-wizard $(DESTDIR)$(PREFIX)/bin/

View File

@ -1,12 +1,12 @@
$OpenBSD: patch-i3-config-wizard_main_c,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-i3-config-wizard_main_c,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
getline() is a GNU extension
--- i3-config-wizard/main.c.orig Wed Sep 14 12:16:22 2011
+++ i3-config-wizard/main.c Wed Sep 14 12:22:41 2011
@@ -74,6 +74,47 @@ Display *dpy;
char *rewrite_binding(const char *bindingline);
static void finish();
--- i3-config-wizard/main.c.orig Fri Nov 11 23:41:20 2011
+++ i3-config-wizard/main.c Wed Nov 30 15:44:09 2011
@@ -296,6 +296,47 @@ static void finish() {
fputs("# this file and re-run i3-config-wizard(1).\n", ks_config);
fputs("#\n", ks_config);
+#if defined(__OpenBSD__)
+
@ -50,5 +50,5 @@ getline() is a GNU extension
+#endif
+
#if defined(__APPLE__)
/*
while ((line = fgetln(kc_config, &len)) != NULL) {
#else

View File

@ -1,21 +1,24 @@
$OpenBSD: patch-i3-input_Makefile,v 1.2 2011/11/06 20:23:25 dcoppa Exp $
--- i3-input/Makefile.orig Wed Sep 14 12:33:42 2011
+++ i3-input/Makefile Wed Sep 14 12:34:12 2011
@@ -9,19 +9,16 @@ HEADERS=$(wildcard *.h)
$OpenBSD: patch-i3-input_Makefile,v 1.3 2011/12/01 16:00:01 dcoppa Exp $
--- i3-input/Makefile.orig Wed Nov 30 16:30:45 2011
+++ i3-input/Makefile Wed Nov 30 16:31:17 2011
@@ -11,22 +11,19 @@ HEADERS=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "CC $<"
- echo "[i3-input] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-input
i3-input: ${FILES}
- echo "LINK i3-input"
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
i3-input: $(TOPDIR)/libi3/libi3.a ${FILES}
- echo "[i3-input] LINK i3-input"
$(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
$(MAKE) -C $(TOPDIR)/libi3
install: all
- echo "INSTALL"
- echo "[i3-input] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/
+ ${INSTALL_PROGRAM} i3-input $(DESTDIR)$(PREFIX)/bin/

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-i3-msg_Makefile,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
--- i3-msg/Makefile.orig Sun Aug 28 19:48:13 2011
+++ i3-msg/Makefile Mon Oct 31 16:32:23 2011
$OpenBSD: patch-i3-msg_Makefile,v 1.4 2011/12/01 16:00:01 dcoppa Exp $
--- i3-msg/Makefile.orig Wed Nov 30 16:31:25 2011
+++ i3-msg/Makefile Wed Nov 30 16:32:50 2011
@@ -3,27 +3,22 @@ TOPDIR=..
include $(TOPDIR)/common.mk
@ -13,17 +13,17 @@ $OpenBSD: patch-i3-msg_Makefile,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "CC $<"
- echo "[i3-msg] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-msg
i3-msg: ${FILES}
- echo "LINK i3-msg"
- echo "[i3-msg] LINK i3-msg"
$(CC) $(LDFLAGS) -o i3-msg ${FILES} $(LIBS)
install: all
- echo "INSTALL"
- echo "[i3-msg] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 i3-msg $(DESTDIR)$(PREFIX)/bin/
+ ${INSTALL_PROGRAM} i3-msg $(DESTDIR)$(PREFIX)/bin/

View File

@ -1,21 +1,24 @@
$OpenBSD: patch-i3-nagbar_Makefile,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
--- i3-nagbar/Makefile.orig Wed Sep 14 12:34:56 2011
+++ i3-nagbar/Makefile Wed Sep 14 12:35:16 2011
@@ -9,19 +9,16 @@ HEADERS=$(wildcard *.h)
$OpenBSD: patch-i3-nagbar_Makefile,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
--- i3-nagbar/Makefile.orig Wed Nov 30 16:33:10 2011
+++ i3-nagbar/Makefile Wed Nov 30 16:33:30 2011
@@ -11,22 +11,19 @@ HEADERS=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "CC $<"
- echo "[i3-nagbar] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-nagbar
i3-nagbar: ${FILES}
- echo "LINK i3-nagbar"
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
i3-nagbar: $(TOPDIR)/libi3/libi3.a ${FILES}
- echo "[i3-nagbar] LINK i3-nagbar"
$(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
$(MAKE) -C $(TOPDIR)/libi3
install: all
- echo "INSTALL"
- echo "[i3-nagbar] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 i3-nagbar $(DESTDIR)$(PREFIX)/bin/
+ ${INSTALL_PROGRAM} i3-nagbar $(DESTDIR)$(PREFIX)/bin/

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-i3_config,v 1.4 2011/11/06 20:23:25 dcoppa Exp $
--- i3.config.orig Sun Aug 28 19:48:13 2011
+++ i3.config Sat Nov 5 22:59:31 2011
$OpenBSD: patch-i3_config,v 1.5 2011/12/01 16:00:01 dcoppa Exp $
--- i3.config.orig Fri Nov 11 23:41:20 2011
+++ i3.config Thu Dec 1 14:37:51 2011
@@ -9,6 +9,8 @@
# layout, use the i3-config-wizard
#
@ -14,7 +14,7 @@ $OpenBSD: patch-i3_config,v 1.4 2011/11/06 20:23:25 dcoppa Exp $
floating_modifier Mod1
# start a terminal
-bindsym Mod1+Return exec urxvt
-bindsym Mod1+Return exec i3-sensible-terminal
+bindsym Mod1+Return exec ${X11BASE}/bin/xterm
# kill focused window
@ -26,13 +26,17 @@ $OpenBSD: patch-i3_config,v 1.4 2011/11/06 20:23:25 dcoppa Exp $
# change focus
bindsym Mod1+j focus left
@@ -145,17 +147,5 @@ mode "resize" {
@@ -145,19 +147,7 @@ mode "resize" {
bindsym Mod1+r mode "resize"
-# Start i3bar to display a workspace bar (plus the system information i3status
-# finds out, if available)
-exec i3status | i3bar -d
+# Start i3bar to display a workspace bar
bar {
- status_command i3status
+ status_command /usr/bin/true
}
-
-#######################################################################
-# automatically start i3-config-wizard to offer the user to create a
@ -44,5 +48,3 @@ $OpenBSD: patch-i3_config,v 1.4 2011/11/06 20:23:25 dcoppa Exp $
-# Please remove the following exec line:
-#######################################################################
-exec i3-config-wizard
+# Start i3bar to display a workspace bar
+exec ${TRUEPREFIX}/bin/i3bar -d

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-i3_config_keycodes,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
--- i3.config.keycodes.orig Wed Sep 14 13:31:09 2011
+++ i3.config.keycodes Wed Sep 14 13:34:07 2011
$OpenBSD: patch-i3_config_keycodes,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
--- i3.config.keycodes.orig Fri Nov 11 23:41:20 2011
+++ i3.config.keycodes Thu Dec 1 14:38:38 2011
@@ -17,13 +17,13 @@ font -misc-fixed-medium-r-normal--13-120-75-75-C-70-is
floating_modifier $mod
# start a terminal
-bindcode $mod+36 exec urxvt
-bindcode $mod+36 exec i3-sensible-terminal
+bindcode $mod+36 exec ${X11BASE}/bin/xterm
# kill focused window
@ -17,12 +17,14 @@ $OpenBSD: patch-i3_config_keycodes,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
# change focus
bindcode $mod+44 focus left
@@ -146,6 +146,5 @@ mode "resize" {
@@ -146,8 +146,7 @@ mode "resize" {
bindcode $mod+27 mode "resize"
-# Start i3bar to display a workspace bar (plus the system information i3status
-# finds out, if available)
-exec i3status | i3bar -d
+# Start i3bar to display a workspace bar
+exec ${TRUEPREFIX}/bin/i3bar -d
bar {
- status_command i3status
+ status_command /usr/bin/true
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-i3bar_Makefile,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
--- i3bar/Makefile.orig Sun Aug 28 19:48:13 2011
+++ i3bar/Makefile Mon Oct 31 16:30:58 2011
@@ -6,27 +6,22 @@ FILES:=$(wildcard src/*.c)
$OpenBSD: patch-i3bar_Makefile,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
--- i3bar/Makefile.orig Wed Nov 30 16:33:43 2011
+++ i3bar/Makefile Wed Nov 30 16:34:56 2011
@@ -6,30 +6,25 @@ FILES:=$(wildcard src/*.c)
FILES:=$(FILES:.c=.o)
HEADERS:=$(wildcard include/*.h)
@ -10,21 +10,24 @@ $OpenBSD: patch-i3bar_Makefile,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
all: i3bar doc
i3bar: ${FILES}
- echo "LINK"
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
i3bar: $(TOPDIR)/libi3/libi3.a ${FILES}
- echo "[i3bar] LINK"
$(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
$(MAKE) -C $(TOPDIR)/libi3
doc:
- echo ""
- echo "SUBDIR doc"
- echo "[i3bar] SUBDIR doc"
$(MAKE) -C doc
src/%.o: src/%.c ${HEADERS}
- echo "CC $<"
- echo "[i3bar] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
install: all
- echo "INSTALL"
- echo "[i3bar] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 i3bar $(DESTDIR)$(PREFIX)/bin
+ ${INSTALL_PROGRAM} i3bar $(DESTDIR)$(PREFIX)/bin

View File

@ -1,52 +1,13 @@
$OpenBSD: patch-i3bar_doc_i3bar_1,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-i3bar_doc_i3bar_1,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
bugfix: double-dash in font name got scrambled by a2x
(upstream git commit a5938c40738c51097b4b802f0b5ee409681b4771)
fix "AUTHOR" section
fix "AUTHOR" garbage and various tyops
--- i3bar/doc/i3bar.1.orig Sun Aug 28 19:48:30 2011
+++ i3bar/doc/i3bar.1 Sun Nov 6 13:38:01 2011
@@ -42,7 +42,7 @@ Specifies the
connects to
\fBi3\fR(1)\&. If
\fBi3bar\fR
-can not connect to
+cannot connect to
\fBi3\fR, it will exit\&. Defaults to
\fI/tmp/i3\-ipc\&.sock\fR
.RE
@@ -53,7 +53,7 @@ Execute
\fI<command>\fR
to get
\fIstdin\fR\&. You can also simply pipe into
-\fIstdin\fR, but starting the coomand for itself,
+\fIstdin\fR, but starting the command for itself,
\fBi3bar\fR
is able to send
\fISIGCONT\fR
@@ -91,7 +91,7 @@ Specifies a
\fIX\-core\-font\fR
to use\&. You can choose one with
\fBxfontsel\fR(1)\&. Defaults to
-\fI\-misc\-fixed\-medium\-r\-semicondensed\(em12\-110\-75\-75\-c\-60\-iso10646\-1\fR\&.
+\fI\-misc\-fixed\-medium\-r\-semicondensed\-\-12\-110\-75\-75\-c\-60\-iso10646\-1\fR\&.
.RE
.PP
\fB\-V, \-\-verbose\fR
@@ -106,7 +106,7 @@ Display a short help\-message and exit
.RE
.SH "DESCRIPTION"
--- i3bar/doc/i3bar.1.orig Thu Dec 1 14:57:52 2011
+++ i3bar/doc/i3bar.1 Thu Dec 1 15:01:19 2011
@@ -79,12 +79,6 @@ Instead, see the i3 documentation, especially the User
i3status(1) or conky(1) for programs generating a statusline\&.
.sp
-\fBi3bar\fR is an xcb\- and libev\-based status\- and ws\-bar\&. It is best thought of as an replacement for the \fBi3\-wsbar\fR(1) + \fBdzen2\fR(1)\-combination\&. It creates a workspace\-bar for every active output ("screen") and displays a piped in statusline rightaligned on every bar\&.
+\fBi3bar\fR is an xcb\- and libev\-based status\- and ws\-bar\&. It is best thought of as a replacement for the \fBi3\-wsbar\fR(1) + \fBdzen2\fR(1)\-combination\&. It creates a workspace\-bar for every active output ("screen") and displays a piped in statusline rightaligned on every bar\&.
.sp
It does not sample any status\-information itself, so you still need a program like \fBi3status\fR(1) or \fBconky\fR(1) for that\&.
.sp
@@ -144,12 +144,6 @@ If you want it to hide when not needed, you should ins
.SH "SEE ALSO"
.sp
i3(1), i3\-wsbar(1), dzen2(1), i3status(1)
dzen2(1) or xmobar(1) for similar programs to i3bar\&.
-.SH "AUTHORS"
+.SH "AUTHOR"
.sp

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-i3bar_src_xcb_c,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: check if the X11 connection is unavailable
(upstream git commit 7064cfc2a07c71a6efce8462e40e789ef8d90908)
--- i3bar/src/xcb.c.orig Sun Aug 28 19:48:13 2011
+++ i3bar/src/xcb.c Mon Oct 31 12:44:02 2011
@@ -406,6 +406,12 @@ void xcb_prep_cb(struct ev_loop *loop, ev_prepare *wat
*/
void xcb_chk_cb(struct ev_loop *loop, ev_check *watcher, int revents) {
xcb_generic_event_t *event;
+
+ if (xcb_connection_has_error(xcb_connection)) {
+ ELOG("X11 connection was closed unexpectedly - maybe your X server terminated / crashed?\n");
+ exit(1);
+ }
+
while ((event = xcb_poll_for_event(xcb_connection)) == NULL) {
return;
}

View File

@ -1,16 +1,21 @@
$OpenBSD: patch-include_con_h,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-include_con_h,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
bugfix: don't fix floating coordinates when reassigning - fixes
flickering (upstream git commit 6b541d382b89de18104202e5820f466725d77576)
Bugfix: retain absolute window position and size when changing
floating borders (git commit 970d11709e99aab7db13a2fd28a758a68a4137dc)
--- include/con.h.orig Sun Aug 28 19:48:13 2011
+++ include/con.h Fri Nov 4 16:03:27 2011
@@ -144,7 +144,7 @@ void con_toggle_fullscreen(Con *con, int fullscreen_mo
* TODO: is there a better place for this function?
*
*/
-void con_move_to_workspace(Con *con, Con *workspace, bool dont_warp);
+void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp);
--- include/con.h.orig Fri Nov 11 23:41:20 2011
+++ include/con.h Thu Dec 1 13:45:23 2011
@@ -234,6 +234,13 @@ Rect con_border_style_rect(Con *con);
int con_border_style(Con *con);
/**
* Returns the orientation of the given container (for stacked containers,
+ * Sets the given border style on con, correctly keeping the position/size of a
+ * floating window.
+ *
+ */
+void con_set_border_style(Con *con, int border_style);
+
+/**
* This function changes the layout of a given container. Use it to handle
* special cases like changing a whole workspace to stacked/tabbed (creates a
* new split container before).

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-include_ewmh_h,v 1.1 2011/12/01 16:00:01 dcoppa Exp $
Do not set the _NET_WM_WORKAREA hint: fix incorrect transient
geometry with wxwidgets
(upstream git commit d25e77ce7597bf0736c610a04185c8c27694c890)
--- include/ewmh.h.orig Fri Nov 11 23:41:20 2011
+++ include/ewmh.h Thu Dec 1 14:07:37 2011
@@ -29,16 +29,6 @@ void ewmh_update_current_desktop();
void ewmh_update_active_window(xcb_window_t window);
/**
- * Updates the workarea for each desktop.
- *
- * EWMH: Contains a geometry for each desktop. These geometries specify an area
- * that is completely contained within the viewport. Work area SHOULD be used by
- * desktop applications to place desktop icons appropriately.
- *
- */
-void ewmh_update_workarea();
-
-/**
* Updates the _NET_CLIENT_LIST_STACKING hint. Necessary to move tabs in
* Chromium correctly.
*

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-include_tree_h,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
--- include/tree.h.orig Sun Aug 28 19:48:13 2011
+++ include/tree.h Fri Nov 4 16:04:30 2011
@@ -71,7 +71,7 @@ void tree_next(char way, orientation_t orientation);
* and the window is expected to kill itself.
*
*/
-bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent);
+bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool force_set_focus);
/**
* Loads tree from ~/.i3/_restart.json (used for in-place restarts).

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-include_xcb_h,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
bugfix: send the correct X11 border_width in faked ConfigureNotifys
(upstream git commit deab3ac33864875476476093b5e835dfcce31497)
--- include/xcb.h.orig Sun Aug 28 19:48:13 2011
+++ include/xcb.h Mon Oct 31 12:44:02 2011
@@ -108,7 +108,7 @@ void xcb_draw_rect(xcb_connection_t *conn, xcb_drawabl
* The truth is, however, that we will manage them.
*
*/
-void fake_configure_notify(xcb_connection_t *conn, Rect r, xcb_window_t window);
+void fake_configure_notify(xcb_connection_t *conn, Rect r, xcb_window_t window, int border_width);
/**
* Generates a configure_notify_event with absolute coordinates (relative to

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-include_xcursor_h,v 1.1 2011/12/01 16:00:01 dcoppa Exp $
Fix prototype (git commit 0ea64ae404c38391aa50ec91dbcebdbda9cac833)
--- include/xcursor.h.orig Thu Dec 1 13:31:31 2011
+++ include/xcursor.h Thu Dec 1 13:32:46 2011
@@ -35,6 +35,6 @@ int xcursor_get_xcb_cursor(enum xcursor_cursor_t c);
* races might occur (even though we flush the Xlib connection).
*
*/
-void xcursor_set_root_cursor();
+void xcursor_set_root_cursor(int cursor_id);
#endif

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-libi3_Makefile,v 1.1 2011/12/01 16:00:01 dcoppa Exp $
--- libi3/Makefile.orig Wed Nov 30 16:49:35 2011
+++ libi3/Makefile Wed Nov 30 16:49:50 2011
@@ -11,13 +11,11 @@ HEADERS=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "[libi3] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: libi3.a
libi3.a: ${FILES}
- echo "[libi3] AR libi3.a"
ar rcs libi3.a ${FILES}
clean:

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-man_Makefile,v 1.1 2011/12/01 16:00:01 dcoppa Exp $
--- man/Makefile.orig Wed Nov 30 16:54:53 2011
+++ man/Makefile Wed Nov 30 16:55:25 2011
@@ -1,6 +1,6 @@
A2M:=a2x -f manpage --asciidoc-opts="-f asciidoc.conf"
-all: i3.1 i3-msg.1 i3-input.1 i3-nagbar.1 i3-wsbar.1 i3-config-wizard.1 i3-migrate-config-to-v4.1 i3-sensible-editor.1 i3-sensible-pager.1 i3-sensible-terminal.1
+all: i3.1 i3-msg.1 i3-input.1 i3-nagbar.1 i3-wsbar.1 i3-config-wizard.1 i3-migrate-config-to-v4.1
%.1: %.man asciidoc.conf
${A2M} $<

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-man_i3-config-wizard_1,v 1.1 2011/12/01 16:00:01 dcoppa Exp $
--- man/i3-config-wizard.1.orig Thu Dec 1 15:05:38 2011
+++ man/i3-config-wizard.1 Thu Dec 1 15:09:23 2011
@@ -33,12 +33,12 @@ i3-config-wizard \- creates a keysym based config base
.sp
i3\-config\-wizard
.SH "FILES"
-.SS "/etc/i3/config\&.keycodes"
+.SS "${SYSCONFDIR}/i3/config\&.keycodes"
.sp
This file contains the default configuration with keycodes\&. All the bindcode lines will be transformed to bindsym and the user\-specified modifier will be used\&.
.SH "DESCRIPTION"
.sp
-i3\-config\-wizard is started by i3 in its default config, unless /\&.i3/config exists\&. i3\-config\-wizard creates a keysym based i3 config file (based on /etc/i3/config\&.keycodes) in /\&.i3/config\&.
+i3\-config\-wizard is started by i3 in its default config, unless /\&.i3/config exists\&. i3\-config\-wizard creates a keysym based i3 config file (based on ${SYSCONFDIR}/i3/config\&.keycodes) in /\&.i3/config\&.
.sp
The advantage of using keysyms is that the config file is easy to read, understand and modify\&. However, if we shipped with a keysym based default config file, the key positions would not be consistent across different keyboard layouts (take for example the homerow for movement)\&. Therefore, we ship with a keycode based default config and let the wizard transform it according to your current keyboard layout\&.
.SH "SEE ALSO"

View File

@ -1,15 +1,15 @@
$OpenBSD: patch-man_i3-migrate-config-to-v4_1,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-man_i3-migrate-config-to-v4_1,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
fix fatal error
--- man/i3-migrate-config-to-v4.1.orig Wed Sep 14 14:22:38 2011
+++ man/i3-migrate-config-to-v4.1 Wed Sep 14 14:22:51 2011
--- man/i3-migrate-config-to-v4.1.orig Wed Nov 30 16:43:58 2011
+++ man/i3-migrate-config-to-v4.1 Wed Nov 30 16:44:25 2011
@@ -7,7 +7,7 @@
.\" Source: i3 4.0.2
.\" Source: i3 4.1
.\" Language: English
.\"
-.TH "I3\-MIGRATE\-CONFIG\" "1" "08/28/2011" "i3 4\&.0\&.2" "i3 Manual"
+.TH "I3\-MIGRATE\-CONFIG" "1" "08/28/2011" "i3 4\&.0\&.2" "i3 Manual"
-.TH "I3\-MIGRATE\-CONFIG\" "1" "11/11/2011" "i3 4\&.1" "i3 Manual"
+.TH "I3\-MIGRATE\-CONFIG" "1" "11/11/2011" "i3 4\&.1" "i3 Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------

View File

@ -0,0 +1,46 @@
$OpenBSD: patch-man_i3_1,v 1.3 2011/12/01 16:00:01 dcoppa Exp $
--- man/i3.1.orig Thu Dec 1 15:05:48 2011
+++ man/i3.1 Thu Dec 1 15:11:55 2011
@@ -213,7 +213,7 @@ When starting, i3 looks for configuration files in the
.sp -1
.IP " 2." 4.2
.\}
-/etc/xdg/i3/config (or $XDG_CONFIG_DIRS/i3/config if set)
+${SYSCONFDIR}/xdg/i3/config (or $XDG_CONFIG_DIRS/i3/config if set)
.RE
.sp
.RS 4
@@ -235,7 +235,7 @@ When starting, i3 looks for configuration files in the
.sp -1
.IP " 4." 4.2
.\}
-/etc/i3/config
+${SYSCONFDIR}/i3/config
.RE
.sp
You can specify a custom path using the \-c option\&.
@@ -255,13 +255,13 @@ font \-misc\-fixed\-medium\-r\-normal\-\-13\-120\-75\-
floating_modifier Mod1
# start a terminal
-bindsym Mod1+Return exec /usr/bin/urxvt
+bindsym Mod1+Return exec ${X11BASE}/bin/xterm
# kill focused window
bindsym Mod1+Shift+q kill
# start dmenu (a program launcher)
-bindsym Mod1+d exec /usr/bin/dmenu_run
+bindsym Mod1+d exec ${LOCALBASE}/bin/dmenu_run
# change focus
bindsym Mod1+j focus left
@@ -384,7 +384,7 @@ ulimit \-c unlimited
# Start i3 and log to ~/\&.i3/logfile
echo "Starting at $(date)" >> ~/\&.i3/logfile
-exec /usr/bin/i3 \-V \-d all >> ~/\&.i3/logfile
+exec ${TRUEPREFIX}/bin/i3 \-V \-d all >> ~/\&.i3/logfile
.fi
.if n \{\
.RE

View File

@ -1,63 +1,14 @@
$OpenBSD: patch-src_cfgparse_y,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
bugfix: properly free memory/close fd upon errors
(upstream git commit e1631d6320cf6b47c3b46f0b56ae970986c9c20c)
bugfix: correctly split key/value when parsing variables
(upstream git commit e1949aa69421ff6e8a540eb505ac5d00dee403a0)
bugfix: boundary checking when replacing variables
(upstream git commits cd6c3fedcb89b8ae995ca1afac2789aef5567de8 and
77ae3cd8f77e4e255e823b07cd8b50d28b38e03b)
bugfix: ignore for_window commands with empty (invalid) criteria
(upstream git commit 2a215fd7e22f5d8e9f82fb5a1d610e56afa99fe7)
--- src/cfgparse.y.orig Sun Aug 28 19:48:13 2011
+++ src/cfgparse.y Mon Oct 31 12:44:02 2011
@@ -188,6 +188,7 @@ static char *migrate_config(char *input, off_t size) {
ret = read(readpipe[0], converted + read_bytes, conv_size - read_bytes);
if (ret == -1) {
warn("Cannot read from pipe");
+ FREE(converted);
return NULL;
}
read_bytes += ret;
@@ -357,12 +358,14 @@ void parse_file(const char *f) {
/* get key/value for this variable */
char *v_key = value, *v_value;
- if ((v_value = strstr(value, " ")) == NULL &&
- (v_value = strstr(value, "\t")) == NULL) {
+ if (strstr(value, " ") == NULL && strstr(value, "\t") == NULL) {
ELOG("Malformed variable assignment, need a value\n");
continue;
}
+ if (!(v_value = strstr(value, " ")))
+ v_value = strstr(value, "\t");
+
*(v_value++) = '\0';
struct Variable *new = scalloc(sizeof(struct Variable));
@@ -387,7 +390,8 @@ void parse_file(const char *f) {
int extra = (strlen(current->value) - strlen(current->key));
char *next;
for (next = bufcopy;
- (next = strcasestr(bufcopy + (next - bufcopy), current->key)) != NULL;
+ next < (bufcopy + stbuf.st_size) &&
+ (next = strcasestr(next, current->key)) != NULL;
next += strlen(current->key)) {
*next = '_';
extra_bytes += extra;
@@ -658,6 +662,10 @@ bindsym:
for_window:
TOK_FOR_WINDOW match command
{
+ if (match_is_empty(&current_match)) {
+ ELOG("Match is empty, ignoring this for_window statement\n");
+ break;
+ }
printf("\t should execute command %s for the criteria mentioned above\n", $3);
Assignment *assignment = scalloc(sizeof(Assignment));
assignment->type = A_COMMAND;
$OpenBSD: patch-src_cfgparse_y,v 1.4 2011/12/01 16:00:01 dcoppa Exp $
--- src/cfgparse.y.orig Fri Nov 11 23:41:20 2011
+++ src/cfgparse.y Wed Nov 30 17:01:02 2011
@@ -284,8 +284,8 @@ static void start_configerror_nagbar(const char *confi
if (configerror_pid == 0) {
char *editaction,
*pageraction;
- sasprintf(&editaction, "i3-sensible-terminal -e sh -c \"i3-sensible-editor \\\"%s\\\" && i3-msg reload\"", config_path);
- sasprintf(&pageraction, "i3-sensible-terminal -e i3-sensible-pager \"%s\"", errorfilename);
+ sasprintf(&editaction, "${X11BASE}/bin/xterm -e sh -c \"/usr/bin/vi \\\"%s\\\" && i3-msg reload\"", config_path);
+ sasprintf(&pageraction, "${X11BASE}/bin/xterm -e /usr/bin/less \"%s\"", errorfilename);
char *argv[] = {
NULL, /* will be replaced by the executable path */
"-t",

View File

@ -1,18 +1,54 @@
$OpenBSD: patch-src_click_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-src_click_c,v 1.4 2011/12/01 16:00:01 dcoppa Exp $
bugfix: skip dragging of floating containers in fullscreen mode
(upstream git commit 0c367f9e4c67b77420b98a93b5d0e7ab08e695af)
Bugfix: fix resizing for v-split containers in h-split containers
(upstream git commit 59283cce93dc1e468e3ad714a2f561aba8575180)
--- src/click.c.orig Sun Aug 28 19:48:13 2011
+++ src/click.c Fri Nov 4 16:12:53 2011
@@ -179,7 +179,9 @@ static int route_click(Con *con, xcb_button_press_even
con_focus(con);
--- src/click.c.orig Fri Nov 11 23:41:20 2011
+++ src/click.c Thu Dec 1 14:01:12 2011
@@ -26,7 +26,7 @@ typedef enum { CLICK_BORDER = 0, CLICK_DECORATION = 1,
*
*/
static bool tiling_resize_for_border(Con *con, border_t border, const xcb_button_press_event_t *event) {
- DLOG("border = %d\n", border);
+ DLOG("border = %d, con = %p\n", border, con);
char way = (border == BORDER_TOP || border == BORDER_LEFT ? 'p' : 'n');
orientation_t orientation = (border == BORDER_TOP || border == BORDER_BOTTOM ? VERT : HORIZ);
/* 3: for floating containers, we also want to raise them on click */
- if (floatingcon != NULL) {
+ Con *ws = con_get_workspace(con);
+ Con *fs = (ws ? con_get_fullscreen_con(ws, CF_OUTPUT) : NULL);
+ if (floatingcon != NULL && fs == NULL) {
floating_raise_con(floatingcon);
@@ -38,6 +38,7 @@ static bool tiling_resize_for_border(Con *con, border_
resize_con->parent->orientation != orientation)
resize_con = resize_con->parent;
/* 4: floating_modifier plus left mouse button drags */
+ DLOG("resize_con = %p\n", resize_con);
if (resize_con->type != CT_WORKSPACE &&
resize_con->type != CT_FLOATING_CON &&
resize_con->parent->orientation == orientation) {
@@ -51,6 +52,8 @@ static bool tiling_resize_for_border(Con *con, border_
first = second;
second = tmp;
}
+ DLOG("first = %p, second = %p, resize_con = %p\n",
+ first, second, resize_con);
}
if (first == NULL || second == NULL) {
@@ -130,13 +133,14 @@ static bool tiling_resize(Con *con, const xcb_button_p
/* Since the container might either be the child *or* already a split
* container (in the case of a nested split container), we need to make
* sure that we are dealing with the split container here. */
- if (con_is_leaf(con) && con->parent->type == CT_CON)
- con = con->parent;
+ Con *check_con = con;
+ if (con_is_leaf(check_con) && check_con->parent->type == CT_CON)
+ check_con = check_con->parent;
- if ((con->layout == L_STACKED ||
- con->layout == L_TABBED ||
- con->orientation == HORIZ) &&
- con_num_children(con) > 1) {
+ if ((check_con->layout == L_STACKED ||
+ check_con->layout == L_TABBED ||
+ check_con->orientation == HORIZ) &&
+ con_num_children(check_con) > 1) {
DLOG("Not handling this resize, this container has > 1 child.\n");
return false;
}

View File

@ -1,28 +1,57 @@
$OpenBSD: patch-src_cmdparse_y,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-src_cmdparse_y,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
Bugfix: fix crash on '[class="i3bar"] focus'
(upstream git commit 31acb91d906cecb94d791609917530545118eb3b)
bugfix: don't fix floating coordinates when reassigning - fixes
flickering (upstream git commit 6b541d382b89de18104202e5820f466725d77576)
Bugfix: retain absolute window position and size when changing
floating borders (git commit 970d11709e99aab7db13a2fd28a758a68a4137dc)
--- src/cmdparse.y.orig Sun Aug 28 19:48:13 2011
+++ src/cmdparse.y Mon Oct 31 12:44:02 2011
@@ -533,7 +533,7 @@ kill:
else {
TAILQ_FOREACH(current, &owindows, owindows) {
printf("matching: %p / %s\n", current->con, current->con->name);
- tree_close(current->con, $2, false);
+ tree_close(current->con, $2, false, false);
}
}
Bugfix: fix 'resize' command in nested containers
(upstream git commit 626e3efb48cdf78dcda31bec61bcb8bcb9bf2940)
--- src/cmdparse.y.orig Fri Nov 11 23:41:20 2011
+++ src/cmdparse.y Thu Dec 1 14:03:16 2011
@@ -450,6 +450,10 @@ focus:
int count = 0;
TAILQ_FOREACH(current, &owindows, owindows) {
Con *ws = con_get_workspace(current->con);
+ /* If no workspace could be found, this was a dock window.
+ * Just skip it, you cannot focus dock windows. */
+ if (!ws)
+ continue;
@@ -699,7 +699,7 @@ move:
/* If the container is not on the current workspace,
* workspace_show() will switch to a different workspace and (if
@@ -719,10 +723,12 @@ border:
TAILQ_FOREACH(current, &owindows, owindows) {
printf("matching: %p / %s\n", current->con, current->con->name);
- con_move_to_workspace(current->con, ws, false);
+ con_move_to_workspace(current->con, ws, true, false);
+ int border_style = current->con->border_style;
if ($2 == TOK_TOGGLE) {
- current->con->border_style++;
- current->con->border_style %= 3;
- } else current->con->border_style = $2;
+ border_style++;
+ border_style %= 3;
+ } else border_style = $2;
+ con_set_border_style(current->con, border_style);
}
tree_render();
@@ -961,6 +967,16 @@ resize:
while (current->parent->layout == L_STACKED ||
current->parent->layout == L_TABBED)
current = current->parent;
+
+ /* Then further go up until we find one with the matching orientation. */
+ orientation_t search_orientation =
+ (direction == TOK_LEFT || direction == TOK_RIGHT ? HORIZ : VERT);
+
+ while (current->type != CT_WORKSPACE &&
+ current->type != CT_FLOATING_CON &&
+ current->parent->orientation != search_orientation)
+ current = current->parent;
+
/* get the default percentage */
int children = con_num_children(current->parent);
Con *other;

View File

@ -1,132 +1,72 @@
$OpenBSD: patch-src_con_c,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-src_con_c,v 1.2 2011/12/01 16:00:01 dcoppa Exp $
bugfix: don't fix floating coordinates when reassigning - fixes
flickering (upstream git commit 6b541d382b89de18104202e5820f466725d77576)
Bugfix: retain absolute window position and size when changing
floating borders (git commit 970d11709e99aab7db13a2fd28a758a68a4137dc)
bugfix: always adjust floating position when moving to another
output (upstream git commit a5012f60213f29265edfeeaa4574ebeaa61e1ca5)
Do not set the _NET_WM_WORKAREA hint: fix incorrect transient
geometry with wxwidgets
(upstream git commit d25e77ce7597bf0736c610a04185c8c27694c890)
bugfix: avoid out of bounds coordinates when moving floating windows
(upstream git commit a82f5750ded81dd1789c868f0e8f233c5b79b85a)
bugfix: use con_orientation() - fixes switching between different
outputs (upstream git commit 7a2e92a11646eee8459fc982c0569b4d454c6db9)
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
--- src/con.c.orig Sun Aug 28 19:48:13 2011
+++ src/con.c Fri Nov 4 16:05:33 2011
@@ -559,7 +559,7 @@ update_netwm_state:
* TODO: is there a better place for this function?
*
*/
-void con_move_to_workspace(Con *con, Con *workspace, bool dont_warp) {
+void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp) {
if (con->type == CT_WORKSPACE) {
DLOG("Moving workspaces is not yet implemented.\n");
return;
@@ -601,29 +601,39 @@ void con_move_to_workspace(Con *con, Con *workspace, b
next = ws;
}
- /* 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 (source_output != dest_output &&
- workspace_is_visible(workspace)) {
- workspace_show(workspace->name);
-
- if (con->type == CT_FLOATING_CON) {
+ if (source_output != dest_output) {
+ /* Take the relative coordinates of the current output, then add them
+ * to the coordinate space of the correct output */
+ if (fix_coordinates && con->type == CT_FLOATING_CON) {
DLOG("Floating window, fixing coordinates\n");
- /* Take the relative coordinates of the current output, then add them
- * to the coordinate space of the correct output */
+ /* First we get the x/y coordinates relative to the x/y coordinates
+ * of the output on which the window is on */
uint32_t rel_x = (con->rect.x - source_output->rect.x);
uint32_t rel_y = (con->rect.y - source_output->rect.y);
- con->rect.x = dest_output->rect.x + rel_x;
- con->rect.y = dest_output->rect.y + rel_y;
- }
+ /* Then we calculate a fraction, for example 0.63 for a window
+ * which is at y = 1212 of a 1920 px high output */
+ double fraction_x = ((double)rel_x / source_output->rect.width);
+ double fraction_y = ((double)rel_y / source_output->rect.height);
+ DLOG("rel_x = %d, rel_y = %d, fraction_x = %f, fraction_y = %f, output->w = %d, output->h = %d\n",
+ rel_x, rel_y, fraction_x, fraction_y, source_output->rect.width, source_output->rect.height);
+ con->rect.x = dest_output->rect.x + (fraction_x * dest_output->rect.width);
+ con->rect.y = dest_output->rect.y + (fraction_y * dest_output->rect.height);
+ DLOG("Resulting coordinates: x = %d, y = %d\n", con->rect.x, con->rect.y);
+ } else DLOG("Not fixing coordinates, fix_coordinates flag = %d\n", fix_coordinates);
- /* Dont warp if told so (when dragging floating windows with the
- * mouse for example) */
- if (dont_warp)
- x_set_warp_to(NULL);
- else
- x_set_warp_to(&(con->rect));
+ /* 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->name);
+
+ /* Dont warp if told so (when dragging floating windows with the
+ * mouse for example) */
+ if (dont_warp)
+ x_set_warp_to(NULL);
+ else
+ x_set_warp_to(&(con->rect));
+ }
}
DLOG("Re-attaching container to %p / %s\n", next, next->name);
@@ -827,15 +837,16 @@ Con *con_descend_tiling_focused(Con *con) {
*/
Con *con_descend_direction(Con *con, direction_t direction) {
Con *most = NULL;
- DLOG("con_descend_direction(%p, %d)\n", con, direction);
+ int orientation = con_orientation(con);
+ DLOG("con_descend_direction(%p, orientation %d, direction %d)\n", con, orientation, direction);
if (direction == D_LEFT || direction == D_RIGHT) {
- if (con->orientation == HORIZ) {
+ if (orientation == HORIZ) {
/* If the direction is horizontal, we can use either the first
* (D_RIGHT) or the last con (D_LEFT) */
if (direction == D_RIGHT)
most = TAILQ_FIRST(&(con->nodes_head));
else most = TAILQ_LAST(&(con->nodes_head), nodes_head);
- } else if (con->orientation == VERT) {
+ } else if (orientation == VERT) {
/* Wrong orientation. We use the last focused con. Within that con,
* we recurse to chose the left/right con or at least the last
* focused one. */
@@ -848,13 +859,13 @@ Con *con_descend_direction(Con *con, direction_t direc
}
if (direction == D_UP || direction == D_DOWN) {
- if (con->orientation == VERT) {
+ if (orientation == VERT) {
/* If the direction is vertical, we can use either the first
* (D_DOWN) or the last con (D_UP) */
if (direction == D_UP)
most = TAILQ_LAST(&(con->nodes_head), nodes_head);
else most = TAILQ_FIRST(&(con->nodes_head));
- } else if (con->orientation == HORIZ) {
+ } else if (orientation == HORIZ) {
/* Wrong orientation. We use the last focused con. Within that con,
* we recurse to chose the top/bottom con or at least the last
* focused one. */
@@ -1003,7 +1014,7 @@ static void con_on_remove_child(Con *con) {
int children = con_num_children(con);
if (children == 0) {
DLOG("Container empty, closing\n");
- tree_close(con, DONT_KILL_WINDOW, false);
+ tree_close(con, DONT_KILL_WINDOW, false, false);
return;
}
--- src/con.c.orig Fri Nov 11 23:41:20 2011
+++ src/con.c Thu Dec 1 14:07:37 2011
@@ -942,6 +942,52 @@ int con_border_style(Con *con) {
}
/*
+ * Sets the given border style on con, correctly keeping the position/size of a
+ * floating window.
+ *
+ */
+void con_set_border_style(Con *con, int border_style) {
+ /* Handle the simple case: non-floating containerns */
+ if (!con_is_floating(con)) {
+ con->border_style = border_style;
+ return;
+ }
+
+ /* For floating containers, we want to keep the position/size of the
+ * *window* itself. Since the window size is rendered based on the
+ * container which it is in, we first remove the border/decoration specific
+ * amount of pixels from parent->rect, change the border, then add the new
+ * border/decoration specific pixels. */
+ DLOG("This is a floating container\n");
+
+ /* Get current border/decoration pixel values. */
+ int deco_height =
+ (con->border_style == BS_NORMAL ? config.font.height + 5 : 0);
+ Rect bsr = con_border_style_rect(con);
+ Con *parent = con->parent;
+
+ con->rect.x += bsr.x;
+ con->rect.y += bsr.y;
+ con->rect.width += bsr.width;
+ con->rect.height += bsr.height;
+
+ /* Change the border style, get new border/decoration values. */
+ con->border_style = border_style;
+ bsr = con_border_style_rect(con);
+ deco_height = (con->border_style == BS_NORMAL ? config.font.height + 5 : 0);
+
+ con->rect.x -= bsr.x;
+ con->rect.y -= bsr.y;
+ con->rect.width -= bsr.width;
+ con->rect.height -= bsr.height;
+
+ parent->rect.x = con->rect.x;
+ parent->rect.y = con->rect.y - deco_height;
+ parent->rect.width = con->rect.width;
+ parent->rect.height = con->rect.height + deco_height;
+}
+
+/*
* This function changes the layout of a given container. Use it to handle
* special cases like changing a whole workspace to stacked/tabbed (creates a
* new split container before).
@@ -1023,7 +1069,6 @@ static void con_on_remove_child(Con *con) {
LOG("Closing old workspace (%p / %s), it is empty\n", con, con->name);
tree_close(con, DONT_KILL_WINDOW, false, false);
ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"empty\"}");
- ewmh_update_workarea();
}
return;
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_config_c,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
--- src/config.c.orig Wed Sep 14 12:11:00 2011
+++ src/config.c Wed Sep 14 12:11:48 2011
@@ -215,7 +215,7 @@ static char *get_config_path(const char *override_conf
$OpenBSD: patch-src_config_c,v 1.6 2011/12/01 16:00:01 dcoppa Exp $
--- src/config.c.orig Wed Nov 30 16:44:46 2011
+++ src/config.c Wed Nov 30 16:45:07 2011
@@ -210,7 +210,7 @@ static char *get_config_path(const char *override_conf
/* 4: check for $XDG_CONFIG_DIRS/i3/config */
if ((xdg_config_dirs = getenv("XDG_CONFIG_DIRS")) == NULL)

View File

@ -1,65 +0,0 @@
$OpenBSD: patch-src_floating_c,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
bugfix: don't use top border height twice when calculating dimensions
for floating windows (git commit f6eaa8a5807a43f3c682e1e7b25be9eafa06cce2)
bugfix: honor the X11 window border when calculating dimensions for
floating windows (git commit 983a6795375d1c49da55e7bfc5e90dfb34bc03b3)
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
bugfix: don't fix floating coordinates when reassigning - fixes
flickering (upstream git commit 6b541d382b89de18104202e5820f466725d77576)
--- src/floating.c.orig Sun Aug 28 19:48:13 2011
+++ src/floating.c Fri Nov 4 16:16:52 2011
@@ -91,7 +91,7 @@ void floating_enable(Con *con, bool automatic) {
/* check if the parent container is empty and close it if so */
if ((con->parent->type == CT_CON || con->parent->type == CT_FLOATING_CON) && con_num_children(con->parent) == 0) {
DLOG("Old container empty after setting this child to floating, closing\n");
- tree_close(con->parent, DONT_KILL_WINDOW, false);
+ tree_close(con->parent, DONT_KILL_WINDOW, false, false);
}
char *name;
@@ -103,6 +103,7 @@ void floating_enable(Con *con, bool automatic) {
int deco_height = config.font.height + 5;
DLOG("Original rect: (%d, %d) with %d x %d\n", con->rect.x, con->rect.y, con->rect.width, con->rect.height);
+ DLOG("Geometry = (%d, %d) with %d x %d\n", con->geometry.x, con->geometry.y, con->geometry.width, con->geometry.height);
Rect zero = { 0, 0, 0, 0 };
nc->rect = con->geometry;
/* If the geometry was not set (split containers), we need to determine a
@@ -122,9 +123,12 @@ void floating_enable(Con *con, bool automatic) {
/* add pixels for the decoration */
/* TODO: dont add them when the user automatically puts new windows into
* 1pixel/borderless mode */
- nc->rect.height += deco_height + 4;
+ nc->rect.height += deco_height + 2;
nc->rect.width += 4;
+ nc->rect.height += con->border_width * 2;
+ nc->rect.width += con->border_width * 2;
+
/* Some clients (like GIMPs color picker window) get mapped
* to (0, 0), so we push them to a reasonable position
* (centered over their leader) */
@@ -207,7 +211,7 @@ void floating_disable(Con *con, bool automatic) {
/* 2: kill parent container */
TAILQ_REMOVE(&(con->parent->parent->floating_head), con->parent, floating_windows);
TAILQ_REMOVE(&(con->parent->parent->focus_head), con->parent, focused);
- tree_close(con->parent, DONT_KILL_WINDOW, false);
+ tree_close(con->parent, DONT_KILL_WINDOW, false, false);
/* 3: re-attach to the parent of the currently focused con on the workspace
* this floating con was on */
@@ -286,7 +290,7 @@ bool floating_maybe_reassign_ws(Con *con) {
Con *content = output_get_content(output->con);
Con *ws = TAILQ_FIRST(&(content->focus_head));
DLOG("Moving con %p / %s to workspace %p / %s\n", con, con->name, ws, ws->name);
- con_move_to_workspace(con, ws, true);
+ con_move_to_workspace(con, ws, false, true);
con_focus(con_descend_focused(con));
return true;
}

View File

@ -1,59 +1,49 @@
$OpenBSD: patch-src_handlers_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-src_handlers_c,v 1.4 2011/12/01 16:00:01 dcoppa Exp $
bugfix: honor the X11 window border in ConfigureRequests
(upstream git commit f2f636f9e7872ff19c31649b24d5a19a826e22bd)
Bugfix: ignore EnterNotify events to prevent wrong focus in complex
tabbed/stacked layouts
(upstream git commit bd4b240d56df08bc255a09c9cb0d98b457c785dc)
bugfix: correctly handle ConfigureRequests for floating windows in
multi-monitor setups (git commit b1aa8107b3bc9510422b4a71744c2bfa71627b12)
Bugfix: skip dock clients when handling FocusIn events
(upstream git commit 5f8d719835832a91232d0331a25512e9a0853494)
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
--- src/handlers.c.orig Sun Aug 28 19:48:13 2011
+++ src/handlers.c Mon Oct 31 12:44:02 2011
@@ -353,24 +353,27 @@ static int handle_configure_request(xcb_configure_requ
bsr.y += deco_height;
bsr.height -= deco_height;
}
- con = con->parent;
+ Con *floatingcon = con->parent;
DLOG("Container is a floating leaf node, will do that.\n");
if (event->value_mask & XCB_CONFIG_WINDOW_X) {
- con->rect.x = event->x + (-1) * bsr.x;
- DLOG("proposed x = %d, new x is %d\n", event->x, con->rect.x);
+ floatingcon->rect.x = event->x + (-1) * bsr.x;
+ DLOG("proposed x = %d, new x is %d\n", event->x, floatingcon->rect.x);
}
if (event->value_mask & XCB_CONFIG_WINDOW_Y) {
- con->rect.y = event->y + (-1) * bsr.y;
- DLOG("proposed y = %d, new y is %d\n", event->y, con->rect.y);
+ floatingcon->rect.y = event->y + (-1) * bsr.y;
+ DLOG("proposed y = %d, new y is %d\n", event->y, floatingcon->rect.y);
}
if (event->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
- con->rect.width = event->width + (-1) * bsr.width;
- DLOG("proposed width = %d, new width is %d\n", event->width, con->rect.width);
+ floatingcon->rect.width = event->width + (-1) * bsr.width;
+ floatingcon->rect.width += con->border_width * 2;
+ DLOG("proposed width = %d, new width is %d (x11 border %d)\n", event->width, floatingcon->rect.width, con->border_width);
}
if (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
- con->rect.height = event->height + (-1) * bsr.height;
- DLOG("proposed height = %d, new height is %d\n", event->height, con->rect.height);
+ floatingcon->rect.height = event->height + (-1) * bsr.height;
+ floatingcon->rect.height += con->border_width * 2;
+ DLOG("proposed height = %d, new height is %d (x11 border %d)\n", event->height, floatingcon->rect.height, con->border_width);
}
+ floating_maybe_reassign_ws(floatingcon);
tree_render();
}
--- src/handlers.c.orig Fri Nov 11 23:41:20 2011
+++ src/handlers.c Thu Dec 1 13:58:48 2011
@@ -452,10 +452,20 @@ static int handle_screen_change(xcb_generic_event_t *e
*
*/
static int handle_unmap_notify_event(xcb_unmap_notify_event_t *event) {
- // XXX: this is commented out because in src/x.c we disable EnterNotify events
- /* we need to ignore EnterNotify events which will be generated because a
- * different window is visible now */
- //add_ignore_event(event->sequence, XCB_ENTER_NOTIFY);
+ /* If the client (as opposed to i3) destroyed or unmapped a window, an
+ * EnterNotify event will follow (indistinguishable from an EnterNotify
+ * event caused by moving your mouse), causing i3 to set focus to whichever
+ * window is now visible.
+ *
+ * In a complex stacked or tabbed layout (take two v-split containers in a
+ * tabbed container), when the bottom window in tab2 is closed, the bottom
+ * window of tab1 is visible instead. X11 will thus send an EnterNotify
+ * event for the bottom window of tab1, while the focus should be set to
+ * the remaining window of tab2.
+ *
+ * Therefore, we ignore all EnterNotify events which have the same sequence
+ * as an UnmapNotify event. */
+ add_ignore_event(event->sequence, XCB_ENTER_NOTIFY);
@@ -454,7 +457,7 @@ static int handle_unmap_notify_event(xcb_unmap_notify_
DLOG("UnmapNotify for 0x%08x (received from 0x%08x), serial %d\n", event->window, event->event, event->sequence);
Con *con = con_by_window_id(event->window);
@@ -965,6 +975,12 @@ static int handle_focus_in(xcb_focus_in_event_t *event
if (focused_id == event->event) {
DLOG("focus matches the currently focused window, not doing anything\n");
+ return 1;
+ }
+
+ /* Skip dock clients, they cannot get the i3 focus. */
+ if (con->parent->type == CT_DOCKAREA) {
+ DLOG("This is a dock client, not focusing.\n");
return 1;
}
- tree_close(con, DONT_KILL_WINDOW, false);
+ tree_close(con, DONT_KILL_WINDOW, false, false);
tree_render();
x_push_changes(croot);
return 1;

View File

@ -1,41 +1,14 @@
$OpenBSD: patch-src_ipc_c,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-src_ipc_c,v 1.6 2011/12/01 16:00:01 dcoppa Exp $
missing header
bugfix: properly free memory/close fd upon errors
(upstream git commit e1631d6320cf6b47c3b46f0b56ae970986c9c20c)
bugfix: IPC: Correctly dump the 'focus' array
(upstream git commit abaa8c23564410ce4037ecb550b253a0e37bcbf0)
--- src/ipc.c.orig Sun Aug 28 19:48:13 2011
+++ src/ipc.c Mon Oct 31 12:53:38 2011
@@ -10,6 +10,7 @@
* ipc.c: Everything about the UNIX domain sockets for IPC
*
--- src/ipc.c.orig Wed Nov 30 17:03:50 2011
+++ src/ipc.c Wed Nov 30 17:04:05 2011
@@ -9,6 +9,7 @@
*/
#include "all.h"
+#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <fcntl.h>
@@ -59,8 +60,10 @@ static bool mkdirp(const char *path) {
copy[strlen(copy)-1] = '\0';
char *sep = strrchr(copy, '/');
- if (sep == NULL)
+ if (sep == NULL) {
+ FREE(copy);
return false;
+ }
*sep = '\0';
bool result = false;
if (mkdirp(copy))
@@ -277,7 +280,7 @@ void dump_node(yajl_gen gen, struct Con *con, bool inp
ystr("focus");
y(array_open);
- TAILQ_FOREACH(node, &(con->focus_head), nodes) {
+ TAILQ_FOREACH(node, &(con->focus_head), focused) {
y(integer, (long int)node);
}
y(array_close);

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-src_log_c,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: make sure the file descriptor is closed within the child
after forking (git commit 8adcf3e5d102647e9cc6c4cce7e6d0c7a9f3a9bb)
--- src/log.c.orig Sun Aug 28 19:48:13 2011
+++ src/log.c Mon Oct 31 12:44:02 2011
@@ -16,6 +16,8 @@
#include <stdbool.h>
#include <stdlib.h>
#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
#include "util.h"
#include "log.h"
@@ -41,6 +43,9 @@ void init_logging() {
}
errorfile = fopen(errorfilename, "w");
+ if (fcntl(fileno(errorfile), F_SETFD, FD_CLOEXEC)) {
+ ELOG("Could not set close-on-exec flag\n");
+ }
}
/*

View File

@ -1,16 +1,54 @@
$OpenBSD: patch-src_randr_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-src_randr_c,v 1.4 2011/12/01 16:00:01 dcoppa Exp $
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
Bugfix: don't create a workspace named "back_and_forth" on
startup (unintended behaviour)
(upstream git commit d686f2f8731a1b7a9c4524a30d4413200d768621)
--- src/randr.c.orig Sun Aug 28 19:48:13 2011
+++ src/randr.c Mon Oct 31 12:44:02 2011
@@ -789,7 +789,7 @@ void randr_query_outputs() {
}
Do not set the _NET_WM_WORKAREA hint: fix incorrect transient
geometry with wxwidgets
(upstream git commit d25e77ce7597bf0736c610a04185c8c27694c890)
Bugfix: fix crash at startup when RandR is not present
(upstream git commit 227a58b0c30a438e36ee8318c0d20079777f063d)
--- src/randr.c.orig Fri Nov 11 23:41:20 2011
+++ src/randr.c Thu Dec 1 14:07:37 2011
@@ -420,11 +420,12 @@ void init_ws_for_output(Output *output, Con *content)
continue;
DLOG("relevant command = %s\n", bind->command);
char *target = bind->command + strlen("workspace ");
- /* We check if this is the workspace next/prev command. Beware: The
- * workspace names "next" and "prev" are OK, so we check before
- * stripping the double quotes */
+ /* We check if this is the workspace next/prev/back_and_forth command.
+ * Beware: The workspace names "next", "prev" and "back_and_forth" are
+ * OK, so we check before stripping the double quotes */
if (strncasecmp(target, "next", strlen("next")) == 0 ||
- strncasecmp(target, "prev", strlen("prev")) == 0)
+ strncasecmp(target, "prev", strlen("prev")) == 0 ||
+ strncasecmp(target, "back_and_forth", strlen("back_and_forth")) == 0)
continue;
if (*target == '"')
target++;
@@ -807,8 +808,6 @@ void randr_query_outputs() {
disable_randr(conn);
}
DLOG("destroying disappearing con %p\n", output->con);
- tree_close(output->con, DONT_KILL_WINDOW, true);
+ tree_close(output->con, DONT_KILL_WINDOW, true, false);
DLOG("Done. Should be fine now\n");
output->con = NULL;
}
- ewmh_update_workarea();
-
/* Just go through each active output and assign one workspace */
TAILQ_FOREACH(output, &outputs, outputs) {
if (!output->active)
@@ -845,9 +844,10 @@ void randr_init(int *event_base) {
const xcb_query_extension_reply_t *extreply;
extreply = xcb_get_extension_data(conn, &xcb_randr_id);
- if (!extreply->present)
+ if (!extreply->present) {
disable_randr(conn);
- else randr_query_outputs();
+ return;
+ } else randr_query_outputs();
if (event_base != NULL)
*event_base = extreply->first_event;

View File

@ -0,0 +1,35 @@
$OpenBSD: patch-src_render_c,v 1.1 2011/12/01 16:00:01 dcoppa Exp $
Bugfix: fix fullscreen with floating windows
(upstream git commit 61b8a62132bf07682b79902f5ea9f712bca000c9)
--- src/render.c.orig Fri Nov 11 23:41:20 2011
+++ src/render.c Thu Dec 1 13:30:55 2011
@@ -236,6 +236,27 @@ void render_con(Con *con, bool render_fullscreen) {
Con *content = output_get_content(output);
Con *workspace = TAILQ_FIRST(&(content->focus_head));
+ /* Check for (floating!) fullscreen nodes */
+ /* XXX: This code duplication is unfortunate. Keep in mind to fix
+ * this when we clean up the whole render.c */
+ Con *fullscreen = NULL;
+ fullscreen = con_get_fullscreen_con(workspace, CF_OUTPUT);
+ if (fullscreen) {
+ /* Either the fullscreen window is inside the floating
+ * container, then we need to render and raise it now... */
+ if (con_inside_floating(fullscreen)) {
+ fullscreen->rect = output->rect;
+ x_raise_con(fullscreen);
+ render_con(fullscreen, true);
+ continue;
+ } else {
+ /* ...or it's a tiling window, in which case the floating
+ * windows should not overlap it, so we skip rendering this
+ * output. */
+ continue;
+ }
+ }
+
Con *child;
TAILQ_FOREACH(child, &(workspace->floating_head), floating_windows) {
DLOG("floating child at (%d,%d) with %d x %d\n", child->rect.x, child->rect.y, child->rect.width, child->rect.height);

View File

@ -1,71 +0,0 @@
$OpenBSD: patch-src_tree_c,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
bugfix: only change focus in tree_close() when the container was
focused before (git commit 2fe0949abd8b73a5dbc3c7f825982f79ecfa976d)
--- src/tree.c.orig Sun Aug 28 19:48:13 2011
+++ src/tree.c Fri Nov 4 16:06:18 2011
@@ -115,7 +115,7 @@ static bool _is_con_mapped(Con *con) {
* and the window is expected to kill itself.
*
*/
-bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent) {
+bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool force_set_focus) {
bool was_mapped = con->mapped;
Con *parent = con->parent;
@@ -138,7 +138,7 @@ bool tree_close(Con *con, kill_window_t kill_window, b
for (child = TAILQ_FIRST(&(con->nodes_head)); child; ) {
nextchild = TAILQ_NEXT(child, nodes);
DLOG("killing child=%p\n", child);
- if (!tree_close(child, kill_window, true))
+ if (!tree_close(child, kill_window, true, false))
abort_kill = true;
child = nextchild;
}
@@ -191,7 +191,7 @@ bool tree_close(Con *con, kill_window_t kill_window, b
if (con_is_floating(con)) {
Con *ws = con_get_workspace(con);
DLOG("Container was floating, killing floating container\n");
- tree_close(parent, DONT_KILL_WINDOW, false);
+ tree_close(parent, DONT_KILL_WINDOW, false, (con == focused));
DLOG("parent container killed\n");
if (con == focused) {
DLOG("This is the focused container, i need to find another one to focus. I start looking at ws = %p\n", ws);
@@ -220,12 +220,13 @@ bool tree_close(Con *con, kill_window_t kill_window, b
if (was_mapped || con == focused) {
if ((kill_window != DONT_KILL_WINDOW) || !dont_kill_parent || con == focused) {
DLOG("focusing %p / %s\n", next, next->name);
- /* TODO: check if the container (or one of its children) was focused */
if (next->type == CT_DOCKAREA) {
/* Instead of focusing the dockarea, we need to restore focus to the workspace */
con_focus(con_descend_focused(output_get_content(next->parent)));
} else {
- con_focus(next);
+ if (!force_set_focus && con != focused)
+ DLOG("not changing focus, the container was not focused before\n");
+ else con_focus(next);
}
}
else {
@@ -258,7 +259,7 @@ void tree_close_con(kill_window_t kill_window) {
assert(focused->type != CT_ROOT);
/* Kill con */
- tree_close(focused, kill_window, false);
+ tree_close(focused, kill_window, false, false);
}
/*
@@ -548,7 +549,7 @@ void tree_flatten(Con *con) {
/* 4: close the redundant cons */
DLOG("closing redundant cons\n");
- tree_close(con, DONT_KILL_WINDOW, true);
+ tree_close(con, DONT_KILL_WINDOW, true, false);
/* Well, we got to abort the recursion here because we destroyed the
* container. However, if tree_flatten() is called sufficiently often,

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-src_util_c,v 1.6 2011/11/06 20:23:25 dcoppa Exp $
bugfix: properly free memory/close fd upon errors
(upstream git commit e1631d6320cf6b47c3b46f0b56ae970986c9c20c)
--- src/util.c.orig Sun Aug 28 19:48:13 2011
+++ src/util.c Mon Oct 31 12:44:02 2011
@@ -374,11 +374,13 @@ char *store_restart_layout() {
if (n == -1) {
perror("write()");
free(filename);
+ close(fd);
return NULL;
}
if (n == 0) {
printf("write == 0?\n");
free(filename);
+ close(fd);
return NULL;
}
written += n;

View File

@ -1,16 +1,17 @@
$OpenBSD: patch-src_workspace_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
$OpenBSD: patch-src_workspace_c,v 1.4 2011/12/01 16:00:01 dcoppa Exp $
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
Do not set the _NET_WM_WORKAREA hint: fix incorrect transient
geometry with wxwidgets
(upstream git commit d25e77ce7597bf0736c610a04185c8c27694c890)
--- src/workspace.c.orig Sun Aug 28 19:48:13 2011
+++ src/workspace.c Mon Oct 31 12:44:02 2011
@@ -211,7 +211,7 @@ void workspace_show(const char *num) {
/* check if this workspace is currently visible */
if (!workspace_is_visible(old)) {
LOG("Closing old workspace (%p / %s), it is empty\n", old, old->name);
- tree_close(old, DONT_KILL_WINDOW, false);
+ tree_close(old, DONT_KILL_WINDOW, false, false);
ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"empty\"}");
changed_num_workspaces = true;
}
--- src/workspace.c.orig Fri Nov 11 23:41:20 2011
+++ src/workspace.c Thu Dec 1 14:07:37 2011
@@ -240,8 +240,6 @@ static void _workspace_show(Con *workspace, bool chang
}
/* Update the EWMH hints */
- if (changed_num_workspaces)
- ewmh_update_workarea();
ewmh_update_current_desktop();
ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");

View File

@ -1,40 +0,0 @@
$OpenBSD: patch-src_x_c,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: don't warp the pointer if it already is on the target output
(upstream git commit 755c618cd41815c72d30fd0d3c4770557e952df2)
--- src/x.c.orig Sun Aug 28 19:48:13 2011
+++ src/x.c Fri Nov 4 16:18:18 2011
@@ -759,7 +759,12 @@ static void x_push_node_unmaps(Con *con) {
*/
void x_push_changes(Con *con) {
con_state *state;
+ xcb_query_pointer_cookie_t pointercookie;
+ if (warp_to) {
+ pointercookie = xcb_query_pointer(conn, root);
+ }
+
DLOG("-- PUSHING WINDOW STACK --\n");
//DLOG("Disabling EnterNotify\n");
uint32_t values[1] = { XCB_NONE };
@@ -868,7 +873,18 @@ void x_push_changes(Con *con) {
}
if (warp_to) {
- xcb_warp_pointer_rect(conn, warp_to);
+ xcb_query_pointer_reply_t *pointerreply = xcb_query_pointer_reply(conn, pointercookie, NULL);
+ if (!pointerreply) {
+ ELOG("Could not query pointer position, not warping pointer\n");
+ } else {
+ int mid_x = warp_to->x + (warp_to->width / 2);
+ int mid_y = warp_to->y + (warp_to->height / 2);
+
+ Output *current = get_output_containing(pointerreply->root_x, pointerreply->root_y);
+ Output *target = get_output_containing(mid_x, mid_y);
+ if (current != target)
+ xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, mid_x, mid_y);
+ }
warp_to = NULL;
}

View File

@ -1,34 +0,0 @@
$OpenBSD: patch-src_xcb_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
bugfix: send the correct X11 border_width in faked ConfigureNotifys
(upstream git commit deab3ac33864875476476093b5e835dfcce31497)
--- src/xcb.c.orig Sun Aug 28 19:48:13 2011
+++ src/xcb.c Mon Oct 31 12:44:02 2011
@@ -168,7 +168,7 @@ void xcb_draw_rect(xcb_connection_t *conn, xcb_drawabl
* The truth is, however, that we will manage them.
*
*/
-void fake_configure_notify(xcb_connection_t *conn, Rect r, xcb_window_t window) {
+void fake_configure_notify(xcb_connection_t *conn, Rect r, xcb_window_t window, int border_width) {
/* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
* In order to properly initialize these bytes, we allocate 32 bytes even
* though we only need less for an xcb_configure_notify_event_t */
@@ -184,7 +184,7 @@ void fake_configure_notify(xcb_connection_t *conn, Rec
generated_event->width = r.width;
generated_event->height = r.height;
- generated_event->border_width = 0;
+ generated_event->border_width = border_width;
generated_event->above_sibling = XCB_NONE;
generated_event->override_redirect = false;
@@ -211,7 +211,7 @@ void fake_absolute_configure_notify(Con *con) {
DLOG("fake rect = (%d, %d, %d, %d)\n", absolute.x, absolute.y, absolute.width, absolute.height);
- fake_configure_notify(conn, absolute, con->window->id);
+ fake_configure_notify(conn, absolute, con->window->id, con->border_width);
}
/*

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
@comment $OpenBSD: PLIST,v 1.4 2011/12/01 16:00:01 dcoppa Exp $
@conflict i3bar-<=0.6.21p1
@pkgpath x11/i3bar
@bin bin/i3
@ -23,7 +23,5 @@ share/examples/i3/config
@sample ${SYSCONFDIR}/i3/config
share/examples/i3/config.keycodes
@sample ${SYSCONFDIR}/i3/config.keycodes
share/examples/i3/welcome
@sample ${SYSCONFDIR}/i3/welcome
share/xsessions/
share/xsessions/i3.desktop