Further improvements
Fix new toplevels after panel is running.
By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.
Fix new toplevels after panel is running.
soreau,
created on Wednesday, 3 September 2025, 01:16:49 (1756862209),
received on Saturday, 6 September 2025, 21:54:28 (1757195668)
Author identity: Scott Moreau <oreaus@gmail.com>
c0c2522ab1647782b3a34fabb0f096d2ac6e9857
self.size = 0
self.add_tick_callback(self.on_tick)
self.request_next_frame()
def frame_handle_buffer(self, frame, pixel_format, width, height, stride):
size = width * height * int(stride / width)
return
if name.startswith("live-preview"):
return
self.wl_surface = None
if name == self.get_root().monitor_name:
if not self.my_output and name == self.get_root().monitor_name:
self.wl_surface = None
if self.get_root().get_native().get_surface():
wl_surface_ptr = gtk.gdk_wayland_surface_get_wl_surface(
ffi.cast("void *", ctypes.pythonapi.PyCapsule_GetPointer(
# This is a hack to ensure output_enter/leave is called for toplevels
self.wl_output_ids.add(output.global_name)
if not output.name.startswith("live-preview"):
self.generate_panels()
self.generate_panels(output.name)
for panel in self.panels:
if output.name == panel.monitor_name or output.name.startswith("live-preview"):
panel.wl_output_enter(output, output.name)
panel.wl_output_enter(output, output.name)
if not output.name.startswith("live-preview"):
if self.manager:
self.manager.destroy()
self.wl_globals.remove(g)
break
def generate_panels(self):
def generate_panels(self, output_name):
print("Generating panels...", file=sys.stderr)
self.exit_all_applets()
for panel in self.panels:
panel.destroy()
for i, monitor in enumerate(self.monitors):
geometry = monitor.get_geometry()
print(f"Monitor {i}: {geometry.width}x{geometry.height} at {geometry.x},{geometry.y}")
for panel in self.panels:
if panel.monitor_name == output_name:
panel.destroy()
with open(get_config_file(), "r") as config_file:
yaml_loader = yaml.YAML(typ="rt")
yaml_file = yaml_loader.load(config_file)
for panel_data in yaml_file["panels"]:
print(f"comparing {panel_data["monitor"]} =? {output_name}")
if panel_data["monitor"] != output_name:
continue
position = PANEL_POSITIONS[panel_data["position"]]
my_monitor = None
for monitor in self.display.get_monitors():
panel.present()
panel.realize()
panel.monitor_name = my_monitor.get_connector()
def prepare(self):
self.release()