screenoverlay 0.6.0__tar.gz → 0.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/PKG-INFO +1 -1
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/screenoverlay/overlay.py +74 -6
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/screenoverlay.egg-info/PKG-INFO +1 -1
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/setup.py +1 -1
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/LICENSE +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/README.md +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/screenoverlay/__init__.py +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/screenoverlay.egg-info/SOURCES.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/screenoverlay.egg-info/dependency_links.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/screenoverlay.egg-info/requires.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/screenoverlay.egg-info/top_level.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.1}/setup.cfg +0 -0
|
@@ -63,6 +63,7 @@ class NativeBlurOverlay:
|
|
|
63
63
|
self.root = None
|
|
64
64
|
self.windows = [] # List to hold multiple windows for multi-monitor
|
|
65
65
|
self._is_visible = False
|
|
66
|
+
self._last_update_time = 0 # Throttle update() calls
|
|
66
67
|
|
|
67
68
|
def start(self):
|
|
68
69
|
"""
|
|
@@ -98,6 +99,10 @@ class NativeBlurOverlay:
|
|
|
98
99
|
|
|
99
100
|
def show(self):
|
|
100
101
|
"""Show the overlay (instant, <1ms)"""
|
|
102
|
+
import traceback
|
|
103
|
+
print(f"\n🔴 OVERLAY.SHOW() CALLED! Stack trace:")
|
|
104
|
+
traceback.print_stack()
|
|
105
|
+
|
|
101
106
|
if self.root is None:
|
|
102
107
|
# Auto-start if not started yet
|
|
103
108
|
self.start()
|
|
@@ -106,23 +111,61 @@ class NativeBlurOverlay:
|
|
|
106
111
|
for win in self.windows:
|
|
107
112
|
try:
|
|
108
113
|
win.deiconify()
|
|
114
|
+
win.attributes('-topmost', True) # Re-enable topmost when showing
|
|
109
115
|
win.lift()
|
|
110
116
|
except Exception as e:
|
|
111
117
|
print(f"Warning: Failed to show window: {e}")
|
|
112
118
|
self._is_visible = True
|
|
119
|
+
print(f"✅ OVERLAY IS NOW VISIBLE\n")
|
|
113
120
|
|
|
114
121
|
def hide(self):
|
|
115
|
-
"""Hide the overlay (
|
|
122
|
+
"""Hide the overlay by DESTROYING and RECREATING it (prevents ghost windows/CPU leaks)"""
|
|
123
|
+
import traceback
|
|
124
|
+
print(f"\n⚪ OVERLAY.HIDE() CALLED! Stack trace:")
|
|
125
|
+
traceback.print_stack()
|
|
126
|
+
|
|
116
127
|
if self.root is None:
|
|
117
128
|
return # Not started yet
|
|
118
129
|
|
|
119
130
|
if self._is_visible:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
# COMPLETE DESTRUCTION - no lingering windows or events!
|
|
132
|
+
print(f"🗑️ DESTROYING overlay completely...")
|
|
133
|
+
try:
|
|
134
|
+
# Just destroy root - it will destroy all child windows automatically
|
|
135
|
+
if self.root:
|
|
136
|
+
try:
|
|
137
|
+
self.root.destroy()
|
|
138
|
+
except Exception as e:
|
|
139
|
+
print(f"Warning: destroy() failed: {e} (might already be destroyed)")
|
|
140
|
+
except Exception as e:
|
|
141
|
+
print(f"Warning: Failed to destroy overlay: {e}")
|
|
142
|
+
|
|
143
|
+
self.root = None
|
|
144
|
+
self.windows = []
|
|
125
145
|
self._is_visible = False
|
|
146
|
+
print(f"✅ OVERLAY DESTROYED\n")
|
|
147
|
+
|
|
148
|
+
# SAFETY CHECK: Verify system is clean before recreating
|
|
149
|
+
print(f"🔍 SAFETY CHECK: Verifying clean state...")
|
|
150
|
+
if self.root is not None:
|
|
151
|
+
print(f"⚠️ WARNING: self.root is not None after destroy! Force clearing...")
|
|
152
|
+
self.root = None
|
|
153
|
+
if len(self.windows) > 0:
|
|
154
|
+
print(f"⚠️ WARNING: self.windows has {len(self.windows)} entries after destroy! Force clearing...")
|
|
155
|
+
self.windows = []
|
|
156
|
+
if self._is_visible:
|
|
157
|
+
print(f"⚠️ WARNING: _is_visible is True after destroy! Force clearing...")
|
|
158
|
+
self._is_visible = False
|
|
159
|
+
|
|
160
|
+
# Small delay to let Tkinter/macOS fully cleanup
|
|
161
|
+
import time
|
|
162
|
+
time.sleep(0.01) # 10ms delay for cleanup
|
|
163
|
+
print(f"✅ SYSTEM CLEAN\n")
|
|
164
|
+
|
|
165
|
+
# RECREATE FRESH for next show()
|
|
166
|
+
print(f"♻️ RECREATING fresh overlay...")
|
|
167
|
+
self.start()
|
|
168
|
+
print(f"✅ FRESH OVERLAY READY (hidden)\n")
|
|
126
169
|
|
|
127
170
|
def update(self):
|
|
128
171
|
"""
|
|
@@ -143,6 +186,31 @@ class NativeBlurOverlay:
|
|
|
143
186
|
"""
|
|
144
187
|
if self.root is not None:
|
|
145
188
|
try:
|
|
189
|
+
import time
|
|
190
|
+
current_time = time.time()
|
|
191
|
+
|
|
192
|
+
# Throttle: only update every 100ms (10 FPS) to reduce CPU load
|
|
193
|
+
# This prevents excessive event processing while keeping UI responsive
|
|
194
|
+
if current_time - self._last_update_time < 0.1:
|
|
195
|
+
return # Skip this update
|
|
196
|
+
|
|
197
|
+
self._last_update_time = current_time
|
|
198
|
+
|
|
199
|
+
# Defensive check: verify window state matches _is_visible flag
|
|
200
|
+
for win in self.windows:
|
|
201
|
+
try:
|
|
202
|
+
actual_state = win.winfo_viewable()
|
|
203
|
+
if actual_state and not self._is_visible:
|
|
204
|
+
print(f"⚠️ BUG DETECTED: Window is visible but _is_visible=False! Force hiding...")
|
|
205
|
+
win.attributes('-topmost', False)
|
|
206
|
+
win.withdraw()
|
|
207
|
+
elif not actual_state and self._is_visible:
|
|
208
|
+
print(f"⚠️ BUG DETECTED: Window is hidden but _is_visible=True! Syncing flag...")
|
|
209
|
+
self._is_visible = False
|
|
210
|
+
except Exception as e:
|
|
211
|
+
pass # Ignore errors in defensive check
|
|
212
|
+
|
|
213
|
+
# Process Tkinter events
|
|
146
214
|
self.root.update()
|
|
147
215
|
except Exception as e:
|
|
148
216
|
print(f"Warning: Update failed: {e}")
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="screenoverlay",
|
|
8
|
-
version="0.6.
|
|
8
|
+
version="0.6.1",
|
|
9
9
|
author="Pekay",
|
|
10
10
|
author_email="ppnicky@gmail.com",
|
|
11
11
|
description="Cross-platform screen overlay with blur, black, white, and custom modes",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|