Bugfix: don't crash when dragged floating window close

Bugfix: draw h-split indicator at the right position

Bugfix: Correctly move floating windows to invisible workspaces
cross-output

From upstream git
This commit is contained in:
dcoppa 2012-10-01 08:12:17 +00:00
parent bdd5a0df6b
commit ab29be00f1
4 changed files with 84 additions and 4 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.48 2012/09/27 10:57:45 dcoppa Exp $
# $OpenBSD: Makefile,v 1.49 2012/10/01 08:12:17 dcoppa Exp $
COMMENT = improved dynamic tiling window manager
DISTNAME = i3-4.3
REVISION = 1
REVISION = 2
CATEGORIES = x11
EXTRACT_SUFX = .tar.bz2

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-src_con_c,v 1.8 2012/10/01 08:12:17 dcoppa Exp $
From 31e8d7f2f81f115f70c1fc3eb404b0cfbc13ddf4 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Fri, 28 Sep 2012 22:02:41 +0000
Subject: Bugfix: Correctly move floating windows to invisible workspaces cross-output
--- src/con.c.orig Wed Sep 19 18:08:09 2012
+++ src/con.c Mon Oct 1 09:44:02 2012
@@ -666,13 +666,20 @@ void con_move_to_workspace(Con *con, Con *workspace, b
con->percent = 0.0;
con_fix_percent(next);
- /* 7: focus the con on the target workspace (the X focus is only updated by
- * calling tree_render(), so for the "real" focus this is a no-op).
+ /* 7: focus the con on the target workspace, but only within that
+ * workspace, that is, don't move focus away if the target workspace is
+ * invisible.
* We dont focus the con for i3 pseudo workspaces like __i3_scratch and
* we dont focus when there is a fullscreen con on that workspace. */
if ((workspace->name[0] != '_' || workspace->name[1] != '_') &&
- con_get_fullscreen_con(workspace, CF_OUTPUT) == NULL)
+ con_get_fullscreen_con(workspace, CF_OUTPUT) == NULL) {
+ /* We need to save focus on workspace level and restore it afterwards.
+ * Otherwise, we might focus a different workspace without actually
+ * switching workspaces. */
+ Con *old_focus = TAILQ_FIRST(&(output_get_content(dest_output)->focus_head));
con_focus(con_descend_focused(con));
+ con_focus(old_focus);
+ }
/* 8: when moving to a visible workspace on a different output, we keep the
* con focused. Otherwise, we leave the focus on the current workspace as we

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_floating_c,v 1.14 2012/10/01 08:12:17 dcoppa Exp $
From 8480b4cb58c30a5fa4ff9761aaed198efa8429f8 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Fri, 28 Sep 2012 16:23:01 +0000
Subject: Bugfix: don't crash when dragged floating window closes
Previously, while the loop would not be executed anymore, the
callback (for actually repositioning the window after a MotionNotify)
would still get called once. This commit avoids that, thus fixing
the crash.
--- src/floating.c.orig Wed Sep 19 18:08:09 2012
+++ src/floating.c Mon Oct 1 09:42:59 2012
@@ -570,7 +570,7 @@ void drag_pointer(Con *con, const xcb_button_press_eve
free(inside_event);
} while ((inside_event = xcb_poll_for_event(conn)) != NULL);
- if (last_motion_notify == NULL)
+ if (last_motion_notify == NULL || loop_done)
continue;
new_x = ((xcb_motion_notify_event_t*)last_motion_notify)->root_x;

View File

@ -1,9 +1,33 @@
$OpenBSD: patch-src_x_c,v 1.6 2012/09/21 17:16:14 dcoppa Exp $
$OpenBSD: patch-src_x_c,v 1.7 2012/10/01 08:12:17 dcoppa Exp $
From a082cf8c65225678af782187e4b6f3ba85a0701a Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Fri, 28 Sep 2012 17:46:50 +0000
Subject: Bugfix: Draw h-split indicator at the right position
OpenBSD lacks POSIX shared memory support (shm_open() and friends)
--- src/x.c.orig Wed Sep 19 18:08:09 2012
+++ src/x.c Thu Sep 20 14:12:10 2012
+++ src/x.c Mon Oct 1 09:44:02 2012
@@ -446,7 +446,7 @@ void x_draw_decoration(Con *con) {
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){ p->color->indicator });
if (con_orientation(con->parent) == HORIZ)
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
- { r->width + br.width + br.x, 0, r->width, r->height + br.height } });
+ { r->width + br.width + br.x, br.y, r->width, r->height + br.height } });
else
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
{ br.x, r->height + br.height + br.y, r->width - (2 * br.x), r->height } });
@@ -792,7 +792,7 @@ static void x_push_node_unmaps(Con *con) {
}
cookie = xcb_unmap_window(conn, con->frame);
- DLOG("unmapping container (serial %d)\n", cookie.sequence);
+ DLOG("unmapping container %p / %s (serial %d)\n", con, con->name, cookie.sequence);
/* we need to increase ignore_unmap for this container (if it
* contains a window) and for every window "under" this one which
* contains a window */
@@ -1037,8 +1037,10 @@ void x_set_i3_atoms(void) {
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_PID, XCB_ATOM_CARDINAL, 32, 1, &pid);
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_CONFIG_PATH, A_UTF8_STRING, 8,