1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

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.
This commit is contained in:
Carlos R. Mafra
2009-09-17 00:18:56 +02:00
parent 7a86f48f73
commit 0a0c2391de

View File

@@ -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