I don't know if it will fix the problem that Paul reported, but right now I am convinced that this is needed. I should avoid the obvious code duplication here, but will do that when time permits.
I pushed it to 'next' together with two other patches I had in the queue. >From 7bd74000ab2f972805e6942f729d39d7b538d26d Mon Sep 17 00:00:00 2001 From: Carlos R. Mafra <[email protected]> Date: Thu, 17 Sep 2009 00:18:56 +0200 Subject: [PATCH] Maximus: Avoid a window list order issue If we compute the maximus geometry in only one pass through the window list, the order in which the windows appear in the list can affect the outcome. That is because before computing the intersections in the y-projections we update the y coordinates from whatever window which happened to change the new_y coordinate during the previous x-intersection computations, but that may not be _the_ blocking window which decides the final positions in the y axis. Therefore we may find that this "intermediate window state" has a non-vanishing y-intersection with another one -- and be blocked by it -- even though that should not be the case for the final outcome. So to avoid that we first scan through all the windows to decide the final maximumized coordinates in the y axis. Only after that we compute the x-coordinates. --- src/actions.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/actions.c b/src/actions.c index 1a383f2..c9c8070 100644 --- a/src/actions.c +++ b/src/actions.c @@ -474,6 +474,26 @@ static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, i new_botton_0 = top_j; } } + } + + tmp = wwin; + while (tmp->prev) { + /* ignore windows in other workspaces or minimized */ + if (tmp->prev->frame->workspace != wwin->screen_ptr->current_workspace + || tmp->prev->flags.miniaturized) { + tmp = tmp->prev; + continue; + } + tmp = tmp->prev; + + /* set the w_j window coordinates */ + x_j = tmp->frame_x; + y_j = tmp->frame_y; + width_j = tmp->frame->core->width; + height_j = tmp->frame->core->height; + botton_j = y_j + height_j; + top_j = y_j; + right_border_j = x_j + width_j; /* * Use the updated y coordinates from the above step to account -- 1.6.5.rc1 -- To unsubscribe, send mail to [email protected].
