[gtk+/wip/carlosg/private-event-structs] settings: Convert to GdkEvent API



commit 82553489bc6b2c80b9ae939f1120a0e53f98cc2c
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 25 22:54:25 2017 -0400

    settings: Convert to GdkEvent API

 gtk/gtkmain.c            |    2 +-
 gtk/gtksettings.c        |   11 ++++++++---
 gtk/gtksettingsprivate.h |    2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 4364e79..d9411d5 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1613,7 +1613,7 @@ gtk_main_do_event (GdkEvent *event)
 
   if (event->type == GDK_SETTING)
     {
-      _gtk_settings_handle_event (&event->setting);
+      _gtk_settings_handle_event (event);
       return;
     }
 
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index ee0a081..b3e5e01 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -2007,15 +2007,20 @@ gtk_rc_property_parse_border (const GParamSpec *pspec,
 }
 
 void
-_gtk_settings_handle_event (GdkEventSetting *event)
+_gtk_settings_handle_event (GdkEvent *event)
 {
   GdkScreen *screen;
   GtkSettings *settings;
   GParamSpec *pspec;
+  const char *name;
 
-  screen = gdk_window_get_screen (event->window);
+  screen = gdk_window_get_screen (gdk_event_get_window (event));
   settings = gtk_settings_get_for_screen (screen);
-  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), event->name);
+
+  if (!gdk_event_get_setting (event, &name))
+    return;
+
+  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), name);
 
   if (!pspec)
     return;
diff --git a/gtk/gtksettingsprivate.h b/gtk/gtksettingsprivate.h
index 1b1006e..aaa06b6 100644
--- a/gtk/gtksettingsprivate.h
+++ b/gtk/gtksettingsprivate.h
@@ -31,7 +31,7 @@ void                _gtk_settings_set_property_value_from_rc (GtkSettings
                                                               const GtkSettingsValue *svalue);
 void                _gtk_settings_reset_rc_values            (GtkSettings            *settings);
 
-void                _gtk_settings_handle_event               (GdkEventSetting        *event);
+void                _gtk_settings_handle_event               (GdkEvent               *event);
 GtkRcPropertyParser _gtk_rc_property_parser_from_type        (GType                   type);
 gboolean            _gtk_settings_parse_convert              (GtkRcPropertyParser     parser,
                                                               const GValue           *src_value,


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