Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swapping back from fullscreen moves the window up/left (win32, pyglet 2.1) #1099

Open
einarf opened this issue Apr 29, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@einarf
Copy link
Member

einarf commented Apr 29, 2024

This is new in 2.1. I can't reproduce it in 2.0.15.

If you toggle fullscreen and window mode repeatedly the window keeps moving slightly up and to the left. If you keep toggling the window can move outside the desktop area. The step it moves is likely equal to the size of the top bar of the window (and the left window border).

Quick example. Just press F a few times and see how the window moves. I don't know if this is an issue on multiple platforms.

import pyglet

window = pyglet.window.Window()
label = pyglet.text.Label('Hello, world!',
                          font_size=36,
                          x=window.width // 2,
                          y=window.height // 2,
                          anchor_x='center',
                          anchor_y='center')

@window.event
def on_draw():
    window.clear()
    label.draw()

@window.event
def on_key_press(symbol, modifiers):
    if symbol == pyglet.window.key.F:
        window.set_fullscreen(not window.fullscreen)

pyglet.app.run()
@einarf einarf added the bug Something isn't working label Apr 29, 2024
@pushfoo
Copy link
Contributor

pushfoo commented Apr 29, 2024

Wayland + GNOME on Linux appears unaffected.

@benmoran56
Copy link
Member

Strange one. I was able to replicate it with both pyglet 2.0.15, and 2.1, under Wayland and Xorg.

Gnome 46, pyglet 2.0.15, Xorg: replicated
Gnome 46, pyglet 2.0.15, Wayland: replicated
Gnome 46, pyglet 2.1, Xorg: replicated
Gnome 46, pyglet 2.1, Wayland: replicated

Assuming that this behavior did not occur in the past, I suspect that it might be an Xorg/Xwayland issue.
My system has xorg-server 21.1.13. @pushfoo are you running an older version by chance?

@pushfoo
Copy link
Contributor

pushfoo commented Apr 30, 2024

Gnome 3.38.5, but I don't have an xorg-server package. Here's a gist of dpkg -l | grep xorg-server.

@benmoran56
Copy link
Member

OK, so it doesn't occur in Xorg 1.17.

Also to note that on Gnome 46, the window never moves outside of the desktop area. It's also only being repositioned a few pixels up-left, and is more than the window border but less than the window title bar. That doesn't seem related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants