openbsd-ports/x11/i3/patches/patch-src_con_c
dcoppa ab29be00f1 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
2012-10-01 08:12:17 +00:00

34 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$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