[gtk/wip/chergert/popover-opaque-region: 3/3] popover: use GtkNative opaque region API




commit 2fbf17f453f7b0d30a0d963891fa4025ac156ce7
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 10 16:54:32 2022 -0800

    popover: use GtkNative opaque region API
    
    This updates GtkPopover to use the new GtkNative abstraction for
    reporting opaque regions of the window, in hopes that it can speed
    up compositors for things like animated lists, menu transitions,
    and more.
    
    Fixes #4689

 gtk/gtkpopover.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 3c16e89312..2f4a33493e 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -957,6 +957,8 @@ gtk_popover_realize (GtkWidget *widget)
   priv->renderer = gsk_renderer_new_for_surface (priv->surface);
 
   gtk_native_realize (GTK_NATIVE (popover));
+
+  gtk_native_update_opaque_region (GTK_NATIVE (popover), priv->contents_widget, TRUE, TRUE, 0);
 }
 
 static void
@@ -1392,6 +1394,9 @@ gtk_popover_update_shape (GtkPopover *popover)
       gdk_surface_set_input_region (priv->surface, region);
       cairo_region_destroy (region);
     }
+
+  if (_gtk_widget_get_realized (GTK_WIDGET (popover)))
+    gtk_native_update_opaque_region (GTK_NATIVE (popover), priv->contents_widget, TRUE, TRUE, 0);
 }
 
 static int


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