[gtk] widget: Directly access priv pointer in even controller API
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] widget: Directly access priv pointer in even controller API
- Date: Sat, 5 May 2018 08:19:35 +0000 (UTC)
commit af27199102ac98ee170f8f4af2e415ce11e95310
Author: Timm Bäder <mail baedert org>
Date: Wed May 2 19:57:36 2018 +0200
widget: Directly access priv pointer in even controller API
Spares us a few lines.
gtk/gtkwidget.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 58a8379aac..15c8384bbf 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12903,15 +12903,13 @@ void
gtk_widget_add_controller (GtkWidget *widget,
GtkEventController *controller)
{
- GtkWidgetPrivate *priv;
+ GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
EventControllerData *data;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_IS_EVENT_CONTROLLER (controller));
g_return_if_fail (gtk_event_controller_get_widget (controller) == NULL);
- priv = widget->priv;
-
GTK_EVENT_CONTROLLER_GET_CLASS (controller)->set_widget (controller, widget);
data = g_new0 (EventControllerData, 1);
@@ -12948,16 +12946,14 @@ void
gtk_widget_remove_controller (GtkWidget *widget,
GtkEventController *controller)
{
+ GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
EventControllerData *data = NULL;
- GtkWidgetPrivate *priv;
GList *l;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_IS_EVENT_CONTROLLER (controller));
g_return_if_fail (gtk_event_controller_get_widget (controller) == widget);
- priv = widget->priv;
-
for (l = priv->event_controllers; l; l = l->next)
{
data = l->data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]