fix: ignore tiny resize events from minimize/RDP disconnect
This commit is contained in:
+6
-2
@@ -515,11 +515,15 @@ class KioskOverlay(QWidget):
|
||||
|
||||
def _on_screen_resize(self, rect):
|
||||
global SCREEN_W, SCREEN_H
|
||||
SCREEN_W, SCREEN_H = rect.width(), rect.height()
|
||||
w, h = rect.width(), rect.height()
|
||||
# Ignore bogus sizes from minimize / RDP disconnect events
|
||||
if w < 400 or h < 200:
|
||||
return
|
||||
SCREEN_W, SCREEN_H = w, h
|
||||
self.setGeometry(0, 0, SCREEN_W, TOP_H)
|
||||
self.resize(SCREEN_W, TOP_H)
|
||||
# Resize Chrome after brief delay so X has settled
|
||||
QTimer.singleShot(300, self._resize_chrome)
|
||||
QTimer.singleShot(500, self._resize_chrome)
|
||||
|
||||
def _resize_chrome(self):
|
||||
self.cdp.resize_window(0, TOP_H, SCREEN_W, SCREEN_H - TOP_H)
|
||||
|
||||
Reference in New Issue
Block a user