[gtk/popup-shadow-width: 269/269] wayland: Set shadow width on popup surfaces




commit c71f5c299eb24213c9217c3ecb49aa313addc980
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Feb 7 20:40:32 2021 -0500

    wayland: Set shadow width on popup surfaces

 gdk/wayland/gdksurface-wayland.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index c2699ca143..f1909629a5 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -2293,10 +2293,10 @@ calculate_popup_rect (GdkSurface     *surface,
   int x = 0, y = 0;
 
   gdk_popup_layout_get_shadow_width (layout,
-                                     shadow_left,
-                                     shadow_right,
-                                     shadow_top,
-                                     shadow_bottom);
+                                     &shadow_left,
+                                     &shadow_right,
+                                     &shadow_top,
+                                     &shadow_bottom);
 
   width = (impl->popup.unconstrained_width - (shadow_left + shadow_right));
   height = (impl->popup.unconstrained_height - (shadow_top + shadow_bottom));
@@ -2504,10 +2504,10 @@ create_dynamic_positioner (GdkSurface     *surface,
   int shadow_bottom;
 
   gdk_popup_layout_get_shadow_width (layout,
-                                     shadow_left,
-                                     shadow_right,
-                                     shadow_top,
-                                     shadow_bottom);
+                                     &shadow_left,
+                                     &shadow_right,
+                                     &shadow_top,
+                                     &shadow_bottom);
   geometry = (GdkRectangle) {
     .x = shadow_left,
     .y = shadow_top,
@@ -2738,6 +2738,18 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface     *surface,
       g_assert_not_reached ();
     }
 
+  gdk_popup_layout_get_shadow_width (layout,
+                                     &impl->shadow_left,
+                                     &impl->shadow_right,
+                                     &impl->shadow_top,
+                                     &impl->shadow_bottom);
+
+  g_print ("popup shadow %d %d %d %d\n",
+           impl->shadow_left, impl->shadow_right,
+           impl->shadow_top, impl->shadow_bottom);
+
+  gdk_wayland_surface_sync_shadow (surface);
+
   if (grab_input_seat)
     {
       struct wl_seat *seat;


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