[gimp/wip/nielsdg/gimptagpopup-transient-for] app: tagpopup: Try to set transient-for property
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/nielsdg/gimptagpopup-transient-for] app: tagpopup: Try to set transient-for property
- Date: Tue, 29 Dec 2020 22:50:34 +0000 (UTC)
commit c023994ebbc376548f8dc79221df9ff606770676
Author: Niels De Graef <nielsdegraef gmail com>
Date: Tue Dec 29 23:40:16 2020 +0100
app: tagpopup: Try to set transient-for property
Setting the `"transient-for`" property for popups is important to
certain window managers (such as Wayland), so that they know what the
parent surface is and can position the popup accordingly.
This fixes the `GimpTagPopup` in wayland giving a critical message, and
getting a random position somewhere on the screen.
app/widgets/gimptagpopup.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/app/widgets/gimptagpopup.c b/app/widgets/gimptagpopup.c
index c2d9b457d9..9609ac74b9 100644
--- a/app/widgets/gimptagpopup.c
+++ b/app/widgets/gimptagpopup.c
@@ -456,8 +456,20 @@ gimp_tag_popup_get_property (GObject *object,
GtkWidget *
gimp_tag_popup_new (GimpComboTagEntry *combo_entry)
{
+ GtkWidget *toplevel;
+
g_return_val_if_fail (GIMP_IS_COMBO_TAG_ENTRY (combo_entry), NULL);
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (combo_entry));
+ if (GTK_IS_WINDOW (toplevel))
+ {
+ return g_object_new (GIMP_TYPE_TAG_POPUP,
+ "type", GTK_WINDOW_POPUP,
+ "owner", combo_entry,
+ "transient-for", toplevel,
+ NULL);
+ }
+
return g_object_new (GIMP_TYPE_TAG_POPUP,
"type", GTK_WINDOW_POPUP,
"owner", combo_entry,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]