Window Z order

Discuss any general programming issues here
Post Reply
Flinx
Posts: 352
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Window Z order

Post 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()
User avatar
airsoftsoftwair
Posts: 5886
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Window Z order

Post 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
Flinx
Posts: 352
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: Window Z order

Post by Flinx »

This is Mint 22 Wilma, Cinnamon. I'll try to update.
Flinx
Posts: 352
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: Window Z order

Post by Flinx »

On Mint 22.1 still the same, and on SystemRescue 12.00 (based on Arch) too.
User avatar
airsoftsoftwair
Posts: 5886
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Window Z order

Post 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.
Flinx
Posts: 352
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: Window Z order

Post 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.
User avatar
airsoftsoftwair
Posts: 5886
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Window Z order

Post 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
Post Reply