Skip to content

Commit

Permalink
Fix issue with placement in per-monitor configuration.
Browse files Browse the repository at this point in the history
When two monitors are on different desks, ensure that the correct
monitor is used when placing windows. Otherwise placement policies
can use the wrong desk when computing where to place a window.
This is done two fold, first initialize windows with a NULL monitor
so current monitor is used in cases a monitor is not specified
for the window to start on, and second delay updating the window's
monitor until after the window has been placed, so the correct
monitor is found based on the windows location.

This fixes #1043.
  • Loading branch information
somiaj authored and ThomasAdam committed Oct 22, 2024
1 parent b0269cd commit 72df98b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fvwm/add_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,12 @@ static void setup_window_structure(
FW_W(*pfw) = w;
if (savewin != NULL)
{
/* JS: 2024-10-19
* Set initial monitor to NULL, so current monitor can
* be used for placement and finding current desk.
*/
(*pfw)->m = NULL;
(*pfw)->Desk = savewin->Desk;
(*pfw)->m = savewin->m;
SET_SHADED(*pfw, IS_SHADED(savewin));
SET_USED_TITLE_DIR_FOR_SHADING(
*pfw, USED_TITLE_DIR_FOR_SHADING(savewin));
Expand Down Expand Up @@ -2333,8 +2337,6 @@ FvwmWindow *AddWindow(
{
rectangle attr_g;

update_fvwm_monitor(fw);

if (IS_SHADED(fw))
{
state_args.do_shade = 1;
Expand Down

0 comments on commit 72df98b

Please sign in to comment.