Create popover that can overpass window area

爱⌒轻易说出口 提交于 2021-02-08 11:00:28

问题


There is a small window application (50x50px) with only one image inside of it. When you click the image, a popover(GtkPopover) appears, but it cannot overpass the window borders and only part of it is shown.

How could I solve this issue without resizing the window?


回答1:


Popovers in GTK under X11 cannot extend outside of the top-level window they belong to, because they do not use a separate windowing system surface; if they did, like menus, they would not be able to remain open even when clicking outside of them.

This cannot be fixed in GTK3, see:

  • https://bugzilla.gnome.org/show_bug.cgi?id=747509
  • https://gitlab.gnome.org/GNOME/gtk/issues/543

You must use Wayland, or you must ensure that your window is big enough to display your popover.

You also probably want to use gtk_popover_set_position(), gtk_popover_set_pointing_to(), or gtk_popover_set_constrain_to() to ensure that your popover always opens within the window surface, instead of outside.



来源:https://stackoverflow.com/questions/61612589/create-popover-that-can-overpass-window-area

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!