Skip to content

Commit 06b8845

Browse files
committed
Merge pull request kivy#2657 from kivy/sdl2_resize
Implement `resizable` config option in sdl2 window
2 parents 35789f8 + 1aaf95b commit 06b8845

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

kivy/core/window/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def _get_system_size(self):
471471
472472
.. versionadded:: 1.9.0
473473
474-
:attr:`borderless` is a :class:`BooleanProperty`.
474+
:attr:`borderless` is a :class:`BooleanProperty`, defaults to False.
475475
'''
476476

477477
fullscreen = OptionProperty(False, options=(True, False, 'auto', 'fake'))

kivy/core/window/_window_sdl2.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ cdef class _WindowSDL2Storage:
1919
raise RuntimeError(<bytes> SDL_GetError())
2020

2121
def setup_window(self, x, y, width, height, borderless, fullscreen,
22-
shaped=False):
23-
self.win_flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE
22+
resizable, shaped=False):
23+
self.win_flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN
24+
if resizable:
25+
self.win_flags |= SDL_WINDOW_RESIZABLE
2426
if borderless or shaped:
2527
self.win_flags |= SDL_WINDOW_BORDERLESS
2628
if fullscreen == 'auto':

kivy/core/window/window_pygame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def create_window(self, *largs):
5151
# on window / macosx, the opengl context is lost, and we need to
5252
# reconstruct everything. Check #168 for a state of the work.
5353
if platform in ('linux', 'macosx', 'win') and \
54-
Config.getint('graphics', 'resizable'):
54+
Config.getboolean('graphics', 'resizable'):
5555
self.flags |= pygame.RESIZABLE
5656

5757
try:

kivy/core/window/window_sdl2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ def create_window(self, *largs):
122122

123123
# setup !
124124
w, h = self._size
125+
resizable = Config.getboolean('graphics', 'resizable')
125126
gl_size = self._win.setup_window(pos[0], pos[1], w, h,
126-
self.borderless, self.fullscreen)
127+
self.borderless, self.fullscreen,
128+
resizable)
127129
# never stay with a None pos, application using w.center
128130
# will be fired.
129131
self._pos = (0, 0)

0 commit comments

Comments
 (0)