7

How can i make Popover appears outside application window like menu in gnome-shell panel? Or should i use another GTK widget?

gnome-shell panel popup menu

br.
  • 1,259
  • 1
  • 14
  • 21
  • If I recall correctly, this is a limitation of GTK+; sorry. – andlabs Nov 16 '15 at 20:25
  • @andlabs But how gnome-shell panel works? – br. Nov 16 '15 at 20:46
  • Gnome-shell isn't GTK. It renders the desktop, so it can draw outside of windows if it likes. – ptomato Nov 17 '15 at 05:24
  • @ptomato, I [dig](https://github.com/GNOME/gnome-shell/blob/edc445c0c94ece4e325c2127abffc0ea8cdafcbc/js/ui/popupMenu.js) [in](https://github.com/GNOME/gnome-shell/blob/edc445c0c94ece4e325c2127abffc0ea8cdafcbc/js/ui/boxpointer.js) [source](https://github.com/GNOME/gnome-shell/blob/edc445c0c94ece4e325c2127abffc0ea8cdafcbc/src/st/st-bin.c), and think that Gnome-shell uses Clutter as container for GTK Widget. I [made undecorated transparent window](https://i.imgur.com/6BmB4Mq.png) with [this stack](http://pastebin.com/WSDW70ux), but still not found good method for embedding gtk widget. – br. Nov 17 '15 at 14:01
  • 5
    I believe on Wayland GtkPopovers can go beyond the window though. – TingPing Nov 19 '15 at 00:06
  • Exactly, this is an X11 implementation limitation one of GTK+. There could easily be a workaround, but nobody has implemented it and all manpower now goes to wayland. – Lothar Jul 16 '18 at 02:36
  • 1
    On sway, it appears that popovers can go beyond the window, but then they do not receive any mouse events :/ – Thayne Jan 17 '20 at 17:38
  • So necro. Much post – br. Jan 17 '20 at 18:56
  • There is no "necro" when it comes to useful information. People update old content all the time - see wikipedia. You don't need to tell others about that br. - many old answers can still be partially correct but simply require more information to work. Perhaps things have changed in GTK4 now, I would not be surprised. – shevy May 26 '21 at 08:18

1 Answers1

1

This should be possible (at least on wayland). gtk_popover_set_constrain_to (GtkPopover *popover, GtkPopoverConstraint constraint); "GTK_POPOVER_CONSTRAINT_NONE"

and

gtk_popover_set_pointing_to (GtkPopover *popover, const GdkRectangle *rect);

Gtk Fan
  • 45
  • 6