From e04276ee38bd07781d3149dbe5faf8bbf694e083 Mon Sep 17 00:00:00 2001 From: Hysterical Raisins Date: Tue, 9 Jul 2019 13:46:44 +0200 Subject: [PATCH] Use properly typed and named variables for user_data --- src/server-context-service.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/server-context-service.c b/src/server-context-service.c index 19437f9b..8cde11b5 100644 --- a/src/server-context-service.c +++ b/src/server-context-service.c @@ -65,10 +65,10 @@ static void set_dock (GtkWidget *widget, GtkAllocation *allocation); static void -on_monitors_changed (GdkScreen *screen, - gpointer user_data) +on_monitors_changed (GdkScreen *screen, + ServerContextService *context) + { - ServerContextService *context = user_data; if (context->window) set_geometry (context); } @@ -87,11 +87,10 @@ on_destroy (GtkWidget *widget, gpointer user_data) } static void -on_notify_keyboard (GObject *object, - GParamSpec *spec, - gpointer user_data) +on_notify_keyboard (GObject *object, + GParamSpec *spec, + ServerContextService *context) { - ServerContextService *context = user_data; const EekKeyboard *keyboard; keyboard = eekboard_context_service_get_keyboard (EEKBOARD_CONTEXT_SERVICE(context)); @@ -124,21 +123,21 @@ on_notify_keyboard (GObject *object, } } } - + static void -on_notify_fullscreen (GObject *object, - GParamSpec *spec, - gpointer user_data) +on_notify_fullscreen (GObject *object, // <--- context + GParamSpec *spec, + ServerContextService *context) // <--- more context { - ServerContextService *context = user_data; if (context->window) set_geometry (context); } static void -on_notify_visible (GObject *object, GParamSpec *spec, gpointer user_data) +on_notify_visible (GObject *object, // <--- context + GParamSpec *spec, + ServerContextService *context) // <--- more context { - ServerContextService *context = user_data; gboolean visible; g_object_get (object, "visible", &visible, NULL); @@ -197,10 +196,9 @@ on_size_allocate_set_dock (GtkWidget *widget, } static void -on_realize_set_non_maximizable (GtkWidget *widget, - gpointer user_data) +on_realize_set_non_maximizable (GtkWidget *widget, + ServerContextService *context) { - ServerContextService *context = user_data; g_assert (context && context->window == widget);