summaryrefslogtreecommitdiff
path: root/gtk/gtkeventcontroller.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-04-29 08:11:07 +0200
committerTimm Bäder <mail@baedert.org>2020-05-05 08:20:10 +0200
commit771b3ea6f31d7689b15bdb3da7937b981bff02f0 (patch)
tree887131edbaa3e25e4846c367c2a6b3d1cccfe8aa /gtk/gtkeventcontroller.c
parent75e202f02b8ad2ed546b12984197649373f62c28 (diff)
downloadgtk+-771b3ea6f31d7689b15bdb3da7937b981bff02f0.tar.gz
eventcontroller: Remove some unnecessary casts
Instead of comparing two GtkWidget*s by casting the two GtkNative*s, we can as well compare two GtkNative*s. Also if gtk_widget_get_native() returns NULL, the code previously failed.
Diffstat (limited to 'gtk/gtkeventcontroller.c')
-rw-r--r--gtk/gtkeventcontroller.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkeventcontroller.c b/gtk/gtkeventcontroller.c
index 37a048ec81..52d91719c2 100644
--- a/gtk/gtkeventcontroller.c
+++ b/gtk/gtkeventcontroller.c
@@ -250,14 +250,14 @@ static gboolean
same_native (GtkWidget *widget,
GtkWidget *target)
{
- GtkWidget *native;
- GtkWidget *native2;
+ GtkNative *native;
+ GtkNative *native2;
if (!widget || !target)
return TRUE;
- native = GTK_WIDGET (gtk_widget_get_native (widget));
- native2 = GTK_WIDGET (gtk_widget_get_native (target));
+ native = gtk_widget_get_native (widget);
+ native2 = gtk_widget_get_native (target);
return native == native2;
}