Skip to content

Commit a64f366

Browse files
committed
version 0.0.41: New typed version. Improved Window class to accept Window object or window id (int/str), added acceptInput(), added getTopWindowAt(), fixed and improved sendBehind() on Ubuntu 22.04+ and Mint/Cinnamon, improved watchdog, fixed Mint/Cinnamon sendBehind() method, added macOS AppScript alwaysOnTop() and alwaysOnBottom() methods
1 parent 71ef33c commit a64f366

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0.0.41, 2022/12/09 -- Fixed requirements.txt with typing_extensions dependency
12
0.0.40, 2022/12/07 -- New typed version. Improved Window class to accept Window object or window id (int/str), added acceptInput(), added getTopWindowAt(), fixed and improved sendBehind() on Ubuntu 22.04+ and Mint/Cinnamon,
23
0.0.39, 2022/06/07 -- Improved watchdog, fixed Mint/Cinnamon sendBehind() method, added macOS AppScript alwaysOnTop() and alwaysOnBottom() methods
34
0.0.38, 2022/05/29 -- Fixed pynput version typo in setup.py requirements

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ My most sincere thanks and acknowledgement to [Avasam](https://github.com/Avasam
2222

2323
## Window Features <a name="window-features"></a>
2424

25-
You need a Window object to manipulate/control windows on screen. It's possible to get a Window object by using any of the general methods (e.g. getActiveWidow() or getWindowsWithTitle()). You can also use windows id, as returned by PyQt's self.winId() or tkinter's root.frame(), which is very handy to get the Window object for your own application.
25+
You need a Window object to manipulate/control the target window on screen. It's possible to get a Window object by using any of the general methods (e.g. getActiveWidow() or getWindowsWithTitle()). You can also use windows id, as returned by PyQt's self.winId() or tkinter's root.frame(), which is very handy to get the Window object for your own application.
2626

2727
These functions are available at the moment, in all three platforms (Windows, Linux and macOS):
2828

docs/requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# Run: `pip install -r docs/requirements.txt`
33
# Production requirements are found in ../setup.py
44

5-
PyRect>=0.1
5+
PyRect>=0.2
66
types-setuptools>=65.5
7-
mypy >= 0.990
7+
mypy>=0.990
8+
typing_extensions>=4.4.0
89

910
# Windows
1011
pywin32>=302; sys_platform == 'win32'

src/pywinctl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
if sys.platform == "darwin":
2626
__all__ += ["NSWindow"]
2727

28-
__version__ = "0.0.40"
28+
__version__ = "0.0.41"
2929

3030
class Box(NamedTuple):
3131
left: int

src/pywinctl/_pywinctl_win.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,18 @@ def alwaysOnTop(self, aot: bool = True):
595595
:param aot: set to ''False'' to deactivate always-on-top behavior
596596
:return: Always returns ''True''
597597
"""
598+
# TODO: investigate how to place on top of DirectDraw exclusive mode windows (hook DirectDraw APIs)
599+
# https://stackoverflow.com/questions/7009080/detecting-full-screen-mode-in-windows
600+
# https://stackoverflow.com/questions/7928308/displaying-another-application-on-top-of-a-directdraw-full-screen-application
601+
# https://www.codeproject.com/articles/730/apihijack-a-library-for-easy-dll-function-hooking?fid=1267&df=90&mpp=25&sort=Position&view=Normal&spc=Relaxed&select=116946&fr=73&prof=True
602+
# https://guidedhacking.com/threads/d3d9-hooking.8481/
603+
# https://stackoverflow.com/questions/25601362/transparent-window-on-top-of-immersive-full-screen-mode
598604
if self._t and self._t.is_alive():
599605
self._t.kill()
600606
# https://stackoverflow.com/questions/17131857/python-windows-keep-program-on-top-of-another-full-screen-application
601607
zorder = win32con.HWND_TOPMOST if aot else win32con.HWND_NOTOPMOST
602-
win32gui.SetWindowPos(self._hWnd, zorder, 0, 0, 0, 0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE)
608+
win32gui.SetWindowPos(self._hWnd, zorder, 0, 0, 0, 0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE |
609+
win32con.SWP_NOACTIVATE)
603610
return True
604611

605612
def alwaysOnBottom(self, aob: bool = True) -> bool:
@@ -647,7 +654,7 @@ def raiseWindow(self):
647654
:return: Always returns ''True''
648655
"""
649656
win32gui.SetWindowPos(self._hWnd, win32con.HWND_TOP, 0, 0, 0, 0,
650-
win32con.SWP_NOSIZE | win32con.SWP_NOMOVE | win32con.SWP_NOACTIVATE)
657+
win32con.SWP_NOSIZE | win32con.SWP_NOMOVE)
651658
return True
652659

653660
def sendBehind(self, sb: bool = True) -> bool:

0 commit comments

Comments
 (0)