Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Build-Depends:
debhelper (>= 9),
dh-python,
python3-all,
python3-gbulb,
python3-gi (>= 3.50.0) | python3-gbulb,
python3-setuptools,
python3-systemd,
python3-qubesadmin,
Expand Down
20 changes: 13 additions & 7 deletions qubes_menu/appmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@
gi.require_version('GtkLayerShell', '0.1')
from gi.repository import Gtk, Gdk, GLib, Gio, GtkLayerShell

import gbulb
gbulb.install()
try:
from gi.events import GLibEventLoopPolicy
asyncio.set_event_loop_policy(GLibEventLoopPolicy())
HAS_GBULB = False
except ImportError:
import gbulb
gbulb.install()
HAS_GBULB = True

PAGE_LIST = [
"search_page", "app_page", "favorites_page", "settings_page"
Expand Down Expand Up @@ -303,13 +309,9 @@ def do_activate(self, *args, **kwargs):
# navigation works
self.handlers[self.initial_page].page_widget.grab_focus()

loop = asyncio.get_event_loop()
self.tasks = [
asyncio.ensure_future(self.dispatcher.listen_for_events()),
]

loop.run_until_complete(asyncio.wait(
self.tasks, return_when=asyncio.FIRST_EXCEPTION))
else:
if self.main_notebook:
self.main_notebook.set_current_page(
Expand Down Expand Up @@ -548,7 +550,11 @@ def main():
qapp = qubesadmin.Qubes()
dispatcher = qubesadmin.events.EventsDispatcher(qapp)
app = AppMenu(qapp, dispatcher)
app.run(sys.argv)
if HAS_GBULB:
loop: gbulb.GLibEventLoop = asyncio.get_event_loop()
loop.run_forever(application=app, argv=sys.argv)
else:
app.run(sys.argv)


if __name__ == '__main__':
Expand Down
4 changes: 4 additions & 0 deletions rpm_spec/qubes-desktop-linux-menu.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: gettext

Requires: python%{python3_pkgversion}-setuptools
%if 0%{?fedora} < 42
Requires: python%{python3_pkgversion}-gbulb
%else
Requires: python%{python3_pkgversion}-gobject >= 3.50.0
%endif
Requires: gtk3
Requires: gtk-layer-shell
Requires: python%{python3_pkgversion}-qubesadmin >= 4.1.8
Expand Down