screenoverlay 0.6.0__tar.gz → 0.6.2__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.2}/PKG-INFO +1 -1
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/screenoverlay/overlay.py +37 -3
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/screenoverlay.egg-info/PKG-INFO +1 -1
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/setup.py +1 -1
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/LICENSE +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/README.md +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/screenoverlay/__init__.py +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/screenoverlay.egg-info/SOURCES.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/screenoverlay.egg-info/dependency_links.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/screenoverlay.egg-info/requires.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/screenoverlay.egg-info/top_level.txt +0 -0
- {screenoverlay-0.6.0 → screenoverlay-0.6.2}/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
|
"""
|
|
@@ -78,7 +79,7 @@ class NativeBlurOverlay:
|
|
|
78
79
|
|
|
79
80
|
while True:
|
|
80
81
|
overlay.show() # Show overlay (instant)
|
|
81
|
-
|
|
82
|
+
time.sleep(2)
|
|
82
83
|
overlay.hide() # Hide overlay (instant)
|
|
83
84
|
overlay.update() # Keep overlay responsive (call regularly!)
|
|
84
85
|
|
|
@@ -103,26 +104,34 @@ class NativeBlurOverlay:
|
|
|
103
104
|
self.start()
|
|
104
105
|
|
|
105
106
|
if not self._is_visible:
|
|
107
|
+
print(f"\n🔴 SHOWING overlay windows...")
|
|
106
108
|
for win in self.windows:
|
|
107
109
|
try:
|
|
108
110
|
win.deiconify()
|
|
111
|
+
win.attributes('-topmost', True) # Re-enable topmost when showing
|
|
109
112
|
win.lift()
|
|
110
113
|
except Exception as e:
|
|
111
114
|
print(f"Warning: Failed to show window: {e}")
|
|
112
115
|
self._is_visible = True
|
|
116
|
+
print(f"✅ OVERLAY IS NOW VISIBLE\n")
|
|
113
117
|
|
|
114
118
|
def hide(self):
|
|
115
|
-
"""Hide the overlay (
|
|
119
|
+
"""Hide the overlay using withdraw() (lightweight, fast, no resource leaks)"""
|
|
116
120
|
if self.root is None:
|
|
117
121
|
return # Not started yet
|
|
118
122
|
|
|
119
123
|
if self._is_visible:
|
|
124
|
+
# LIGHTWEIGHT HIDE - just withdraw windows (don't destroy/recreate)
|
|
125
|
+
print(f"🫥 WITHDRAWING overlay windows (lightweight hide)...")
|
|
120
126
|
for win in self.windows:
|
|
121
127
|
try:
|
|
128
|
+
win.attributes('-topmost', False) # Remove topmost before hiding
|
|
122
129
|
win.withdraw()
|
|
123
130
|
except Exception as e:
|
|
124
|
-
print(f"Warning: Failed to
|
|
131
|
+
print(f"Warning: Failed to withdraw window: {e}")
|
|
132
|
+
|
|
125
133
|
self._is_visible = False
|
|
134
|
+
print(f"✅ OVERLAY HIDDEN (windows withdrawn)\n")
|
|
126
135
|
|
|
127
136
|
def update(self):
|
|
128
137
|
"""
|
|
@@ -143,6 +152,31 @@ class NativeBlurOverlay:
|
|
|
143
152
|
"""
|
|
144
153
|
if self.root is not None:
|
|
145
154
|
try:
|
|
155
|
+
import time
|
|
156
|
+
current_time = time.time()
|
|
157
|
+
|
|
158
|
+
# Throttle: only update every 100ms (10 FPS) to reduce CPU load
|
|
159
|
+
# This prevents excessive event processing while keeping UI responsive
|
|
160
|
+
if current_time - self._last_update_time < 0.1:
|
|
161
|
+
return # Skip this update
|
|
162
|
+
|
|
163
|
+
self._last_update_time = current_time
|
|
164
|
+
|
|
165
|
+
# Defensive check: verify window state matches _is_visible flag
|
|
166
|
+
for win in self.windows:
|
|
167
|
+
try:
|
|
168
|
+
actual_state = win.winfo_viewable()
|
|
169
|
+
if actual_state and not self._is_visible:
|
|
170
|
+
print(f"⚠️ BUG DETECTED: Window is visible but _is_visible=False! Force hiding...")
|
|
171
|
+
win.attributes('-topmost', False)
|
|
172
|
+
win.withdraw()
|
|
173
|
+
elif not actual_state and self._is_visible:
|
|
174
|
+
print(f"⚠️ BUG DETECTED: Window is hidden but _is_visible=True! Syncing flag...")
|
|
175
|
+
self._is_visible = False
|
|
176
|
+
except Exception as e:
|
|
177
|
+
pass # Ignore errors in defensive check
|
|
178
|
+
|
|
179
|
+
# Process Tkinter events
|
|
146
180
|
self.root.update()
|
|
147
181
|
except Exception as e:
|
|
148
182
|
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.2",
|
|
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
|