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

Fix for get_default_screen() #717

Merged
merged 1 commit into from
Dec 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pyglet/canvas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ def get_screens(self):
raise NotImplementedError('abstract')

def get_default_screen(self):
"""Get the default screen as specified by the user's operating system
"""Get the default (primary) screen as specified by the user's operating system
preferences.

:rtype: :class:`Screen`
"""
return self.get_screens()[0]
screens = self.get_screens()
for screen in screens:
if screen.x == 0 and screen.y == 0:
return screen

# No Primary screen found?
return screens[0]

def get_windows(self):
"""Get the windows currently attached to this display.
Expand Down