-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
widgets: fall back to Xwayland #234
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #234 +/- ##
==========================================
+ Coverage 93.23% 93.42% +0.19%
==========================================
Files 57 57
Lines 10584 10997 +413
==========================================
+ Hits 9868 10274 +406
- Misses 716 723 +7 ☔ View full report in Codecov by Sentry. |
This doesn't seem to work. For some reason it still connects to Wayland anyway. It does it when I set |
Defaulting to |
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024112600-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024111705-4.3&flavor=update
Failed tests13 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/119126#dependencies 2 fixed
Unstable tests
|
Is it necessary for clicking outside the menu to close the menu, or is it good enough to require clicking again on the widget? The latter might be fixable in the menu itself, by closing the menu when the widget is clicked. |
The widgets do not work under Wayland, so just use Xwayland for now. If GTK somehow still connects to Wayland despite WAYLAND_DISPLAY being unset I will not be happy.
9dee5a2
to
18901a0
Compare
It is necessary, it is a dom0 widget, it should not have the bad behavior of the vm widgets (which also should work better wrt to closing, but that's out of scope here). |
This will hopefully allow it to be dismissed by clicking elsewhere.
Can you try my most recent commit? That dismisses the menu when it loses focus. |
I don't think this addresses the root cause, which is some wayland failure - this works correctly under X and so, from what you said previously, should work correctly under XWayland. I don't think we want to patch the whole world, if it requires additional workarounds like this (which BTW duplicate what the menu generally does on its own) I don't think this is a good solution. |
@@ -537,6 +541,7 @@ def __init__(self, app_name, qapp, dispatcher, stats_dispatcher): | |||
_('<b>Qubes Domains</b>\nView and manage running domains.')) | |||
|
|||
self.tray_menu = Gtk.Menu() | |||
self.widget_icon.connect('focus-out-event', self.hide_menu) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nov 25 20:30:55.566508 dom0 widget-wrapper[3696]: Traceback (most recent call last):
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: File "/usr/bin/qui-domains", line 33, in <module>
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: sys.exit(load_entry_point('qui==0.1', 'gui_scripts', 'qui-domains')())
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: File "/usr/lib/python3.13/site-packages/qui/tray/domains.py", line 927, in main
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: app = DomainTray(
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: 'org.qubes.qui.tray.Domains', qapp, dispatcher, stats_dispatcher)
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: File "/usr/lib/python3.13/site-packages/qui/tray/domains.py", line 544, in __init__
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: self.widget_icon.connect('focus-out-event', self.hide_menu)
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 25 20:30:55.567032 dom0 widget-wrapper[3696]: TypeError: <Gtk.StatusIcon object at 0x722941d2e000 (GtkStatusIcon at 0x5e0a8c5d4f30)>: unknown signal name: focus-out-event
Nov 25 20:30:55.597149 dom0 widget-wrapper[3695]: exiting with 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work if you connect it to the self.tray_menu, but I only tested it on X, not on Wayland.
@@ -537,6 +541,7 @@ def __init__(self, app_name, qapp, dispatcher, stats_dispatcher): | |||
_('<b>Qubes Domains</b>\nView and manage running domains.')) | |||
|
|||
self.tray_menu = Gtk.Menu() | |||
self.widget_icon.connect('focus-out-event', self.hide_menu) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.widget_icon.connect('focus-out-event', self.hide_menu) | |
self.tray_menu.connect('focus-out-event', self.hide_menu) |
this change to be exact, looks like it does not break anything on X at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this would still require some sort of hacky "hide if visible" modification to the show_menu function, otherwise I can get it funnily stuck on X
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On our first test it does not work correctly at all in Wayland (the menu does not hide). Probably some other event? Or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this is a direction to go to? https://stackoverflow.com/a/3687273
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, looks like another thing that is broken under Wayland
The widgets do not work under Wayland, so just use Xwayland for now.
If GTK somehow still connects to Wayland despite WAYLAND_DISPLAY being unset I will not be happy.
This is broken under KDE because of a bug in KDE (https://bugs.kde.org/show_bug.cgi?id=468085), but that can be fixed.