Page 1 of 1

Window Z order

Posted: Wed May 14, 2025 7:22 pm
by Flinx
A question: On Windows and Linux Display 2 is in front of 1 (more not tested). Shouldn't display 1 be at the front in this example? And how can I get it in front of 2?

Code: Select all

@DISPLAY {Width = 400, Height = 300, Color = #GRAY}
top=GetAttribute(#DISPLAY, 1, #ATTRYPOS)
left=GetAttribute(#DISPLAY, 1, #ATTRXPOS)
CreateDisplay(2, {Width = 200, Height = 100, X=left-50, Y=top, Active=False})
OpenDisplay(2,False)

SelectDisplay(1)
ActivateDisplay(1)
DebugPrint("Display 1:",GetAttribute(#DISPLAY, 1, #ATTRACTIVE))
DebugPrint("Display 2:",GetAttribute(#DISPLAY, 2, #ATTRACTIVE))
WaitLeftMouse()

Re: Window Z order

Posted: Sun May 18, 2025 5:48 pm
by airsoftsoftwair
On Windows this is clearly a bug (fixed now), but I can't reproduce it on Linux. On Linux it works correctly here. Which Linux are you on?

Code: Select all

- Fix [Windows]: ActivateDisplay() just activated the display without moving it to the front of the window stack z-order

Re: Window Z order

Posted: Sun May 18, 2025 11:49 pm
by Flinx
This is Mint 22 Wilma, Cinnamon. I'll try to update.

Re: Window Z order

Posted: Mon May 19, 2025 10:24 am
by Flinx
On Mint 22.1 still the same, and on SystemRescue 12.00 (based on Arch) too.

Re: Window Z order

Posted: Sun May 25, 2025 7:21 pm
by airsoftsoftwair
Do they use Wayland instead of X11? Using the Wayland-X11 wrapper many things won't work as they did with X11 because the wrapper apparently doesn't emulate everything.

Re: Window Z order

Posted: Mon May 26, 2025 1:28 pm
by Flinx
airsoftsoftwair wrote: Sun May 25, 2025 7:21 pm Do they use Wayland instead of X11?
No, both use X. And on Raspberry Pi OS (where it is the same), I can change from Wayland to X11 with a configuration switch, but that makes no difference.

Re: Window Z order

Posted: Thu Jun 05, 2025 7:24 pm
by airsoftsoftwair
Ok, fixed now.

Code: Select all

- Fix [Linux]: ActivateDisplay() didn't work with all window managers 
And actually, your MCVE also revealed another problem because #ATTRXPOS and #ATTRYPOS weren't always correct for displays on Linux, so this is fixed now too:

Code: Select all

- Fix [Linux]: #ATTRXPOS and #ATTRYPOS didn't always return the correct position for #DISPLAY