diff options
author | Timm Bäder <mail@baedert.org> | 2020-04-29 08:11:07 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-05-05 08:20:10 +0200 |
commit | 771b3ea6f31d7689b15bdb3da7937b981bff02f0 (patch) | |
tree | 887131edbaa3e25e4846c367c2a6b3d1cccfe8aa /gtk/gtkeventcontroller.c | |
parent | 75e202f02b8ad2ed546b12984197649373f62c28 (diff) | |
download | gtk+-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.c | 8 |
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; } |