-
-
Notifications
You must be signed in to change notification settings - Fork 779
New Backend - Qt #3769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
New Backend - Qt #3769
Changes from all commits
1ff717e
4d440ca
2b96810
b7504bc
49312d0
5f64d70
86e5731
69a660d
3028865
39349ec
d2d0886
9236d50
9255280
d712512
7bbecbf
027b404
4a0695b
f709818
03a21f7
e8f15a3
81a964e
bece50b
5760f1f
7b11df2
f1cf4b3
5ee1ce6
12a9859
220a786
84eb389
8387ade
f274bce
c906be6
7e8ff2e
a693640
9d12cd3
535375c
9606935
389728a
f5bf414
49061fc
2a09c54
451f0d3
343e19b
e3a90a7
5212a2f
943680e
ffa53af
4c70a66
2efb453
942a5fe
1bb3a13
0066ac5
806dcf0
324a3d1
bae3759
c7e2f4c
d50a967
72f52fa
c8b5146
3aaec9e
09e6988
290c3d9
a38a906
74e3c64
5a0b9af
453078d
d6615cf
ade178d
e9c0552
846b35a
c027942
05bd2d6
716494b
88ff0fe
5f4177d
224d19a
439eab4
38fa38a
8040b28
33c66c8
9dcbdcb
1579d90
ab4ca2f
3cf608a
5f889fb
3bd9645
3e6a461
3bb4f0d
a37ef32
49b6598
573ef5e
429d818
0de1bc1
0712512
e59530e
b7d5ccb
f5df707
6da8ca1
81c793e
8b5d470
06be9dd
cb46709
dcf4f9f
f8b19ff
1b9c100
58e7284
4d7300e
f9224f5
0aac40a
83f08b3
2e2b7ea
b40b174
a894e27
389852e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ jobs: | |
- "demo" | ||
- "dummy" | ||
- "gtk" | ||
- "qt" | ||
- "iOS" | ||
- "toga" | ||
- "positron" | ||
|
@@ -208,7 +209,7 @@ jobs: | |
tox -e trav-compat | ||
|
||
testbed: | ||
name: Testbed | ||
name: Testbed (${{ matrix.backend }}) | ||
needs: [ package, core-and-travertino ] | ||
runs-on: ${{ matrix.runs-on }} | ||
strategy: | ||
|
@@ -231,6 +232,7 @@ jobs: | |
briefcase-run-prefix: "" | ||
briefcase-run-args: "" | ||
setup-python: true | ||
testbed-app: "testbed" | ||
|
||
- backend: "macOS-x86_64" | ||
platform: "macOS" | ||
|
@@ -277,7 +279,7 @@ jobs: | |
- backend: "linux-wayland-gtk3" | ||
platform: "linux" | ||
runs-on: "ubuntu-24.04" | ||
# The package list should be the same as in unix-prerequisites.rst, and the BeeWare | ||
# The package list should be the same as in unix-prerequisites.md, and the BeeWare | ||
# tutorial, plus mutter to provide a window manager. | ||
pre-command: | | ||
sudo apt update -y | ||
|
@@ -306,7 +308,7 @@ jobs: | |
runs-on: "ubuntu-24.04" | ||
env: | ||
XDG_RUNTIME_DIR: "/tmp" | ||
# The package list should be build on the same base as unix-prerequisites.rst, | ||
# The package list should be build on the same base as unix-prerequisites.md, | ||
# and the BeeWare tutorial. Additional packages will be added for window | ||
# management, and features such as web views and geolocation that aren't part | ||
# of the default/tutorial environment. | ||
|
@@ -333,6 +335,87 @@ jobs: | |
setup-python: false # Use the system Python packages | ||
app-user-data-path: "$HOME/.local/share/testbed" | ||
|
||
- backend: "linux-x11-qt" | ||
freakboy3742 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
platform: "linux" | ||
runs-on: "ubuntu-24.04" | ||
testbed-app: "testbed-qt" | ||
# The package list should be dependencies listed in unix-prerequsites.md, plus we need a window | ||
# manager that is reasonably lightweight, honors full screen mode, and | ||
# treats the window position as the top-left corner of the *window*, not the | ||
# top-left corner of the window *content*. The default GNOME window managers of | ||
# most distros meet these requirements, but they're heavyweight; flwm doesn't | ||
# work either. Blackbox is the lightest WM we've found that works. | ||
# PySide6 must be installed in VM to test that system-pyside6 works properly. | ||
pre-command: | | ||
sudo apt update -y | ||
sudo apt install -y --no-install-recommends \ | ||
blackbox python3-dev xvfb \ | ||
gnome-session-canberra build-essential \ | ||
libfontconfig1-dev libfreetype-dev libgtk-3-dev \ | ||
libx11-dev libx11-xcb-dev libxext-dev \ | ||
libxfixes-dev libxi-dev libxkbcommon-dev \ | ||
libxkbcommon-x11-dev libxrender-dev 'libxcb*-dev' \ | ||
libwayland-dev libwayland-egl1-mesa libwayland-server0 \ | ||
libgles2-mesa-dev libxkbcommon-dev | ||
Comment on lines
+351
to
+359
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm surprised so many GTK/Gnome libraries are required here. Are you sure this is a minimal set? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See https://doc.qt.io/qt-6/linux-requirements.html -- this is the list.
EDIT -- would it perhaps be more preferrable to use something like https://pypi.org/project/py-canberra/ for sounding the bell rather than calling it through the command line? Wonder why it's called Canberra though... sounds weirdly nice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the App.beep thing, the problem seems to be that QApplication.beep isn't implemented at all on Wayland... also KNotifications upon further research seems to be that each app can declare notification types and in System Settings you can tweak what sort of action you want these notifications to make... that leaves libcanberra being the only way we could possibly play a bell sound. Integrating libcanberra from the python side is nontrivial... the way to play a sound from the correct theme seems to be using its gtk integration, which requires a gtk event loop, but we already run a Qt event loop in our applications. Else we can hardcode a sound theme, but I think the goal of Toga is to be native as much as possible, and users might customize sound themes... so that's why despite discouragement from doing so, I'm using canberra-gtk-play in a subprocess.Popen for playing App.beep. Sorry for commenting on unrelated thread. EDIT -- clarification: it's using some asyncio internal utils, not subprocess.Popen for ResourceWarning to not happen. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ok - I can't argue with the documentation... but the fact that GTK is a dependency of Qt is odd, to say the least.
A command line invocation definitely isn't the right way to do it. The fact that py-canberra has a version number of 0.0.4, and hasn't had an update since 2020, would seem to exclude it as a viable option. As I've indicated previously - we can only cook with the ingredients we're given. If QApplication::beep() doesn't work, then that's a bug with Qt. If the KDE alternative doesn't work without a specific application configuration, then it won't ever be viable for a standalone So - if gnome-session-canberra is literally the only way to make this work, then I guess it's acceptable. However, I'd also be wary of trying to solve all Qt problems in one PR. Beep() isn't critical functionality. We can land a Qt backend that doesn't support beep at all, and fix that in a later PR when we're not also trying to get the basics of a stable Qt test setup nailed down. To that end - it would be desirable if you stopped adding new features to this PR right now. Asking for a review means "This is done, and I'd like you to review it". I will, almost inevitably, find problems; you resolve those problems, and we converge on a PR that can be merged. Every time you add a new feature to a "review in progress" PR, that means another round of new problems that are going to be found. The goal of every PR should be to as small as possible. A small PR is an easy to review PR. A sprawling PR that never stops getting bigger won't ever land. Right now, I'd like to focus on getting the specific feature set in this PR resolved so that we can land it, and then deal with improvements incrementally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @freakboy3742 Noted. I will stop adding new features. Pragmatically, should I revert this to QApplication.beep? Or since you said "I guess it's acceptable", should I keep it this way? But anyways: py-canberra needed some patches for me to even run. Agreed on that part. Searched up canberra by accident, found it was the capital of Australia... now I'm embarrased for asking an Australian what it's named after. |
||
|
||
|
||
# Ubuntu 24.04 does not provide PySide6 | ||
# so we fake it like this to test system-pyside6. | ||
# This bundles its own Qt. | ||
sudo pip install --break-system-packages PySide6 | ||
|
||
# Start Virtual X Server | ||
echo "Start X server..." | ||
Xvfb :99 -screen 0 2048x1536x24 & | ||
sleep 1 | ||
|
||
# Start Window Mmanager | ||
echo "Start window manager..." | ||
DISPLAY=:99 blackbox & | ||
sleep 1 | ||
briefcase-run-prefix: 'DISPLAY=:99' | ||
setup-python: false # Use the system Python packages | ||
app-user-data-path: "$HOME/.local/share/testbed" | ||
|
||
- backend: "linux-wayland-qt" | ||
platform: "linux" | ||
runs-on: "ubuntu-24.04" | ||
testbed-app: "testbed-qt" | ||
# The package list should be unix-prerequisites.md, plus mutter to provide a window | ||
# manager. | ||
pre-command: | | ||
sudo apt update -y | ||
sudo apt install -y --no-install-recommends \ | ||
mutter python3-dev xvfb \ | ||
gnome-session-canberra \ | ||
libfontconfig1-dev libfreetype-dev libgtk-3-dev \ | ||
libx11-dev libx11-xcb-dev libxext-dev \ | ||
libxfixes-dev libxi-dev libxkbcommon-dev \ | ||
libxkbcommon-x11-dev libxrender-dev 'libxcb*-dev' \ | ||
libwayland-dev libwayland-egl1-mesa libwayland-server0 \ | ||
libgles2-mesa-dev libxkbcommon-dev | ||
|
||
# Ubuntu 24.04 does not provide PySide6 | ||
# so we fake it like this to test system-pyside6. | ||
# This bundles its own Qt. | ||
sudo pip install --break-system-packages PySide6 | ||
|
||
# Start Virtual X Server | ||
echo "Start X server..." | ||
Xvfb :99 -screen 0 2048x1536x24 & | ||
sleep 1 | ||
|
||
# Start Window Manager | ||
echo "Start window manager..." | ||
# mutter is being run inside a virtual X server because mutter's headless | ||
# mode does not provide a Gdk.Display | ||
DISPLAY=:99 MUTTER_DEBUG_DUMMY_MODE_SPECS=2048x1536 \ | ||
mutter --nested --wayland --no-x11 --wayland-display toga & | ||
sleep 1 | ||
briefcase-run-prefix: "WAYLAND_DISPLAY=toga" | ||
setup-python: false # Use the system Python packages | ||
app-user-data-path: "$HOME/.local/share/testbed" | ||
|
||
- backend: "textual-linux" | ||
platform: "linux" | ||
runs-on: "ubuntu-latest" | ||
|
@@ -428,7 +511,8 @@ jobs: | |
timeout-minutes: 15 | ||
run: | | ||
${{ matrix.briefcase-run-prefix }} \ | ||
briefcase run ${{ matrix.platform }} --log --test ${{ matrix.briefcase-run-args }} -- --ci | ||
briefcase run ${{ matrix.platform }} --log --test \ | ||
${{ matrix.briefcase-run-args }} --app ${{ matrix.testbed-app }} -- --ci | ||
|
||
- name: Upload Logs | ||
uses: actions/[email protected] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Toga now provides a Qt backend for KDE-based desktops. |
Uh oh!
There was an error while loading. Please reload this page.