This commit is contained in:
yumoqing 2019-12-23 10:07:49 +08:00
parent 07a1d24d74
commit 7f5c8ff1ff
2 changed files with 8 additions and 5 deletions

View File

@ -17,7 +17,7 @@ class PageContainer(FloatLayout):
Window.bind(size=self.on_window_size)
def on_window_size(self,o,v=None):
if self.size != Window.size:
if self.size[0] != Window.size[0] or self.size[1] != Window.size[1]:
print('on_window_size event fired ....',self.size, Window.size)
self.size = Window.size
self.reshowBackButton()

View File

@ -1,5 +1,6 @@
import os
import sys
from kivy.utils import platform
from traceback import print_exc
from kivy.core.window import Window
from kivy.uix.floatlayout import FloatLayout
@ -217,7 +218,6 @@ class VPlayer(FloatLayout):
print('Window size=',Window.size)
self._fullscreen_state = state = {
"WindowSize":Window.size,
'parent': self.parent,
'pos': self.pos,
'size': self.size,
@ -225,6 +225,8 @@ class VPlayer(FloatLayout):
'size_hint': self.size_hint,
'window_children': window.children[:]}
print('vplayer fullscreen,platform=',platform)
if platform in ['windows', 'linux','macOS' ]:
Window.maximize()
# remove all window children
for child in window.children[:]:
@ -253,8 +255,9 @@ class VPlayer(FloatLayout):
self.size = state['size']
if state['parent'] is not window:
state['parent'].add_widget(self)
Window.size = state['WindowSize']
print('state_size=',state['WindowSize'], 'windowsize=',Window.size)
print('vplayer fullscreen,platform=',platform)
if platform in ['windows', 'linux','macOS' ]:
Window.restore()
def buildMenu(self,obj,touch):
if not self.collide_point(*touch.pos):