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

window.focus() offsets the window position #2271

Open
Splines opened this issue Dec 12, 2024 · 1 comment
Open

window.focus() offsets the window position #2271

Splines opened this issue Dec 12, 2024 · 1 comment
Labels

Comments

@Splines
Copy link
Contributor

Splines commented Dec 12, 2024

In #2241, I've added a new focus() command via these lines. Then in this commit, 3b1b decided to focus() the window every time on initialization, i.e. also when the new reload() command is used.

The problem is that I had to use a workaround in that focus() command since the pyglet activate() method didn't have any effects for me. That's why I did a simple

self._window.set_visible(False)
self._window.set_visible(True)

This consistently restores focus on the window, however it also offsets its position for me, which is quite annoying as the window might even jump around when reaching the corners of the screen.

Tip

I've opened a new issue on the pyglet repo here to track this issue.

@Splines Splines added the bug label Dec 12, 2024
@Splines Splines changed the title Window focus will offset the window window.focus() offsets the window position Dec 12, 2024
@Splines
Copy link
Contributor Author

Splines commented Dec 12, 2024

Thanks for the partial fix via #2274, at least the window doesn't jump around now when I use reload() (but of course doesn't get focus either, but this is a better state than beforehand). Hopefully, the team at pyglet will find a solution such that focus() works properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant