Download this file
20 lines (15 with data), 455 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | from matplotlib import rcParams
try:
if not rcParams['tk.window_focus']:
raise ImportError
from _windowing import GetForegroundWindow, SetForegroundWindow
except ImportError:
def GetForegroundWindow():
return 0
def SetForegroundWindow(hwnd):
pass
class FocusManager:
def __init__(self):
self._shellWindow = GetForegroundWindow()
def __del__(self):
SetForegroundWindow(self._shellWindow)
|
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.