arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Improve screen switching for Window

Open pushfoo opened this issue 2 years ago • 4 comments
trafficstars

Enhancement request:

tl;dr: make moving the Window more intuitive

What should be added/changed?

  • A better way to move the window between screens
  • Add an optional screen argument to Window.center_window for convenience

What would it help with?

Moving windows between is currently counter-intuitive. It only seems to be possible through Window.set_fullscreen as result of pyglet API Design, which is how arcade.Window.__init__ selects the current screen. Although the base pyglet Window has a screen property, it is read-only.

pushfoo avatar Oct 15 '23 00:10 pushfoo

The window's position is relative to the primary screen, no matter which screen the window is visible on. If that is the case, you could use that to provide a method of moving the window to a specific screen.

DragonMoffon avatar Oct 16 '23 11:10 DragonMoffon

Should this issue be in the pyglet project? Don't really want to have lingering open here that will stay for years unless it's realistic that someone is going to work on this.

einarf avatar Feb 18 '24 03:02 einarf

Should this issue be in the pyglet project?

TL;DR: pylget doesn't seem to want it + this feature needs a warning it'll break under Wayland if we add it.

Based on what I saw in the pyglet Discord's help channels, my impression was they didn't want to add it. One major issue is that on Wayland, this is actually impossible by design in the original version of the protocol.

TL;DR:

  1. Window manipulation is used as a crude JS fingerprinting technique to detect screen size
  2. The original Wayland protocol design forbids clients from placing their windows to counter this
  3. There seem to be working backward compatibility features through XWayland and a proposal for a protocol extension, but no guarantees it'll merge soon

Imo, this means the feature belongs in arcade if anywhere. If not, we might be able to add some notes to the programming guide + links to info on Wayland and pyglet's doc.

Fun sidenote: I know we technically don't support any BSD, but it should theoretically be possible to get Wayland on it according to the FreeBSD doc.

pushfoo avatar Feb 18 '24 05:02 pushfoo

I don't see this ever getting worked on to be honest. It needs to work cross platform and across different display managers. If it doesn't trickle down from pyglet it probably will never happen.

einarf avatar Feb 21 '24 02:02 einarf

If pyglet doesn't want it there is no way we can realistically make this happen without buying into hacky code we can't possibly maintain.

einarf avatar Jul 12 '24 17:07 einarf

Agreed. Also, Wayland limitations need to be covered better somewhere in their programming guide.

pushfoo avatar Jul 12 '24 17:07 pushfoo