Skip to content

Commit

Permalink
ALL: Included PyWinBox module which hopefully better handles multi-mo…
Browse files Browse the repository at this point in the history
…nitor setups (macOS tests pending)

LINUX: Fixed getClientFrame() (thanks to roym899), removed ewmh and pynput dependencies
WINDOWS: Fixed getAllWindows() not returning all relevant windows (thanks to Xenolphthalein)
MACOS: Fixed 'missing value' in window titles and app names (thanks to yjmd2222), fixed getClientFrame() to be invoked from non-main threads (thanks to super-iby)
  • Loading branch information
Kalmat committed Aug 28, 2023
1 parent 94ec877 commit b8d1ac9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ macdeport https://github.com/macdeport
holychowders https://github.com/holychowders
Anthony Molinaro (djnym) https://github.com/djnym
Kyle King https://github.com/KyleKing
Leonard Bruns https://github.com/roym899
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!

PyGetWindow (original module): Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
Expand Down
10 changes: 7 additions & 3 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
0.1, 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
WINDOWS: Simplified alwaysOnBottom(), found a smarter way to refresh window after bringing it back with sendBehind()
MACOS: Tested in multi-monitor setups (based on PyWinBox and PyMonCtl features)
MACOSNSWINDOW: Added experimental acceptInput() method (not possible in AppleScript version)
0.0.44, 2023/08/21 -- ALL: Included PyWinBox module which hopefully better handles multi-monitor setups (macOS tests pending)
LINUX: Fixed geometry calculations (thanks to roym899 - https://github.com/roym899), removed ewmh and pynput dependencies
WINDOWS: Fixed getAllWindows() not returning all relevant windows (thanks to Xenolphthalein - https://github.com/Xenolphthalein)
MACOS: Fixed 'missing value' in window titles and app names (thanks to yjmd2222 - https://github.com/yjmd2222), fixed getClientFrame() to be invoked from non-main threads (thanks to super-iby)
LINUX: Fixed geometry calculations (thanks to roym899), removed ewmh and pynput dependencies
WINDOWS: Fixed getAllWindows() not returning all relevant windows (thanks to Xenolphthalein)
MACOS: Fixed 'missing value' in window titles and app names (thanks to yjmd2222), fixed getClientFrame() to be invoked from non-main threads (thanks to super-iby)
0.0.43, 2023/02/13 -- ALL: Added Window.bbox r/w property, a bounding box in the same (left, top, right, bottom) format used by PIL/Pillow, Included py.typed in wheel package
Linux: Added 'user' argument to restore() and activate() methods as required by some Linux WMs to comply with the request
0.0.42, 2022/12/09 -- Really fixed typing_extensions dependency and setup.py dependencies
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ These functions are available at the moment, in all three platforms (Windows, Li
| getAppsWithName | activate | isAlive |
| getAllAppsWindowsTitles | resize / resizeRel | |
| getWindowsAt | resizeTo | |
| getAllScreens | move / moveRel | |
| getMousePos | moveTo | |
| getScreenSize | raiseWindow | |
| getWorkArea | lowerWindow | |
| version | alwaysOnTop | |
| checkPermissions (macOS only) | alwaysOnBottom | |
| getTopWindowAt | move / moveRel | |
| displayWindowsUnderMouse | moveTo | |
| version | raiseWindow | |
| checkPermissions (macOS only) | lowerWindow | |
| | alwaysOnTop | |
| | alwaysOnBottom | |
| | sendBehind | |
| | acceptInput | |
| | getAppName | |
| | getHandle | |
| | getParent | |
| | setParent | |
| | getChildren | |
| | isParent | |
| | isChild | |
Expand All @@ -73,7 +74,7 @@ In case you find problems in other configs, please [open an issue](https://githu

## Window Change Notifications <a name="watchdog"></a>

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.
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.

The watchdog will automatically stop when window doesn't exist anymore or main program quits.

Expand Down
1 change: 1 addition & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Windows:
- alwaysOnBottom(): Try to find other smarter methods to keep window at the bottom (now it's a thread)

macOS / AppleScript:
- Test in an actual macOS multi-monitor (preferably 3+ monitors) system
- In general, find a way to optimize all AppScript calls in terms of time and resources
https://discussions.apple.com/thread/1877444
https://discussions.apple.com/thread/2189505
Expand Down
Binary file removed dist/PyWinCtl-0.0.44-py3-none-any.whl
Binary file not shown.
Binary file added dist/PyWinCtl-0.0.45-py3-none-any.whl
Binary file not shown.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
license='BSD 3',
packages=find_packages(where='src'),
package_dir={'': 'src'},
package_data={"pywinctl": ["src/pywinctl/py.typed"]},
package_data={"pywinctl": ["py.typed"], "ewmhlib": ["py.typed"]},
test_suite='tests',
install_requires=[
"pywinbox>=0.3",
"pywin32>=302; sys_platform == 'win32'",
"python-xlib>=0.21; sys_platform == 'linux'",
"pyobjc>=8.1; sys_platform == 'darwin'"
"pyobjc>=8.1; sys_platform == 'darwin'",
"pymonctl>=0.1",
"pywinbox>=0.4"
],
extras_require={
'dev': [
Expand Down
2 changes: 1 addition & 1 deletion src/pywinctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
if sys.platform == "darwin":
__all__ += ["NSWindow"]

__version__ = "0.0.44"
__version__ = "0.0.45"


def version(numberOnly: bool = True):
Expand Down

0 comments on commit b8d1ac9

Please sign in to comment.