[gtk: 7/15] GtkWindow: Create renderer before realizing child widgets
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 7/15] GtkWindow: Create renderer before realizing child widgets
- Date: Tue, 29 Sep 2020 08:30:50 +0000 (UTC)
commit 645fc6a9a56e2935ea83941ffd8e192aeb4b05ea
Author: Alexander Larsson <alexl redhat com>
Date: Mon Sep 28 20:47:32 2020 +0200
GtkWindow: Create renderer before realizing child widgets
This way the child widgets can rely on the renderer (for example what
type it is) to decide details about how they render (such as if they
should use OpenGL shaders).
gtk/gtkwindow.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index aecafe43be..947b178f76 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4387,6 +4387,9 @@ gtk_window_realize (GtkWidget *widget)
priv->surface = surface;
gdk_surface_set_widget (surface, widget);
+ if (priv->renderer == NULL)
+ priv->renderer = gsk_renderer_new_for_surface (surface);
+
g_signal_connect_swapped (surface, "notify::state", G_CALLBACK (surface_state_changed), widget);
g_signal_connect_swapped (surface, "size-changed", G_CALLBACK (surface_size_changed), widget);
g_signal_connect (surface, "render", G_CALLBACK (surface_render), widget);
@@ -4397,9 +4400,6 @@ gtk_window_realize (GtkWidget *widget)
gtk_root_start_layout (GTK_ROOT (window));
- if (priv->renderer == NULL)
- priv->renderer = gsk_renderer_new_for_surface (surface);
-
if (priv->transient_parent &&
_gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]