[evolution] [ECellCombo] Misplaced combo popup under Wayland



commit 8aebb720a028e6c2f4dcc1d75bbe886536c84f0e
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 26 09:04:46 2017 +0200

    [ECellCombo] Misplaced combo popup under Wayland

 src/e-util/e-cell-combo.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/e-util/e-cell-combo.c b/src/e-util/e-cell-combo.c
index de2fde8..b3eb2aa 100644
--- a/src/e-util/e-cell-combo.c
+++ b/src/e-util/e-cell-combo.c
@@ -414,7 +414,9 @@ e_cell_combo_show_popup (ECellCombo *ecc,
                          gint view_col)
 {
        GdkWindow *window;
+       GtkWidget *toplevel = NULL;
        GtkAllocation allocation;
+       ETableItem *eti;
        gint x, y, width, height, old_width, old_height;
 
        gtk_widget_get_allocation (ecc->popup_window, &allocation);
@@ -435,6 +437,15 @@ e_cell_combo_show_popup (ECellCombo *ecc,
                        GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window)));
        }
 
+       eti = E_TABLE_ITEM (E_CELL_POPUP (ecc)->popup_cell_view->cell_view.e_table_item_view);
+       if (eti) {
+               toplevel = gtk_widget_get_toplevel (GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas));
+               if (!GTK_IS_WINDOW (toplevel))
+                       toplevel = NULL;
+       }
+
+       gtk_window_set_transient_for (GTK_WINDOW (ecc->popup_window), toplevel ? GTK_WINDOW (toplevel) : 
NULL);
+
        gtk_window_move (GTK_WINDOW (ecc->popup_window), x, y);
        gtk_widget_set_size_request (ecc->popup_window, width, height);
        gtk_widget_realize (ecc->popup_window);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]