Fix popout overlay zone detection: map cursor to window coordinates

This commit is contained in:
pax 2026-04-06 14:16:23 -05:00
parent c6c4df1e77
commit 5e91e7ebb9

View File

@ -341,13 +341,15 @@ class FullscreenPreview(QMainWindow):
self._show_overlay() self._show_overlay()
return True return True
if event.type() == QEvent.Type.MouseMove and self.isActiveWindow(): if event.type() == QEvent.Type.MouseMove and self.isActiveWindow():
y = event.position().y() if hasattr(event, 'position') else event.pos().y() # Map cursor position to window coordinates
h = self.centralWidget().height() cursor_pos = self.mapFromGlobal(event.globalPosition().toPoint() if hasattr(event, 'globalPosition') else event.globalPos())
toolbar_zone = 40 # px from top/bottom edge to trigger y = cursor_pos.y()
if y < toolbar_zone: h = self.height()
zone = 40 # px from top/bottom edge to trigger
if y < zone:
self._toolbar.show() self._toolbar.show()
self._hide_timer.start() self._hide_timer.start()
elif y > h - toolbar_zone and self._stack.currentIndex() == 1: elif y > h - zone and self._stack.currentIndex() == 1:
self._video._controls_bar.show() self._video._controls_bar.show()
self._hide_timer.start() self._hide_timer.start()
self._ui_visible = self._toolbar.isVisible() or self._video._controls_bar.isVisible() self._ui_visible = self._toolbar.isVisible() or self._video._controls_bar.isVisible()