Skip to content

Commit

Permalink
LINUX: Added ewmhlib as separate module. (Really) Fixed position and …
Browse files Browse the repository at this point in the history
…size for GNOME (by using GTK_EXTENTS)
  • Loading branch information
Kalmat committed Apr 17, 2024
1 parent 986db23 commit 1285dcc
Show file tree
Hide file tree
Showing 17 changed files with 118 additions and 3,333 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/type-checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
python-version: ["3.11"]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/dist/PyWinBox-0.0.5.tar.gz
/make_wheel.bat
/pip_make.bat
/pip_upload.bat
/build/
/dist/
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0.7, 2024/03/22 -- LINUX: (Really) Fixed position and size for GNOME (by using GTK_EXTENTS)
0.7, 2024/03/22 -- LINUX: Added ewmhlib as separate module. (Really) Fixed position and size for GNOME (by using GTK_EXTENTS)
0.6, 2023/10/12 -- LINUX: Improved position and size for GNOME (by using GTK_EXTENTS)
WIN32: Fixed GetAwarenessFromDpiAwarenessContext not supported on Windows Server
0.5, 2023/09/06 -- MACOS: Tested OK in multi-monitor setup
Expand Down
Binary file removed dist/PyWinBox-0.7-py3-none-any.whl
Binary file not shown.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
license='BSD 3',
packages=find_packages(where='src'),
package_dir={'': 'src'},
package_data={"pywinbox": ["py.typed"], "ewmhlib": ["py.typed"]},
package_data={"pywinbox": ["py.typed"]},
test_suite='tests',
install_requires=[
"pywin32>=302; sys_platform == 'win32'",
"python-xlib>=0.21; sys_platform == 'linux'",
"ewmhlib>=0.1; sys_platform == 'linux'",
"pyobjc>=8.1; sys_platform == 'darwin'",
"typing_extensions>=4.4.0"
],
Expand All @@ -46,7 +47,7 @@
"mypy>=0.990",
"types-pywin32>=305.0.0.3",
"types-python-xlib>=0.32",
"pywinctl>=0.1"
"pywinctl>=0.3"
]
},
keywords="left top right bottom size width height topleft bottomleft topright bottomright midtop midleft " +
Expand Down
6 changes: 3 additions & 3 deletions src/pywinbox/_pywinbox_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from Xlib.xobject.drawable import Window as XWindow

from ._main import Box
from .ewmhlib import EwmhWindow
from ewmhlib import EwmhWindow


def _getHandle(handle: Union[int, XWindow]) -> Optional[EwmhWindow]:
Expand All @@ -33,7 +33,7 @@ def _getWindowBox(handle: EwmhWindow) -> Box:
w = geom.width
h = geom.height
# Thanks to roym899 (https://github.com/roym899) for his HELP!!!!
if os.environ.get('XDG_SESSION_TYPE', "").lower() == "gnome":
if "gnome" in os.environ.get('XDG_CURRENT_DESKTOP', "").lower():
# Most apps in GNOME do not set _NET_EXTENTS, but _GTK_EXTENTS,
# which is the additional space AROUND the window.
_gtk_extents = handle._getGtkFrameExtents()
Expand All @@ -54,7 +54,7 @@ def _moveResizeWindow(handle: EwmhWindow, newBox: Box):
newTop = max(0, newBox.top)
newWidth = newBox.width
newHeight = newBox.height
if os.environ.get('XDG_SESSION_TYPE', "").lower() == "gnome":
if "gnome" in os.environ.get('XDG_CURRENT_DESKTOP', "").lower():
# Most apps in GNOME do not set _NET_EXTENTS, but _GTK_EXTENTS,
# which is the additional space AROUND the window.
_gtk_extents = handle._getGtkFrameExtents()
Expand Down
1 change: 0 additions & 1 deletion src/pywinbox/_pywinbox_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def _unflipTop(window: AppKit.NSWindow, box: Box) -> int:


def _NSgetWindowBox(window: AppKit.NSWindow, flipValues: bool = False) -> Box:
# frame = window.frame()
frame = window.frame()
x = int(frame.origin.x)
y = int(frame.origin.y)
Expand Down
5 changes: 0 additions & 5 deletions src/pywinbox/ewmhlib/Props/__init__.py

This file was deleted.

141 changes: 0 additions & 141 deletions src/pywinbox/ewmhlib/Props/_props.py

This file was deleted.

4 changes: 0 additions & 4 deletions src/pywinbox/ewmhlib/Structs/__init__.py

This file was deleted.

123 changes: 0 additions & 123 deletions src/pywinbox/ewmhlib/Structs/_structs.py

This file was deleted.

30 changes: 0 additions & 30 deletions src/pywinbox/ewmhlib/__init__.py

This file was deleted.

Loading

0 comments on commit 1285dcc

Please sign in to comment.