openbsd-ports/x11/i3/patches/patch-src_randr_c
dcoppa f09c9b963e Bugfix: fix duplicate return value for 'resize' command
(upstream git commit 83dc5d5cb6c71d365cd79b376fcb073e9120144d)

floating_fix_coordinates: properly deal with negative positions
(upstream git commit 74510c59c7db676f1228d054791e1e37456f6660)

randr: fix a crash when the current output cannot be determined
(upstream git commit e867fd810516431f06af0799c90c0f833bf61219)

randr: properly fix floating coordinates when disabling outputs
(upstream git commit d57d51da6d040e8572159332224615f232c4645a)
2012-08-08 14:33:25 +00:00

47 lines
2.3 KiB
Plaintext

$OpenBSD: patch-src_randr_c,v 1.9 2012/08/08 14:33:25 dcoppa Exp $
From e36674c5b8389ff93537fdc9ad32d23bd7add61d Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Sat, 04 Aug 2012 13:19:11 +0000
Subject: Fix a crash when the current output cannot be determined
From d57d51da6d040e8572159332224615f232c4645a Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Sat, 04 Aug 2012 13:21:16 +0000
Subject: Bugfix: Properly fix floating coordinates when disabling outputs
Since the content containers are not yet updated (they will be when
rendering), we need to use the output containers.s rects instead.
--- src/randr.c.orig Wed Apr 25 23:21:25 2012
+++ src/randr.c Wed Aug 8 15:36:52 2012
@@ -359,6 +359,19 @@ void init_ws_for_output(Output *output, Con *content)
workspace_show(previous);
}
+ /* Render the output on which the workspace was to get correct Rects.
+ * Then, we need to work with the "content" container, since we cannot
+ * be sure that the workspace itself was rendered at all (in case it's
+ * invisible, it won't be rendered). */
+ render_con(workspace_out, false);
+ Con *ws_out_content = output_get_content(workspace_out);
+
+ Con *floating_con;
+ TAILQ_FOREACH(floating_con, &(workspace->floating_head), floating_windows)
+ /* NB: We use output->con here because content is not yet rendered,
+ * so it has a rect of {0, 0, 0, 0}. */
+ floating_fix_coordinates(floating_con, &(ws_out_content->rect), &(output->con->rect));
+
con_detach(workspace);
con_attach(workspace, content, false);
@@ -682,7 +695,7 @@ void randr_query_outputs(void) {
DLOG("Fixing the coordinates of floating containers\n");
Con *floating_con;
TAILQ_FOREACH(floating_con, &(current->floating_head), floating_windows)
- floating_fix_coordinates(floating_con, &(old_content->rect), &(first_content->rect));
+ floating_fix_coordinates(floating_con, &(output->con->rect), &(first->con->rect));
DLOG("Done, next\n");
}
DLOG("re-attached all workspaces\n");