openbsd-ports/x11/i3/patches/patch-src_floating_c
dcoppa 71c6e11302 Update to i3-4.0.2 (plus patches from upstream git).
i3bar is now part of i3 itself and i3-wsbar is gone.
2011-11-06 20:23:24 +00:00

66 lines
3.2 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_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;
}