diff --git a/src/fenigma/app.py b/src/fenigma/app.py index 821160e..48fdb76 100644 --- a/src/fenigma/app.py +++ b/src/fenigma/app.py @@ -1044,7 +1044,15 @@ class MainWindow(Adw.ApplicationWindow): you're pointing and don't need to type coordinates.""" popover = Gtk.Popover() popover.set_parent(self.canvas) - popover.set_pointing_to(Gdk.Rectangle(x=int(x), y=int(y), width=1, height=1)) + # NOT Gdk.Rectangle(x=..., y=..., ...): verified directly that this + # PyGObject version silently ignores every constructor keyword arg on + # boxed types like GdkRectangle (a real bug, not a style preference, + # it built a zeroed rect every time), which is exactly why this popover + # always opened pinned to the canvas's top-left corner instead of the + # actual click position. Assigning the fields after construction works. + rect = Gdk.Rectangle() + rect.x, rect.y, rect.width, rect.height = int(x), int(y), 1, 1 + popover.set_pointing_to(rect) popover.connect("closed", lambda _p: popover.unparent()) box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=2,