[gtk+] GtkGLArea: Handle window scale factor changes
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkGLArea: Handle window scale factor changes
- Date: Tue, 16 Dec 2014 12:28:44 +0000 (UTC)
commit b52a06ac6fae2cd777169db425e6ebc5cad44a10
Author: Alexander Larsson <alexl redhat com>
Date: Tue Dec 16 13:27:49 2014 +0100
GtkGLArea: Handle window scale factor changes
We need to re-allocate the buffers for the new gl size.
gtk/gtkglarea.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index e68dc01..a9dc310 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -298,6 +298,22 @@ gtk_gl_area_realize (GtkWidget *widget)
priv->needs_resize = TRUE;
}
+static void
+gtk_gl_area_notify (GObject *object,
+ GParamSpec *pspec)
+{
+ if (strcmp (pspec->name, "scale-factor") == 0)
+ {
+ GtkGLArea *area = GTK_GL_AREA (object);
+ GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
+
+ priv->needs_resize = TRUE;
+ }
+
+ if (G_OBJECT_CLASS (gtk_gl_area_parent_class)->notify)
+ G_OBJECT_CLASS (gtk_gl_area_parent_class)->notify (object, pspec);
+}
+
static GdkGLContext *
gtk_gl_area_real_create_context (GtkGLArea *area)
{
@@ -843,6 +859,7 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
gobject_class->set_property = gtk_gl_area_set_property;
gobject_class->get_property = gtk_gl_area_get_property;
gobject_class->dispose = gtk_gl_area_dispose;
+ gobject_class->notify = gtk_gl_area_notify;
g_object_class_install_properties (gobject_class, LAST_PROP, obj_props);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]