mirror of https://github.com/kivy/kivy.git
core/window: remove some debugs
This commit is contained in:
parent
d45219d5b8
commit
edd1d2a5ee
|
@ -20,6 +20,7 @@ from kivy.modules import Modules
|
||||||
from kivy.event import EventDispatcher
|
from kivy.event import EventDispatcher
|
||||||
from kivy.properties import ListProperty, ObjectProperty, AliasProperty, \
|
from kivy.properties import ListProperty, ObjectProperty, AliasProperty, \
|
||||||
NumericProperty, OptionProperty, StringProperty
|
NumericProperty, OptionProperty, StringProperty
|
||||||
|
from kivy.utils import platform
|
||||||
|
|
||||||
# late import
|
# late import
|
||||||
VKeyboard = None
|
VKeyboard = None
|
||||||
|
@ -482,7 +483,6 @@ class WindowBase(EventDispatcher):
|
||||||
# called, unset the trigger
|
# called, unset the trigger
|
||||||
Clock.unschedule(self.create_window)
|
Clock.unschedule(self.create_window)
|
||||||
|
|
||||||
print 'create window !!'
|
|
||||||
if not self.initialized:
|
if not self.initialized:
|
||||||
from kivy.core.gl import init_gl
|
from kivy.core.gl import init_gl
|
||||||
init_gl()
|
init_gl()
|
||||||
|
@ -496,11 +496,18 @@ class WindowBase(EventDispatcher):
|
||||||
else:
|
else:
|
||||||
# if we get initialized more than once, then reload opengl state
|
# if we get initialized more than once, then reload opengl state
|
||||||
# after the second time.
|
# after the second time.
|
||||||
|
# XXX check how it's working on embed platform.
|
||||||
from kivy.graphics.opengl_utils import gl_reload
|
from kivy.graphics.opengl_utils import gl_reload
|
||||||
gl_reload()
|
if platform() == 'linux':
|
||||||
def ask_update(dt):
|
# on linux, it's safe for just sending a resize.
|
||||||
self.canvas.ask_update()
|
self.dispatch('on_resize', *self.system_size)
|
||||||
Clock.schedule_once(ask_update, 0)
|
|
||||||
|
else:
|
||||||
|
# on other platform, window are recreated, we need to reload.
|
||||||
|
gl_reload()
|
||||||
|
def ask_update(dt):
|
||||||
|
self.canvas.ask_update()
|
||||||
|
Clock.schedule_once(ask_update, 0)
|
||||||
|
|
||||||
# ensure the gl viewport is correct
|
# ensure the gl viewport is correct
|
||||||
self.update_viewport()
|
self.update_viewport()
|
||||||
|
@ -631,9 +638,6 @@ class WindowBase(EventDispatcher):
|
||||||
|
|
||||||
def on_resize(self, width, height):
|
def on_resize(self, width, height):
|
||||||
'''Event called when the window is resized'''
|
'''Event called when the window is resized'''
|
||||||
print '-- on resize', width, height
|
|
||||||
from kivy.graphics.opengl_utils import gl_reload
|
|
||||||
gl_reload()
|
|
||||||
self.update_viewport()
|
self.update_viewport()
|
||||||
|
|
||||||
def update_viewport(self):
|
def update_viewport(self):
|
||||||
|
|
|
@ -37,7 +37,6 @@ class WindowPygame(WindowBase):
|
||||||
# have some weird bugs
|
# have some weird bugs
|
||||||
self.dispatch('on_mouse_up', 0, 0, 'all', [])
|
self.dispatch('on_mouse_up', 0, 0, 'all', [])
|
||||||
|
|
||||||
print 'window create'
|
|
||||||
# force display to show (available only for fullscreen)
|
# force display to show (available only for fullscreen)
|
||||||
displayidx = Config.getint('graphics', 'display')
|
displayidx = Config.getint('graphics', 'display')
|
||||||
if not 'SDL_VIDEO_FULLSCREEN_HEAD' in environ and displayidx != -1:
|
if not 'SDL_VIDEO_FULLSCREEN_HEAD' in environ and displayidx != -1:
|
||||||
|
@ -270,7 +269,8 @@ class WindowPygame(WindowBase):
|
||||||
|
|
||||||
# video resize
|
# video resize
|
||||||
elif event.type == pygame.VIDEORESIZE:
|
elif event.type == pygame.VIDEORESIZE:
|
||||||
self.system_size = event.size
|
self._size = event.size
|
||||||
|
self.update_viewport()
|
||||||
|
|
||||||
elif event.type == pygame.VIDEOEXPOSE:
|
elif event.type == pygame.VIDEOEXPOSE:
|
||||||
self.canvas.ask_update()
|
self.canvas.ask_update()
|
||||||
|
@ -312,7 +312,6 @@ class WindowPygame(WindowBase):
|
||||||
# Pygame wrapper
|
# Pygame wrapper
|
||||||
#
|
#
|
||||||
def _pygame_set_mode(self, size=None):
|
def _pygame_set_mode(self, size=None):
|
||||||
print '>>> pygame set mode', self._size, self.fullscreen, self.flags
|
|
||||||
if size is None:
|
if size is None:
|
||||||
size = self.size
|
size = self.size
|
||||||
if self.fullscreen == 'auto':
|
if self.fullscreen == 'auto':
|
||||||
|
|
Loading…
Reference in New Issue