From 88a3fe9528c9f41539390cedb0c8d401dd428085 Mon Sep 17 00:00:00 2001 From: pax Date: Fri, 10 Apr 2026 20:16:49 -0500 Subject: [PATCH] fix stuck hover state when mouse exits grid on Wayland --- booru_viewer/gui/grid.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/booru_viewer/gui/grid.py b/booru_viewer/gui/grid.py index c7aa309..3aa2402 100644 --- a/booru_viewer/gui/grid.py +++ b/booru_viewer/gui/grid.py @@ -599,6 +599,16 @@ class ThumbnailGrid(QScrollArea): self.unsetCursor() super().mouseReleaseEvent(event) + def leaveEvent(self, event) -> None: + # Clear stuck hover states — Wayland doesn't always fire + # leaveEvent on individual child widgets when the mouse + # exits the scroll area quickly. + for thumb in self._thumbs: + if thumb._hover: + thumb._hover = False + thumb.update() + super().leaveEvent(event) + def select_all(self) -> None: self._clear_multi() for i in range(len(self._thumbs)):