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.
This commit is contained in:
Timm Bäder 2020-04-29 08:11:07 +02:00
parent 75e202f02b
commit 771b3ea6f3

View File

@ -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;
}