roundabout,
created on Monday, 1 September 2025, 16:06:09 (1756742769),
received on Monday, 1 September 2025, 16:06:16 (1756742776)
Author identity: Vlad <vlad.muntoiu@gmail.com>
9fa4923ac9b69f825686e50b248adc78aa97bb8b
main.py
@@ -31,7 +31,6 @@ from itertools import accumulate, chain
from pathlib import Path import ruamel.yaml as yaml from pywayland.client import Display, EventQueue from pywayland.protocol.wayland import WlRegistry, WlSeat, WlSurface, WlCompositor, WlOutputfaulthandler.enable()
@@ -65,6 +64,7 @@ locale.setlocale(locale.LC_ALL)
_ = locale.gettext import panorama_panel import wl4pgiimport asyncio asyncio.set_event_loop_policy(GLibEventLoopPolicy())
@@ -595,6 +595,7 @@ class PanoramaPanel(Gtk.Application):
application_id="com.roundabout_host.roundabout.PanoramaPanel", flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE ) self.registry = Noneself.display = Gdk.Display.get_default() self.monitors = self.display.get_monitors() for monitor in self.monitors:
@@ -616,19 +617,19 @@ class PanoramaPanel(Gtk.Application):
_("NAME") ) def receive_output_name(self, output: WlOutput, name: str):def receive_output_name(self, output, name: str):output.name = name def on_global(self, registry, name, interface, version): if interface == "wl_output": output = registry.bind(name, WlOutput, version)output = registry.bind(name, wl4pgi.wayland.WlOutput.interface_type, version)print(f"global {name} {interface} {version}") output.global_name = name output.dispatcher["name"] = self.receive_output_nameoutput.connect("name", self.receive_output_name)output.name = None while not output.name: self.wl_display.dispatch(block=True) print(output.name)if not output.name.startswith("live-preview"): self.wl_output_ids.add(output.global_name) self.generate_panels()
@@ -643,6 +644,11 @@ class PanoramaPanel(Gtk.Application):
self.wl_output_ids.discard(name) def generate_panels(self): self.display = Gdk.Display.get_default() self.monitors = self.display.get_monitors() for monitor in self.monitors: monitor.output_proxy = Noneprint("Generating panels...", file=sys.stderr) self.exit_all_applets() for panel in self.panels:
@@ -686,8 +692,8 @@ class PanoramaPanel(Gtk.Application):
area.append(applet_widget) panel.present()panel.realize() panel.present()def prepare(self): self.release()
@@ -711,16 +717,15 @@ class PanoramaPanel(Gtk.Application):
self.applets_by_name[subclass.__name__] = subclass self.wl_display = Display() wl_display_ptr = gtk.gdk_wayland_display_get_wl_display(self.wl_display._ptr = gtk.gdk_wayland_display_get_wl_display(ffi.cast("void *", ctypes.pythonapi.PyCapsule_GetPointer(self.display.__gpointer__, None))) self.wl_display._ptr = wl_display_ptr# Intentionally commented: the display is already connected by GTK # self.display.connect() self.registry = self.wl_display.get_registry()self.registry.dispatcher["global"] = self.on_globalself.registry.dispatcher["global_remove"] = self.on_global_removeself.registry = wl4pgi.wayland.WlRegistry(self.wl_display.get_registry()) self.registry.connect("global", self.on_global) self.registry.connect("global_remove", self.on_global_remove)self.hold()