From 1c74b5945928cacb70aff22923bb7195f40dbf80 Mon Sep 17 00:00:00 2001 From: nocode Date: Sat, 4 Jul 2026 13:42:24 +0200 Subject: [PATCH] fix(fws-hello): set window type hint to dialog and prevent resizing Import Gdk and GLib modules to properly configure window behavior. Set deterministic WM_CLASS using GLib.set_prgname() so that i3/Hyprland window rules targeting "fws-hello" floating window behavior work correctly. Set window type hint to DIALOG and disable resizing to ensure the window remains floating with its natural size instead of being stretched across the entire workspace, which would result in unreadable layout. --- configs/releng/airootfs/usr/local/bin/fws-hello | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configs/releng/airootfs/usr/local/bin/fws-hello b/configs/releng/airootfs/usr/local/bin/fws-hello index c286925..0891730 100755 --- a/configs/releng/airootfs/usr/local/bin/fws-hello +++ b/configs/releng/airootfs/usr/local/bin/fws-hello @@ -16,7 +16,12 @@ import sys import gi gi.require_version("Gtk", "3.0") -from gi.repository import Gtk # noqa: E402 +gi.require_version("Gdk", "3.0") # sinon gi charge Gdk 4.0 (conflit avec Gtk3) +from gi.repository import Gdk, GLib, Gtk # noqa: E402 + +# WM_CLASS déterministe : les règles i3/Hyprland « fenêtre flottante » +# ciblent cette classe. +GLib.set_prgname("fws-hello") _FLAG = os.path.expanduser("~/.config/fws/hello-done") @@ -69,6 +74,11 @@ class HelloWindow(Gtk.Window): self.set_default_size(460, -1) self.set_position(Gtk.WindowPosition.CENTER) self.set_border_width(18) + # DIALOGUE : les tuileurs (i3/Hyprland) laissent les dialogues en + # flottant → la fenêtre garde sa taille naturelle au lieu d'être + # étirée sur tout l'espace de travail (layout illisible sinon). + self.set_type_hint(Gdk.WindowTypeHint.DIALOG) + self.set_resizable(False) box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12) self.add(box)