Skip to content

Commit ad96da7

Browse files
committed
Merge branch 'master' of https://github.com/Kalmat/PyWinBox into Manual-ruff-fixes
2 parents d7b391c + d14e659 commit ad96da7

10 files changed

Lines changed: 1974 additions & 1464 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,26 @@ jobs:
6565
fail-fast: false
6666
steps:
6767
- uses: actions/checkout@v6
68-
# - name: Install Linux Packages
69-
# if: ${{ startsWith(matrix.os, 'ubuntu') }}
70-
# run: |
71-
# sudo apt update
72-
# sudo apt install gedit xvfb x11-xserver-utils openbox dbus-x11
68+
- name: Install Linux Packages
69+
if: ${{ startsWith(matrix.os, 'ubuntu') }}
70+
run: |
71+
sudo apt update
72+
# xvfb+openbox: headless X server and WM
73+
# gedit: the test window (not preinstalled on GitHub runners)
74+
# x11-xserver-utils (xrandr/xset): required by tests for window geometry
75+
# dbus-x11: dbus-launch, so the GTK app (gedit) gets a session bus
76+
sudo apt install -y xvfb openbox gedit x11-xserver-utils dbus-x11
7377
- uses: astral-sh/setup-uv@v8.2.0
7478
with:
7579
python-version: ${{ matrix.python-version }}
7680
activate-environment: true
7781
- run: uv sync --locked
78-
# - name: Run tests (Linux)
79-
# if: ${{ startsWith(matrix.os, 'ubuntu') }}
80-
# working-directory: tests
81-
# run: xvfb-run --server-args="-screen 0 1280x1024x24" bash -c "openbox & sleep 1 && dbus-launch --exit-with-session python test_pywinbox.py"
82-
- name: Run tests # (Windows & macOS)
83-
# if: ${{ !startsWith(matrix.os, 'ubuntu') }}
82+
- name: Run tests (Linux)
83+
if: ${{ startsWith(matrix.os, 'ubuntu') }}
84+
working-directory: tests
85+
run: xvfb-run --server-args="-screen 0 1280x1024x24" bash -c "openbox & sleep 1 && dbus-launch --exit-with-session python test_pywinbox.py"
86+
- name: Run tests (Windows & macOS)
87+
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
8488
working-directory: tests
8589
run: python test_pywinbox.py
8690
- name: Run tests (MacNSBox)

CHANGES.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
0.8, 2026/XX/XX -- ALL: Removed unused dependency on `typing_extensions`
2-
WIN32: Replaced bare `except:` clauses with `except Exception:`, preventing accidental suppression of system-exit signals (KeyboardInterrupt, SystemExit) during error handling.
1+
0.8, 2026/XX/XX -- WIN32: Replaced bare `except (thanks to Avasam):` clauses with `except Exception:`, preventing accidental suppression of system-exit signals (KeyboardInterrupt, SystemExit) during error handling.
2+
ALL: Removed unused dependency on `typing_extensions` (thanks to Avasam - https://github.com/Avasam)
3+
ALL: Deprecated PyWinBox class in favor of WindowBox (window areas) and ScreenBox (screen areas)
4+
ALL: Added general functions: collidepoint, collidebox, contains, clip, union
5+
ALL: Added class methods: collidepoint, collidebox, contains, clip, union, move, inflate, clamp, isclamped, unclamp, fit
36
0.7, 2024/03/22 -- LINUX: Added ewmhlib as separate module. (Really) Fixed position and size for GNOME (by using GTK_EXTENTS)
47
0.6, 2023/10/12 -- LINUX: Improved position and size for GNOME (by using GTK_EXTENTS)
5-
WIN32: Fixed GetAwarenessFromDpiAwarenessContext not supported on Windows Server
8+
WIN32: Fixed GetAwarenessFromDpiAwarenessContext not supported on Windows Server (thanks to popoiPIO - https://github.com/poipoiPIO)
69
0.5, 2023/09/06 -- MACOS: Tested OK in multi-monitor setup
710
0.4, 2023/08/25 -- Reorganized to avoid IDEs showing external and / or private elements
811
0.3, 2023/08/21 -- Linux: Improved window geometry (thanks to elraymond - https://github.com/elraymond)

README.md

Lines changed: 210 additions & 75 deletions
Large diffs are not rendered by default.

TODO.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Handle multi-monitor box

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Documentation = "https://pywinbox.readthedocs.io/"
1111

1212
[project]
1313
name = "PyWinBox"
14-
version = "0.7"
15-
description = "Cross-Platform and multi-monitor toolkit to handle rectangular areas and windows box"
14+
version = "0.8"
15+
description = "Cross-platform Python module to manage window and rectangular screen areas — with full property access, live callbacks, and multi-monitor support."
1616
authors = [{ name = "Kalmat", email = "palookjones@gmail.com" }]
1717
readme = "README.md"
1818
license = "BSD-3-Clause"

src/pywinbox/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/python
22
from importlib.metadata import version as _importlib_version
33

4-
from ._main import Box, Rect, Point, Size, pointInBox, PyWinBox
4+
from ._main import (Box, Rect, Point, Size,
5+
PyWinBox, WindowBox, ScreenBox,
6+
pointInBox, collidepoint, collidebox, contains, clip, union)
57

68
__all__ = [
7-
"version", "PyWinBox", "Box", "Rect", "Point", "Size", "pointInBox"
9+
"version",
10+
"Box", "Rect", "Point", "Size",
11+
"PyWinBox", "WindowBox", "ScreenBox",
12+
"pointInBox", "collidepoint", "collidebox", "contains", "clip", "union"
813
]
914

1015
__version__ = _importlib_version("pywinctl")

0 commit comments

Comments
 (0)