[gtk/matthiasc/color-profiles: 9/9] widget-factory: Render in SDR




commit c14225eb9f61fdaa8901b52c807b7e91a8f9af10
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 1 14:23:07 2021 -0400

    widget-factory: Render in SDR
    
    This is just for test purposes. We should
    have a proper demo that shows how to create
    windows with SDR or HDR rendering.

 demos/widget-factory/widget-factory.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index c18b502bcf..967bf9d111 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -28,6 +28,8 @@
 #include "demo_conf.h"
 #include "gtkloaderprivate.h"
 
+#include <gdk/wayland/gdkwayland.h>
+
 static void
 change_dark_state (GSimpleAction *action,
                     GVariant      *state,
@@ -2095,6 +2097,9 @@ activate (GApplication *app)
     }
 
   window = (GtkWindow *)gtk_builder_get_object (builder, "window");
+  gtk_widget_realize (GTK_WIDGET (window));
+  GdkSurface *surface = gtk_native_get_surface (GTK_NATIVE (window));
+  gdk_wayland_surface_set_rendering (GDK_WAYLAND_SURFACE (surface), GDK_RENDERING_SDR);
 
   if (g_strcmp0 (PROFILE, "devel") == 0)
     gtk_widget_add_css_class (GTK_WIDGET (window), "devel");


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