forked from AuroraMiddleware/gtk
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:
parent
75e202f02b
commit
771b3ea6f3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user