You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LINUX: Added experimental Wayland support (only if unsafe mode enabled and only for some apps). Fixed ewmhlib freezing in Wayland when connecting to display ":1", and added some performance improvements
In general, all those who so generously share their work and knowledge on Internet (stackoverflow, github, ...) so I could find a solution or a string to pull!
14
+
ReaperMantis https://github.com/ReaperMantis
15
15
16
-
PyGetWindow (original module): Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
17
-
people who have submitted patches, reported bugs, added translations, helped
18
-
answer newbie questions, and generally made PyGetWindow that much better:
19
-
20
-
Al Sweigart https://github.com/asweigart/
21
-
arkulinskis https://github.com/arkulinskis
22
-
aweffr https://github.com/aweffr
23
-
Demonthos https://github.com/Demonthos
24
-
Duxxi https://github.com/sjhhh3
25
-
EMOholcicka https://github.com/EMOholcicka
26
-
Kudria https://github.com/Kudria
27
-
lexxish https://github.com/lexxish
28
-
李宏杰 https://github.com/lihongjie0209
29
-
Randall White
30
-
Ronald Oussoren
31
-
Steve Newell https://github.com/newellista
16
+
In general, all those who so generously share their work and knowledge on Internet (stackoverflow, github, ...)
Copy file name to clipboardExpand all lines: CHANGES.txt
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
-
0.1, 2023/02/03 -- LINUX: Added experimental Wayland support (only if unsafe mode enabled and only for some apps).
1
+
0.2, 2023/09/09 -- LINUX: Added experimental Wayland support (only if unsafe mode enabled and only for some apps).
2
+
Fixed ewmhlib freezing in Wayland when connecting to display ":1", and added some performance improvements
3
+
0.1, 2023/09/06 -- LINUX: Fixed all title-related methods (title, getAllTitles, getAllAppsWindowTitles, etc.) returning empty values when using Xlib's get_wm_name()
2
4
MACOS: Tested OK in multi-monitor setups (based on PyWinBox and PyMonCtl features).
3
5
ALL: getDisplay() method returns a list of monitors.
4
6
0.0.50, 2023/02/03 -- ALL: Added PyMonCtl module to improve multi-monitor capabilities, added setParent() method. Reorganized to avoid IDEs showing external and / or private elements
5
7
WINDOWS: Simplified alwaysOnBottom(), found a smarter way to refresh window after bringing it back with sendBehind()
6
-
MACOS: Tested in multi-monitor setups (based on PyWinBox and PyMonCtl features)
7
8
MACOSNSWINDOW: Added experimental acceptInput() method (not possible in AppleScript version)
8
9
0.0.45, 2023/08/21 -- ALL: Included PyWinBox module which hopefully better handles multi-monitor setups (macOS tests pending)
9
10
LINUX: Fixed geometry calculations (thanks to roym899), removed ewmh and pynput dependencies
Copy file name to clipboardExpand all lines: README.md
+8-12Lines changed: 8 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ Cross-Platform module to get info on and control windows on screen.
6
6
7
7
With PyWinCtl you can retrieve info or control windows from other open applications, as well as use it as a cross-platform toolkit to manipulate your own application windows.
8
8
9
-
This module is a Python 3 evolution from [asweigart's PyGetWindow module](https://github.com/asweigart/PyGetWindow), which adds Linux/X11 and macOS support to the MS Windows-only original module, experimental multi-monitor support, and many additional features; in the hope others can use it, test it or contribute.
9
+
This module is a Python 3 evolution from [asweigart's PyGetWindow module](https://github.com/asweigart/PyGetWindow), which adds Linux/X11 and macOS support to the MS Windows-only original module, multi-monitor support, and many additional features; in the hope others can use it, test it or contribute.
10
10
11
-
My most sincere thanks and acknowledgement to [MestreLion](https://github.com/MestreLion), [super-ibby](https://github.com/super-ibby), [Avasam](https://github.com/Avasam), [macdeport](https://github.com/macdeport) and [holychowders](https://github.com/holychowders) for their help and moral boost.
11
+
My most sincere thanks and acknowledgement. amongst many others (see AUTHORS.txt), to [MestreLion](https://github.com/MestreLion), [super-ibby](https://github.com/super-ibby), [Avasam](https://github.com/Avasam), [macdeport](https://github.com/macdeport) and [holychowders](https://github.com/holychowders) for their help and moral boost.
12
12
13
13
1.[Window Features](#window-features)
14
14
1.[Important macOS notice](#macos-notice)
@@ -61,7 +61,7 @@ These functions are available at the moment, in all three platforms (Windows, Li
macOS doesn't "like" controlling windows from other apps, so there are two separate classes you can use:
64
-
- To control your own application's windows: MacOSNSWindow() is based on NSWindow Objects (you have to pass the NSApp() Object reference).
64
+
- To control your own application's windows: MacOSNSWindow() is based on NSWindow Objects (you have to pass the NSApp() and the NSWindow() objects reference).
65
65
- To control other applications' windows: MacOSWindow() is based on Apple Script, so it is non-standard, slower and, in some cases, tricky (uses window name as reference, which may change or be duplicate), but it's working fine in most cases. You will likely need to grant permissions on Settings -> Security&Privacy -> Accessibility. ***Notice some applications will have limited Apple Script support or no support at all, so some or even all methods may fail!***
66
66
67
67
***Important Linux notice <aname="linux-notice"></a>***
@@ -70,7 +70,7 @@ The enormous variety of Linux distributions, Desktop Environments, Window Manage
70
70
71
71
This module has been tested OK in some X11 setups: Ubuntu/Gnome, Ubuntu/KDE, Ubuntu/Unity, Mint/Cinnamon and Raspbian/LXDE. Except for Mint/Cinnamon and Ubuntu 22.04+, `sendBehind()` method doesn't properly work!
72
72
73
-
In Wayland (the new GNOME compositor for Ubuntu 22.04+), it is not possible to retrieve the active window nor the list
73
+
In Wayland (the new GNOME protocol for Ubuntu 22.04+), it is not possible to retrieve the active window nor the list
74
74
of open windows, so `getActiveWindow()` and `getAllWindows()` will not work even though unsafe-mode is
75
75
enabled (built-in and "official" applications do not populate their XID nor their X-Window object, so it may work for
76
76
other applications like Chrome or your own application windows)
@@ -79,7 +79,7 @@ In case you find problems in other configs, please [open an issue](https://githu
Window watchdog sub-class, running in a separate Thread, will allow you to define hooks and its callbacks to be notified when some window states change. Accessible through 'watchdog' submodule.
82
+
Window watchdog sub-class, running in a separate Thread, will allow to define hooks and its callbacks to be notified when some window states change. Accessible through 'watchdog' submodule.
83
83
84
84
The watchdog will automatically stop when window doesn't exist anymore or main program quits.
85
85
@@ -217,7 +217,7 @@ Note not all windows/applications will have a menu accessible by these methods.
217
217
218
218
To install this module on your system, you can use pip:
219
219
220
-
pip install pywinctl
220
+
pip3 install pywinctl
221
221
222
222
or
223
223
@@ -244,17 +244,13 @@ If you want to use this code or contribute, you can either:
244
244
* Create a fork of the [repository](https://github.com/Kalmat/PyWinCtl), or
245
245
*[Download the repository](https://github.com/Kalmat/PyWinCtl/archive/refs/heads/master.zip), uncompress, and open it on your IDE of choice (e.g. PyCharm)
246
246
247
-
Be sure you install all dependencies described on "docs/requirements.txt" by using pip
247
+
Be sure you install all dependencies described on "requirements.txt" by using pip
248
248
249
249
## TEST <aname="test"></a>
250
250
251
251
To test this module on your own system, cd to "tests" folder and run:
252
252
253
-
pytest -vv test_pywinctl.py
254
-
255
-
or, in case you get an import error, try this:
256
-
257
-
python3 -m pytest -vv test_pywinctl.py
253
+
python3 test_pywinctl.py
258
254
259
255
MacOSNSWindow class and methods can be tested by running this, also on "tests" folder:
0 commit comments