Update to i3-4.0.2 (plus patches from upstream git).

i3bar is now part of i3 itself and i3-wsbar is gone.
This commit is contained in:
dcoppa 2011-11-06 20:23:24 +00:00
parent 850de7a127
commit 71c6e11302
38 changed files with 1201 additions and 328 deletions

View File

@ -1,10 +1,8 @@
# $OpenBSD: Makefile,v 1.18 2011/05/09 11:33:35 dcoppa Exp $
# $OpenBSD: Makefile,v 1.19 2011/11/06 20:23:24 dcoppa Exp $
COMMENT = improved dynamic tiling window manager
DISTNAME = i3-3.e-bf3
PKGNAME = i3-3.5.3
REVISION = 0
DISTNAME = i3-4.0.2
CATEGORIES = x11
@ -19,19 +17,16 @@ PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB += X11 c ev m xcb xcb-atom xcb-aux xcb-event
WANTLIB += xcb-icccm xcb-keysyms xcb-randr xcb-xinerama
WANTLIB += yajl
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
MODULES = converters/libiconv
LIB_DEPENDS = devel/libev \
devel/libyajl>=2.0.0
BUILD_DEPENDS = devel/bison
RUN_DEPENDS = x11/dmenu \
devel/p5-IPC-Run \
devel/p5-Try-Tiny \
devel/p5-AnyEvent \
x11/p5-AnyEvent-I3
BUILD_DEPENDS = devel/bison \
devel/flex
RUN_DEPENDS = x11/dmenu
USE_GMAKE = Yes
@ -48,9 +43,13 @@ FAKE_FLAGS = PREFIX=${PREFIX} \
INSTALL_SCRIPT="${INSTALL_SCRIPT}"
pre-configure:
${SUBST_CMD} ${WRKSRC}/i3.config ${WRKSRC}/src/config.c
${SUBST_CMD} ${WRKSRC}/i3.config \
${WRKSRC}/i3.config.keycodes \
${WRKSRC}/src/config.c
post-install:
${INSTALL_MAN} ${WRKBUILD}/man/*.1 ${PREFIX}/man/man1/
@rm -f ${WRKBUILD}/man/i3-wsbar.1
${INSTALL_MAN} ${WRKBUILD}/{i3bar/doc,man}/*.1 \
${PREFIX}/man/man1/
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (i3-3.e-bf3.tar.bz2) = B6ZuBLx1TQwWsDPtnfgMZQ==
RMD160 (i3-3.e-bf3.tar.bz2) = hY2SAg4lGzr9NLywAI18zCXQRmk=
SHA1 (i3-3.e-bf3.tar.bz2) = fDX0n6FKIbYGuxArQcXwzq1Ok6M=
SHA256 (i3-3.e-bf3.tar.bz2) = 4KewMOu60OvyrDnyNd1eCtNO8P9bg+MVAaNh+S6Fxo8=
SIZE (i3-3.e-bf3.tar.bz2) = 360704
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

View File

@ -1,39 +1,57 @@
$OpenBSD: patch-Makefile,v 1.3 2010/09/14 08:54:18 dcoppa Exp $
--- Makefile.orig Wed Jun 9 09:58:15 2010
+++ Makefile Mon Jul 19 17:07:45 2010
@@ -20,20 +20,14 @@ endif
$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
# Depend on the specific file (.c for each .o) and on all headers
src/%.o: src/%.c ${HEADERS}
- echo "CC $<"
$(CC) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/$(shell basename $< .c)/ { print NR }' loglevels.tmp))" -c -o $@ $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="((uint64_t)1 << $(shell awk '/$(shell basename $< .c)/ { print NR; exit 0; }' loglevels.tmp))" -c -o $@ $<
all: src/cfgparse.y.o src/cfgparse.yy.o ${FILES}
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) -o i3 ${FILES} src/cfgparse.y.o src/cfgparse.yy.o $(LDFLAGS)
- echo ""
- echo "SUBDIR i3-msg"
$(MAKE) TOPDIR=$(TOPDIR) -C i3-msg
- echo "SUBDIR i3-input"
$(MAKE) TOPDIR=$(TOPDIR) -C i3-input
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
subdirs:
for dir in $(SUBDIRS); do \
- echo ""; \
- echo "MAKE $$dir"; \
$(MAKE) -C $$dir; \
done
loglevels.h:
- echo "LOGLEVELS"
for file in $$(ls src/*.c src/*.y src/*.l | grep -v 'cfgparse.\(tab\|yy\).c'); \
do \
echo $$(basename $$file .c); \
@@ -45,27 +39,24 @@ loglevels.h:
@@ -51,40 +46,35 @@ loglevels.h:
echo "};") > include/loglevels.h;
src/cfgparse.yy.o: src/cfgparse.l src/cfgparse.y.o ${HEADERS}
- echo "LEX $<"
flex -i -o$(@:.o=.c) $<
$(CC) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.l/ { print NR }' loglevels.tmp))" -c -o $@ $(@:.o=.c)
- 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 $<"
- 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 $<"
bison --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.y/ { print NR }' loglevels.tmp))" -c -o $@ $(<:.y=.tab.c)
$(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 $<"
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"
@ -42,17 +60,36 @@ $OpenBSD: patch-Makefile,v 1.3 2010/09/14 08:54:18 dcoppa Exp $
$(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-wsbar $(DESTDIR)$(PREFIX)/bin/
- $(INSTALL) -m 0755 i3-migrate-config-to-v4 $(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
- $(INSTALL) -m 0644 i3.desktop $(DESTDIR)$(PREFIX)/share/xsessions/
- $(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(PREFIX)/include/i3/
+ ${INSTALL_PROGRAM} i3 $(DESTDIR)$(PREFIX)/bin/
+ ${INSTALL_SCRIPT} i3-wsbar $(DESTDIR)$(PREFIX)/bin/
+ ${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/
$(MAKE) TOPDIR=$(TOPDIR) -C i3-msg install
$(MAKE) TOPDIR=$(TOPDIR) -C i3-input install
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install; \
done
@@ -120,16 +110,12 @@ clean:
$(MAKE) -C docs clean
$(MAKE) -C man clean
for dir in $(SUBDIRS); do \
- echo ""; \
- echo "CLEAN $$dir"; \
$(MAKE) TOPDIR=$(TOPDIR) -C $$dir distclean; \
done
distclean: clean
rm -f i3
for dir in $(SUBDIRS); do \
- echo ""; \
- echo "DISTCLEAN $$dir"; \
$(MAKE) TOPDIR=$(TOPDIR) -C $$dir distclean; \
done

View File

@ -1,46 +1,102 @@
$OpenBSD: patch-common_mk,v 1.4 2011/05/09 11:03:40 dcoppa Exp $
--- common.mk.orig Sun May 8 14:20:48 2011
+++ common.mk Mon May 9 12:01:55 2011
@@ -1,12 +1,12 @@
$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 @@
UNAME=$(shell uname)
-DEBUG=1
+DEBUG=0
COVERAGE=0
INSTALL=install
-PREFIX=/usr
-ifeq ($(PREFIX),/usr)
-SYSCONFDIR=/etc
-else
-SYSCONFDIR=$(PREFIX)/etc
+ifndef PREFIX
+ PREFIX=/usr
ifndef PREFIX
PREFIX=/usr
endif
+ifndef SYSCONFDIR
ifndef SYSCONFDIR
- ifeq ($(PREFIX),/usr)
- SYSCONFDIR=/etc
- else
- SYSCONFDIR=$(PREFIX)/etc
- endif
+ SYSCONFDIR=/etc
+endif
GIT_VERSION="3.e-bf3 (2011-05-08)"
VERSION=3.e-bf3
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
@@ -17,7 +17,7 @@ CFLAGS += -Wall
-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))
-
CFLAGS += -std=c99
CFLAGS += -pipe
CFLAGS += -Wall
# unused-function, unused-label, unused-variable are turned on by -Wall
# We dont want unused-parameter because of the use of many callbacks
CFLAGS += -Wunused-value
CFLAGS += -Iinclude
-CFLAGS += -I/usr/local/include
+CFLAGS += -I${LOCALBASE}/include
CFLAGS += -DI3_VERSION=\"${GIT_VERSION}\"
-CFLAGS += -Iinclude
-CFLAGS += $(call cflags_for_lib, xcb-keysyms)
-ifeq ($(shell pkg-config --exists xcb-util || echo 1),1)
+CFLAGS += -I$(TOPDIR)/include
CPPFLAGS += -DXCB_COMPAT
-CFLAGS += $(call cflags_for_lib, xcb-atom)
-CFLAGS += $(call cflags_for_lib, xcb-aux)
-else
-CFLAGS += $(call cflags_for_lib, xcb-util)
-endif
-CFLAGS += $(call cflags_for_lib, xcb-icccm)
-CFLAGS += $(call cflags_for_lib, xcb-xinerama)
-CFLAGS += $(call cflags_for_lib, xcb-randr)
-CFLAGS += $(call cflags_for_lib, xcb)
-CFLAGS += $(call cflags_for_lib, xcursor)
-CFLAGS += $(call cflags_for_lib, x11)
-CFLAGS += $(call cflags_for_lib, yajl)
-CFLAGS += $(call cflags_for_lib, libev)
CPPFLAGS += -DI3_VERSION=\"${GIT_VERSION}\"
CPPFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\"
CPPFLAGS += -DTERM_EMU=\"$(TERM_EMU)\"
# Check if pkg-config is installed, because without pkg-config, the following
@@ -53,7 +53,7 @@ LDFLAGS += -lxcb
LDFLAGS += -lyajl
LDFLAGS += -lX11
LDFLAGS += -lev
-LDFLAGS += -L/usr/local/lib -L/usr/pkg/lib
+LDFLAGS += -L${LOCALBASE}/lib -L/usr/pkg/lib
-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)
-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
ifeq ($(UNAME),NetBSD)
# We need -idirafter instead of -I to prefer the systems iconv over GNU libiconv
@@ -86,9 +86,6 @@ CFLAGS += -g3
else
CFLAGS += -O2
# 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
endif
ifeq ($(UNAME),OpenBSD)
-CFLAGS += -I${X11BASE}/include
+CFLAGS += -I${X11BASE}/include -I${LOCALBASE}/include
LIBS += -liconv
-LDFLAGS += -L${X11BASE}/lib
+LDFLAGS += -L${X11BASE}/lib -L${LOCALBASE}/lib
endif
ifeq ($(UNAME),FreeBSD)
@@ -118,9 +74,6 @@ ifeq ($(COVERAGE),1)
CFLAGS += -fprofile-arcs -ftest-coverage
LIBS += -lgcov
endif
-
-# Dont print command lines which are run

View File

@ -0,0 +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)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "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)
cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS}
- echo "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 $<"
bison --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)
install: all
- echo "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/
clean:
rm -f *.o cfgparse.tab.{c,h} cfgparse.output cfgparse.yy.c

View File

@ -0,0 +1,54 @@
$OpenBSD: patch-i3-config-wizard_main_c,v 1.1 2011/11/06 20:23:25 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();
+#if defined(__OpenBSD__)
+
+ssize_t
+getline(char ** __restrict buf, size_t * __restrict buflen,
+ FILE * __restrict fp)
+{
+ size_t bytes, newlen;
+ char *newbuf, *p;
+
+ if (buf == NULL || buflen == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (*buf == NULL)
+ *buflen = 0;
+
+ bytes = 0;
+ do {
+ if (feof(fp))
+ break;
+ if (*buf == NULL || bytes != 0) {
+ newlen = *buflen + BUFSIZ;
+ newbuf = realloc(*buf, newlen);
+ if (newbuf == NULL)
+ return -1;
+ *buf = newbuf;
+ *buflen = newlen;
+ }
+ p = *buf + bytes;
+ memset(p, 0, BUFSIZ);
+ if (fgets(p, BUFSIZ, fp) == NULL)
+ break;
+ bytes += strlen(p);
+ } while (bytes == 0 || *(*buf + (bytes - 1)) != '\n');
+ if (bytes == 0)
+ return -1;
+ return bytes;
+}
+
+#endif
+
#if defined(__APPLE__)
/*

View File

@ -1,16 +1,18 @@
$OpenBSD: patch-i3-input_Makefile,v 1.1 2010/09/14 08:54:18 dcoppa Exp $
--- i3-input/Makefile.orig Wed Jun 9 09:58:21 2010
+++ i3-input/Makefile Mon Jul 19 17:08:51 2010
@@ -9,17 +9,14 @@ HEADERS=$(wildcard *.h)
$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)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "CC $<"
$(CC) $(CFLAGS) -c -o $@ $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: ${FILES}
all: i3-input
i3-input: ${FILES}
- echo "LINK i3-input"
$(CC) -o i3-input ${FILES} $(LDFLAGS)
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
install: all
- echo "INSTALL"

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-i3-input_ipc_c,v 1.1 2010/09/14 08:54:18 dcoppa Exp $
--- i3-input/ipc.c.orig Wed Jun 9 09:58:21 2010
+++ i3-input/ipc.c Thu Jul 15 14:43:03 2010
@@ -60,7 +60,7 @@ int connect_ipc(char *socket_path) {
struct sockaddr_un addr;
memset(&addr, 0, sizeof(struct sockaddr_un));
addr.sun_family = AF_LOCAL;
- strcpy(addr.sun_path, socket_path);
+ strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1);
if (connect(sockfd, (const struct sockaddr*)&addr, sizeof(struct sockaddr_un)) < 0)
err(EXIT_FAILURE, "Could not connect to i3");

View File

@ -1,16 +1,26 @@
$OpenBSD: patch-i3-msg_Makefile,v 1.2 2010/09/14 08:54:18 dcoppa Exp $
--- i3-msg/Makefile.orig Wed Jun 9 09:58:15 2010
+++ i3-msg/Makefile Mon Jul 19 17:08:57 2010
@@ -11,17 +11,14 @@ HEADERS=$(wildcard *.h)
$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
@@ -3,27 +3,22 @@ TOPDIR=..
include $(TOPDIR)/common.mk
-CFLAGS += -I$(TOPDIR)/include
-
# Depend on the object files of all source-files in src/*.c and on all header files
FILES=$(patsubst %.c,%.o,$(wildcard *.c))
HEADERS=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "CC $<"
$(CC) $(CFLAGS) -c -o $@ $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: ${FILES}
all: i3-msg
i3-msg: ${FILES}
- echo "LINK i3-msg"
$(CC) -o i3-msg ${FILES} $(LDFLAGS)
$(CC) $(LDFLAGS) -o i3-msg ${FILES} $(LIBS)
install: all
- echo "INSTALL"

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-i3-msg_main_c,v 1.1 2010/09/14 08:54:18 dcoppa Exp $
--- i3-msg/main.c.orig Wed Jun 9 09:58:15 2010
+++ i3-msg/main.c Thu Jul 15 14:43:03 2010
@@ -175,7 +175,7 @@ int main(int argc, char *argv[]) {
struct sockaddr_un addr;
memset(&addr, 0, sizeof(struct sockaddr_un));
addr.sun_family = AF_LOCAL;
- strcpy(addr.sun_path, socket_path);
+ strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1);
if (connect(sockfd, (const struct sockaddr*)&addr, sizeof(struct sockaddr_un)) < 0)
err(EXIT_FAILURE, "Could not connect to i3");

View File

@ -0,0 +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)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
- echo "CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-nagbar
i3-nagbar: ${FILES}
- echo "LINK i3-nagbar"
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
install: all
- echo "INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 i3-nagbar $(DESTDIR)$(PREFIX)/bin/
+ ${INSTALL_PROGRAM} i3-nagbar $(DESTDIR)$(PREFIX)/bin/
clean:
rm -f *.o

View File

@ -1,26 +1,48 @@
$OpenBSD: patch-i3_config,v 1.3 2011/03/14 12:55:18 dcoppa Exp $
--- i3.config.orig Wed Jan 19 21:26:37 2011
+++ i3.config Mon Mar 14 13:39:50 2011
@@ -101,14 +101,14 @@ bind Mod1+Shift+18 m9
bind Mod1+Shift+19 m10
$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
@@ -9,6 +9,8 @@
# layout, use the i3-config-wizard
#
# Mod1+Enter starts a new terminal
-bind Mod1+36 exec /usr/bin/urxvt
+bind Mod1+36 exec ${X11BASE}/bin/xterm
+set $mod Mod1
+
# font for window titles. ISO 10646 = Unicode
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# Mod1+Shift+q kills the current client
bind Mod1+Shift+24 kill
@@ -16,13 +18,13 @@ font -misc-fixed-medium-r-normal--13-120-75-75-C-70-is
floating_modifier Mod1
# Mod1+v starts dmenu and launches the selected application
# for now, we dont have a launcher of our own.
-bind Mod1+55 exec /usr/bin/dmenu_run
+bind Mod1+55 exec ${LOCALBASE}/bin/dmenu_run
# start a terminal
-bindsym Mod1+Return exec urxvt
+bindsym Mod1+Return exec ${X11BASE}/bin/xterm
# Mod1+Shift+e exits i3
bind Mod1+Shift+26 exit
@@ -123,4 +123,4 @@ ipc-socket ~/.i3/ipc.sock
#############################################################
# DELETE THE FOLLOWING LINES TO DISABLE THE WELCOME MESSAGE #
#############################################################
-exec xmessage -file /etc/i3/welcome
+exec ${X11BASE}/bin/xmessage -file ${SYSCONFDIR}/i3/welcome
# kill focused window
bindsym Mod1+Shift+q kill
# start dmenu (a program launcher)
-bindsym Mod1+d exec dmenu_run
+bindsym Mod1+d exec ${LOCALBASE}/bin/dmenu_run
# change focus
bindsym Mod1+j focus left
@@ -145,17 +147,5 @@ 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
-
-#######################################################################
-# automatically start i3-config-wizard to offer the user to create a
-# keysym-based config which used his favorite modifier (alt or windows)
-#
-# i3-config-wizard will not launch if there already is a config file
-# in ~/.i3/config.
-#
-# Please remove the following exec line:
-#######################################################################
-exec i3-config-wizard
+# Start i3bar to display a workspace bar
+exec ${TRUEPREFIX}/bin/i3bar -d

View File

@ -0,0 +1,28 @@
$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
@@ -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 ${X11BASE}/bin/xterm
# kill focused window
bindcode $mod+Shift+24 kill
# start dmenu (a program launcher)
-bindcode $mod+40 exec dmenu_run
+bindcode $mod+40 exec ${LOCALBASE}/bin/dmenu_run
# change focus
bindcode $mod+44 focus left
@@ -146,6 +146,5 @@ 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

View File

@ -0,0 +1,33 @@
$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)
FILES:=$(FILES:.c=.o)
HEADERS:=$(wildcard include/*.h)
-CPPFLAGS += -I$(TOPDIR)/include
+CPPFLAGS += -Iinclude
all: i3bar doc
i3bar: ${FILES}
- echo "LINK"
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
doc:
- echo ""
- echo "SUBDIR doc"
$(MAKE) -C doc
src/%.o: src/%.c ${HEADERS}
- echo "CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
install: all
- echo "INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 i3bar $(DESTDIR)$(PREFIX)/bin
+ ${INSTALL_PROGRAM} i3bar $(DESTDIR)$(PREFIX)/bin
clean:
rm -f src/*.o

View File

@ -0,0 +1,59 @@
$OpenBSD: patch-i3bar_doc_i3bar_1,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: double-dash in font name got scrambled by a2x
(upstream git commit a5938c40738c51097b4b802f0b5ee409681b4771)
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"
.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)
-.SH "AUTHORS"
+.SH "AUTHOR"
.sp
Axel Wagner and contributors
-.SH "AUTHOR"
-.PP
-\fBAxel Wagner\fR <\&mail+i3bar@merovius\&.de\&>
-.RS 4
-Author.
-.RE

View File

@ -0,0 +1,20 @@
$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

@ -0,0 +1,16 @@
$OpenBSD: patch-include_con_h,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: don't fix floating coordinates when reassigning - fixes
flickering (upstream git commit 6b541d382b89de18104202e5820f466725d77576)
--- 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);
/**
* Returns the orientation of the given container (for stacked containers,

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-include_config_h,v 1.2 2011/03/14 12:55:18 dcoppa Exp $
--- include/config.h.orig Wed Jan 19 21:26:37 2011
+++ include/config.h Thu Mar 10 14:23:42 2011
@@ -127,9 +127,11 @@ struct Config {
/**
* This function resolves ~ in pathnames.
+ * It may resolve wildcards in the first part of the path, but if no match
+ * or multiple matches are found, it just returns a copy of path as given.
*
*/
-char *glob_path(const char *path);
+char *resolve_tilde(const char *path);
/**
* Checks if the given path exists by calling stat().

View File

@ -0,0 +1,16 @@
$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

@ -0,0 +1,16 @@
$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,15 @@
$OpenBSD: patch-man_i3-migrate-config-to-v4_1,v 1.1 2011/11/06 20:23:25 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
@@ -7,7 +7,7 @@
.\" Source: i3 4.0.2
.\" 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"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-man_i3_1,v 1.1 2011/05/09 11:33:35 dcoppa Exp $
--- man/i3.1.orig Mon May 9 13:16:58 2011
+++ man/i3.1 Mon May 9 13:17:26 2011
@@ -252,7 +252,7 @@ When starting, i3 looks for configuration files in the
.sp
You can specify a custom path using the \-c option\&.
.PP
-\fBSample configuration\fR.
+\fBSample configuration\fR.
.sp
.if n \{\
.RS 4
@@ -349,7 +349,7 @@ bind Mod1+Shift+11 2
.sp
This file is where you should configure your locales and start i3\&. It is run by your login manager (xdm, slim, gdm, \&...) as soon as you login\&.
.PP
-\fBSample xsession\fR.
+\fBSample xsession\fR.
.sp
.if n \{\
.RS 4

View File

@ -0,0 +1,63 @@
$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;

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-src_click_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
bugfix: skip dragging of floating containers in fullscreen mode
(upstream git commit 0c367f9e4c67b77420b98a93b5d0e7ab08e695af)
--- 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);
/* 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);
/* 4: floating_modifier plus left mouse button drags */

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-src_cmdparse_y,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: don't fix floating coordinates when reassigning - fixes
flickering (upstream git commit 6b541d382b89de18104202e5820f466725d77576)
--- 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);
}
}
@@ -699,7 +699,7 @@ move:
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);
}
tree_render();

