Skip to content

Commit 1285dcc

Browse files
committed
LINUX: Added ewmhlib as separate module. (Really) Fixed position and size for GNOME (by using GTK_EXTENTS)
1 parent 986db23 commit 1285dcc

17 files changed

+118
-3333
lines changed

.github/workflows/type-checking.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
python-version: ["3.11"]
2020
fail-fast: false
2121
steps:
22-
- uses: actions/checkout@v3
23-
- uses: actions/setup-python@v4
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-python@v5
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
cache: "pip"

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/dist/PyWinBox-0.0.5.tar.gz
21
/make_wheel.bat
32
/pip_make.bat
43
/pip_upload.bat
54
/build/
5+
/dist/

CHANGES.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
0.7, 2024/03/22 -- LINUX: (Really) Fixed position and size for GNOME (by using GTK_EXTENTS)
1+
0.7, 2024/03/22 -- LINUX: Added ewmhlib as separate module. (Really) Fixed position and size for GNOME (by using GTK_EXTENTS)
22
0.6, 2023/10/12 -- LINUX: Improved position and size for GNOME (by using GTK_EXTENTS)
33
WIN32: Fixed GetAwarenessFromDpiAwarenessContext not supported on Windows Server
44
0.5, 2023/09/06 -- MACOS: Tested OK in multi-monitor setup

dist/PyWinBox-0.7-py3-none-any.whl

-51.5 KB
Binary file not shown.

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
license='BSD 3',
3333
packages=find_packages(where='src'),
3434
package_dir={'': 'src'},
35-
package_data={"pywinbox": ["py.typed"], "ewmhlib": ["py.typed"]},
35+
package_data={"pywinbox": ["py.typed"]},
3636
test_suite='tests',
3737
install_requires=[
3838
"pywin32>=302; sys_platform == 'win32'",
3939
"python-xlib>=0.21; sys_platform == 'linux'",
40+
"ewmhlib>=0.1; sys_platform == 'linux'",
4041
"pyobjc>=8.1; sys_platform == 'darwin'",
4142
"typing_extensions>=4.4.0"
4243
],
@@ -46,7 +47,7 @@
4647
"mypy>=0.990",
4748
"types-pywin32>=305.0.0.3",
4849
"types-python-xlib>=0.32",
49-
"pywinctl>=0.1"
50+
"pywinctl>=0.3"
5051
]
5152
},
5253
keywords="left top right bottom size width height topleft bottomleft topright bottomright midtop midleft " +

src/pywinbox/_pywinbox_linux.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from Xlib.xobject.drawable import Window as XWindow
1212

1313
from ._main import Box
14-
from .ewmhlib import EwmhWindow
14+
from ewmhlib import EwmhWindow
1515

1616

1717
def _getHandle(handle: Union[int, XWindow]) -> Optional[EwmhWindow]:
@@ -33,7 +33,7 @@ def _getWindowBox(handle: EwmhWindow) -> Box:
3333
w = geom.width
3434
h = geom.height
3535
# Thanks to roym899 (https://github.com/roym899) for his HELP!!!!
36-
if os.environ.get('XDG_SESSION_TYPE', "").lower() == "gnome":
36+
if "gnome" in os.environ.get('XDG_CURRENT_DESKTOP', "").lower():
3737
# Most apps in GNOME do not set _NET_EXTENTS, but _GTK_EXTENTS,
3838
# which is the additional space AROUND the window.
3939
_gtk_extents = handle._getGtkFrameExtents()
@@ -54,7 +54,7 @@ def _moveResizeWindow(handle: EwmhWindow, newBox: Box):
5454
newTop = max(0, newBox.top)
5555
newWidth = newBox.width
5656
newHeight = newBox.height
57-
if os.environ.get('XDG_SESSION_TYPE', "").lower() == "gnome":
57+
if "gnome" in os.environ.get('XDG_CURRENT_DESKTOP', "").lower():
5858
# Most apps in GNOME do not set _NET_EXTENTS, but _GTK_EXTENTS,
5959
# which is the additional space AROUND the window.
6060
_gtk_extents = handle._getGtkFrameExtents()

src/pywinbox/_pywinbox_macos.py

-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ def _unflipTop(window: AppKit.NSWindow, box: Box) -> int:
153153

154154

155155
def _NSgetWindowBox(window: AppKit.NSWindow, flipValues: bool = False) -> Box:
156-
# frame = window.frame()
157156
frame = window.frame()
158157
x = int(frame.origin.x)
159158
y = int(frame.origin.y)

src/pywinbox/ewmhlib/Props/__init__.py

-5
This file was deleted.

src/pywinbox/ewmhlib/Props/_props.py

-141
This file was deleted.

src/pywinbox/ewmhlib/Structs/__init__.py

-4
This file was deleted.

src/pywinbox/ewmhlib/Structs/_structs.py

-123
This file was deleted.

src/pywinbox/ewmhlib/__init__.py

-30
This file was deleted.

0 commit comments

Comments
 (0)