mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Stop the indicator from swallowing clicks in its corner
WA_TransparentForMouseEvents does nothing for a top-level window: Qt takes the click and then drops it, so it still never reaches whatever is underneath. Since the window stays mapped while idle, that turned its corner of the screen into a dead zone for good. Qt::WindowTransparentForInput is the one that leaves the window without an input region at all. The dismissable one has to keep taking clicks, and the flag is read once when the window is created, so it shrinks to a point while concealed instead. Resizing keeps the surface alive, which is the whole reason concealing does not simply hide it.
This commit is contained in:
@@ -355,6 +355,25 @@ class Overlay(DikteTest):
|
||||
self.assertTrue(flags & Qt.WindowType.WindowDoesNotAcceptFocus)
|
||||
self.assertTrue(flags & Qt.WindowType.WindowStaysOnTopHint)
|
||||
|
||||
def test_it_lets_a_click_through_to_whatever_is_under_it(self):
|
||||
"""It stays mapped while idle, so without this its corner of the screen
|
||||
would stop taking clicks for good. The widget attribute is not enough:
|
||||
on a top-level window it only makes Qt drop the event it already took."""
|
||||
from PyQt6.QtCore import Qt
|
||||
flags = self.overlay().windowFlags()
|
||||
self.assertTrue(flags & Qt.WindowType.WindowTransparentForInput)
|
||||
|
||||
def test_the_one_that_takes_clicks_shrinks_out_of_the_way(self):
|
||||
"""It has to stay clickable, so it cannot be transparent to input; it
|
||||
gets out of the way by leaving nothing there to click instead."""
|
||||
widget = self.overlay(dismissable=True)
|
||||
widget.show_busy("Asking Claude…")
|
||||
self.assertGreater(widget.width(), 1)
|
||||
widget.dismiss()
|
||||
self.assertEqual((widget.width(), widget.height()), (1, 1))
|
||||
widget.show_busy("Asking Claude…")
|
||||
self.assertGreater(widget.width(), 1)
|
||||
|
||||
def test_recording_then_working_then_done(self):
|
||||
widget = self.overlay()
|
||||
widget.show_recording()
|
||||
|
||||
Reference in New Issue
Block a user