Fix invisible overlay blocking mouse clicks
This commit is contained in:
@@ -65,6 +65,10 @@ class WindowHook:
|
||||
# (Window 420x140, Pill 380x100)
|
||||
self.logical_rect = [20, 20, 20+380, 20+100]
|
||||
self.current_scale = initial_scale
|
||||
self.enabled = True # New flag
|
||||
|
||||
def set_enabled(self, enabled):
|
||||
self.enabled = enabled
|
||||
|
||||
def install(self):
|
||||
proc_address = ctypes.cast(self.new_wnd_proc, ctypes.c_void_p)
|
||||
@@ -73,6 +77,10 @@ class WindowHook:
|
||||
def wnd_proc_callback(self, hwnd, msg, wParam, lParam):
|
||||
try:
|
||||
if msg == WM_NCHITTEST:
|
||||
# If disabled (invisible/inactive), let clicks pass through (HTTRANSPARENT)
|
||||
if not self.enabled:
|
||||
return HTTRANSPARENT
|
||||
|
||||
res = self.on_nchittest(lParam)
|
||||
if res != 0:
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user