/usr/share/pyshared/matplotlib/backends/windowing.py is in python-matplotlib 1.3.1-1ubuntu5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """
MS Windows-specific helper for the TkAgg backend.
With rcParams['tk.window_focus'] default of False, it is
effectively disabled.
It uses a tiny C++ extension module to access MS Win functions.
"""
from __future__ import print_function
from matplotlib import rcParams
try:
if not rcParams['tk.window_focus']:
raise ImportError
from matplotlib._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)
|