From 95a576bd62c06d6979c1a7ed78cd33949f9ea974 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20D=C3=A9chelotte?= Date: Sun, 5 Mar 2006 19:42:57 +0100 Subject: [PATCH] Fix "smart" placement bug when there are shaded windows in other workspaces Bug overview: New windows are sometimes mis-placed when the "smart" algorithm is used. How to reproduce it: be sure (with WPrefs.app, for instance) to use the so-called "smart" window placement algorithm. In an empty workspace, open a first window (for instance, an xterm). The window should appear at the upper left corner. Shade it (hide its contents below its title bar by double-clicking on it) and select another empty workspace. Open another window. Instead of placing it at the exact same place as the first window, wmaker places the new window a little bit lower, or frankly to the right. Explanation and correction: when placing a new window, wmaker avoided all shaded windows, instead of only avoiding the shaded windows on the active workspace. --- src/placement.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/placement.c b/src/placement.c index 14aa501e..b4f78252 100644 --- a/src/placement.c +++ b/src/placement.c @@ -308,8 +308,8 @@ static int calcSumOfCoveredAreas(WWindow * wwin, int x, int y, int w, int h) tx = test_window->frame_x; ty = test_window->frame_y; - if (test_window->flags.mapped || - (test_window->flags.shaded && + if (test_window->flags.mapped || (test_window->flags.shaded && + test_window->frame->workspace == wwin->screen_ptr->current_workspace && !(test_window->flags.miniaturized || test_window->flags.hidden))) { sum_isect += calcIntersectionArea(tx, ty, tw, th, x, y, w, h); } -- 2.11.4.GIT