PB6.21, 6.3b2 RPi Wayland WindowX() and WindowY()

Linux specific forum
TassyJim
Enthusiast
Enthusiast
Posts: 189
Joined: Sun Jun 16, 2013 6:27 am
Location: Tasmania (Australia)

PB6.21, 6.3b2 RPi Wayland WindowX() and WindowY()

Post by TassyJim »

With my RPi and Wayland support enabled, Windows always start centered and WindowX() and WindowY() return zero.

Code: Select all

If OpenWindow(0, 10, 10, 300, 300, "Move me !", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
    Repeat
      Event = WaitWindowEvent()
      If event = #PB_Event_SizeWindow Or event = #PB_Event_MoveWindow
        Debug WindowX(0)
        EndIf
    Until Event = #PB_Event_CloseWindow
  EndIf
The code runs as expected until I enable Wayland Support.
I can move windows and they stay moved but I am unable to save their position and always restart centered.
Resize works OK.

Jim
Fred
Administrator
Administrator
Posts: 18341
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB6.21, 6.3b2 RPi Wayland WindowX() and WindowY()

Post by Fred »

Wayland's security model restricts window positioning:

In Wayland, client applications cannot arbitrarily know or control their window positions on screen
The compositor (window manager) has full control over window placement
This prevents malicious applications from:

Positioning windows to trick users (e.g., placing fake password dialogs over real ones)
Reading screen coordinates to infer what other applications are doing
Implementing keyloggers by positioning invisible windows over input fields

Detecting window moves in Wayland with GTK3 is challenging because Wayland doesn't expose window position information to applications.

I will update the doc to reflect this
TassyJim
Enthusiast
Enthusiast
Posts: 189
Joined: Sun Jun 16, 2013 6:27 am
Location: Tasmania (Australia)

Re: PB6.21, 6.3b2 RPi Wayland WindowX() and WindowY()

Post by TassyJim »

Thanks for the explanation Fred.

My application runs faster with Wayland but not being able to position the windows is not ideal.
I will have to reconsider the use of Wayland.

Thanks again
Post Reply