fix: ignore tiny resize events from minimize/RDP disconnect

This commit is contained in:
2026-05-22 13:10:55 +00:00
parent ba2d5c2f17
commit d4041582f0
+6 -2
View File
@@ -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)