View File

@ -0,0 +1,132 @@
$OpenBSD: patch-src_con_c,v 1.1 2011/11/06 20:23:25 dcoppa Exp $
bugfix: don't fix floating coordinates when reassigning - fixes
flickering (upstream git commit 6b541d382b89de18104202e5820f466725d77576)
bugfix: always adjust floating position when moving to another
output (upstream git commit a5012f60213f29265edfeeaa4574ebeaa61e1ca5)
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;
}
}

View File

@ -1,104 +1,12 @@
$OpenBSD: patch-src_config_c,v 1.4 2011/03/14 12:55:18 dcoppa Exp $
--- src/config.c.orig Wed Jan 19 21:26:37 2011
+++ src/config.c Thu Mar 10 14:23:42 2011
@@ -18,7 +18,6 @@
#include <sys/types.h>
#include <stdlib.h>
#include <glob.h>
-#include <wordexp.h>
#include <unistd.h>
$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
/* We need Xlib for XStringToKeysym */
@@ -39,27 +38,34 @@ struct modes_head modes;
/* 4: check for $XDG_CONFIG_DIRS/i3/config */
if ((xdg_config_dirs = getenv("XDG_CONFIG_DIRS")) == NULL)
- xdg_config_dirs = "/etc/xdg";
+ xdg_config_dirs = "${SYSCONFDIR}/xdg";
/*
* This function resolves ~ in pathnames.
+ * It may resolve wildcards in the first part of the path, but if no match
+ * or multiple matches are found, it just returns a copy of path as given.
*
*/
-char *glob_path(const char *path) {
+char *resolve_tilde(const char *path) {
static glob_t globbuf;
- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0)
+ char *head, *tail, *result;
+
+ tail = strchr(path, '/');
+ head = strndup(path, tail ? tail - path : strlen(path));
+
+ int res = glob(head, GLOB_TILDE, NULL, &globbuf);
+ free(head);
+ /* no match, or many wildcard matches are bad */
+ if(res == GLOB_NOMATCH || globbuf.gl_pathc != 1)
+ result = strdup(path);
+ else if (res != 0) {
die("glob() failed");
- char *result = sstrdup(globbuf.gl_pathc > 0 ? globbuf.gl_pathv[0] : path);
+ result = NULL; /* don't complain about uninitialized */
+ }
+ else {
+ head = globbuf.gl_pathv[0];
+ result = malloc(strlen(head) + (tail ? strlen(tail) : 0) + 1);
+ strncpy(result, head, strlen(head)+1);
+ strncat(result, tail, strlen(tail));
+ }
globfree(&globbuf);
- /* If the file does not exist yet, we still may need to resolve tilde,
- * so call wordexp */
- if (strcmp(result, path) == 0) {
- wordexp_t we;
- wordexp(path, &we, WRDE_NOCMD);
- if (we.we_wordc > 0) {
- free(result);
- result = sstrdup(we.we_wordv[0]);
- }
- wordfree(&we);
- }
-
return result;
}
@@ -239,7 +245,7 @@ static char *get_config_path() {
if ((xdg_config_home = getenv("XDG_CONFIG_HOME")) == NULL)
xdg_config_home = "~/.config";
- xdg_config_home = glob_path(xdg_config_home);
+ xdg_config_home = resolve_tilde(xdg_config_home);
if (asprintf(&config_path, "%s/i3/config", xdg_config_home) == -1)
die("asprintf() failed");
free(xdg_config_home);
@@ -250,12 +256,12 @@ static char *get_config_path() {
/* 2: check for $XDG_CONFIG_DIRS/i3/config */
if ((xdg_config_dirs = getenv("XDG_CONFIG_DIRS")) == NULL)
- xdg_config_dirs = "/etc/xdg";
+ xdg_config_dirs = "${SYSCONFDIR}/xdg";
char *buf = sstrdup(xdg_config_dirs);
char *tok = strtok(buf, ":");
while (tok != NULL) {
- tok = glob_path(tok);
+ tok = resolve_tilde(tok);
if (asprintf(&config_path, "%s/i3/config", tok) == -1)
die("asprintf() failed");
free(tok);
@@ -269,15 +275,15 @@ static char *get_config_path() {
free(buf);
/* 3: check traditional paths */
- config_path = glob_path("~/.i3/config");
+ config_path = resolve_tilde("~/.i3/config");
if (path_exists(config_path))
return config_path;
- config_path = sstrdup("/etc/i3/config");
+ config_path = sstrdup("${SYSCONFDIR}/i3/config");
if (!path_exists(config_path))
die("Neither $XDG_CONFIG_HOME/i3/config, nor "
"$XDG_CONFIG_DIRS/i3/config, nor ~/.i3/config nor "
- "/etc/i3/config exist.");
+ "${SYSCONFDIR}/i3/config exist.");
return config_path;
}
char *buf = sstrdup(xdg_config_dirs);
char *tok = strtok(buf, ":");

View File

@ -0,0 +1,65 @@
$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

@ -0,0 +1,59 @@
$OpenBSD: patch-src_handlers_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
bugfix: honor the X11 window border in ConfigureRequests
(upstream git commit f2f636f9e7872ff19c31649b24d5a19a826e22bd)
bugfix: correctly handle ConfigureRequests for floating windows in
multi-monitor setups (git commit b1aa8107b3bc9510422b4a71744c2bfa71627b12)
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();
}
@@ -454,7 +457,7 @@ static int handle_unmap_notify_event(xcb_unmap_notify_
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,57 +1,41 @@
$OpenBSD: patch-src_ipc_c,v 1.4 2011/05/09 11:03:40 dcoppa Exp $
$OpenBSD: patch-src_ipc_c,v 1.5 2011/11/06 20:23:25 dcoppa Exp $
--- src/ipc.c.orig Sun May 8 14:20:41 2011
+++ src/ipc.c Mon May 9 11:30:45 2011
@@ -92,7 +92,7 @@ static void ipc_send_message(int fd, const unsigned ch
char msg[buffer_size];
char *walk = msg;
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
*
*/
+#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';
- strcpy(walk, "i3-ipc");
+ strncpy(walk, "i3-ipc", buffer_size - 1);
walk += strlen("i3-ipc");
memcpy(walk, &message_size, sizeof(uint32_t));
walk += sizeof(uint32_t);
@@ -530,20 +530,20 @@ void ipc_new_client(EV_P_ struct ev_io *w, int revents
int ipc_create_socket(const char *filename) {
int sockfd;
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
- char *globbed = glob_path(filename);
- DLOG("Creating IPC-socket at %s\n", globbed);
- char *copy = sstrdup(globbed);
+ char *resolved = resolve_tilde(filename);
+ DLOG("Creating IPC-socket at %s\n", resolved);
+ char *copy = sstrdup(resolved);
const char *dir = dirname(copy);
if (!path_exists(dir))
mkdirp(dir);
free(copy);
/* Unlink the unix domain socket before */
- unlink(globbed);
+ unlink(resolved);
if ((sockfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) {
perror("socket()");
- free(globbed);
+ free(resolved);
return -1;
}
@@ -552,14 +552,14 @@ int ipc_create_socket(const char *filename) {
struct sockaddr_un addr;
memset(&addr, 0, sizeof(struct sockaddr_un));
addr.sun_family = AF_LOCAL;
- strcpy(addr.sun_path, globbed);
+ strncpy(addr.sun_path, resolved, sizeof(addr.sun_path) - 1);
if (bind(sockfd, (struct sockaddr*)&addr, sizeof(struct sockaddr_un)) < 0) {
perror("bind()");
- free(globbed);
+ free(resolved);
return -1;
}
- free(globbed);
+ free(resolved);
set_nonblock(sockfd);
if (listen(sockfd, 5) < 0) {
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

@ -0,0 +1,26 @@
$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

@ -0,0 +1,16 @@
$OpenBSD: patch-src_randr_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
--- 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() {
}
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;
}

View File

@ -0,0 +1,71 @@
$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

@ -0,0 +1,21 @@
$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

@ -0,0 +1,16 @@
$OpenBSD: patch-src_workspace_c,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
bugfix: correctly revert focus to other floating windows when closing
a floating window (git commit 4dbda7311480c231332a9dab9ed23d00abecb7e9)
--- 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;
}

View File

@ -0,0 +1,40 @@
$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

@ -0,0 +1,34 @@
$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,18 +1,28 @@
@comment $OpenBSD: PLIST,v 1.2 2010/09/14 08:54:18 dcoppa Exp $
@comment $OpenBSD: PLIST,v 1.3 2011/11/06 20:23:25 dcoppa Exp $
@conflict i3bar-<=0.6.21p1
@pkgpath x11/i3bar
@bin bin/i3
@bin bin/i3-config-wizard
@bin bin/i3-input
bin/i3-migrate-config-to-v4
@bin bin/i3-msg
bin/i3-wsbar
@bin bin/i3-nagbar
@bin bin/i3bar
include/i3/
include/i3/ipc.h
@man man/man1/i3-config-wizard.1
@man man/man1/i3-input.1
@man man/man1/i3-migrate-config-to-v4.1
@man man/man1/i3-msg.1
@man man/man1/i3-wsbar.1
@man man/man1/i3-nagbar.1
@man man/man1/i3.1
@man man/man1/i3bar.1
share/examples/i3/
@sample ${SYSCONFDIR}/i3/
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/