From c68c754f3e5f6cfd31f2d49c47b90dc5b23f2a52 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 25 Aug 2017 22:54:25 -0400 Subject: [PATCH] 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 4364e79514..d9411d5fce 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 3bdb863eaf..e2b5d43ff3 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -2009,15 +2009,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 1b1006e5d1..aaa06b69d8 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,