mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 15:01:23 +00:00
gtkpointerfocus: Add methods to handle implicit grabs on widgets
Just a basic setter/getter, plus a method to obtain the right logical target in the presence or absence of these.
This commit is contained in:
parent
3dfab962fa
commit
23d2126729
@ -78,6 +78,19 @@ gtk_pointer_focus_get_target (GtkPointerFocus *focus)
|
||||
return focus->target;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_pointer_focus_set_implicit_grab (GtkPointerFocus *focus,
|
||||
GtkWidget *grab_widget)
|
||||
{
|
||||
focus->grab_widget = grab_widget;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_pointer_focus_get_implicit_grab (GtkPointerFocus *focus)
|
||||
{
|
||||
return focus->grab_widget;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_pointer_focus_set_coordinates (GtkPointerFocus *focus,
|
||||
gdouble x,
|
||||
@ -87,6 +100,21 @@ gtk_pointer_focus_set_coordinates (GtkPointerFocus *focus,
|
||||
focus->y = y;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_pointer_focus_get_effective_target (GtkPointerFocus *focus)
|
||||
{
|
||||
GtkWidget *target;
|
||||
|
||||
target = focus->target;
|
||||
|
||||
if (focus->grab_widget &&
|
||||
focus->grab_widget != target &&
|
||||
!gtk_widget_is_ancestor (target, focus->grab_widget))
|
||||
target = focus->grab_widget;
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_pointer_focus_repick_target (GtkPointerFocus *focus)
|
||||
{
|
||||
|
@ -47,6 +47,12 @@ void gtk_pointer_focus_set_target (GtkPointerFocus *focus,
|
||||
GtkWidget *target);
|
||||
GtkWidget * gtk_pointer_focus_get_target (GtkPointerFocus *focus);
|
||||
|
||||
void gtk_pointer_focus_set_implicit_grab (GtkPointerFocus *focus,
|
||||
GtkWidget *grab_widget);
|
||||
GtkWidget * gtk_pointer_focus_get_implicit_grab (GtkPointerFocus *focus);
|
||||
|
||||
GtkWidget * gtk_pointer_focus_get_effective_target (GtkPointerFocus *focus);
|
||||
|
||||
void gtk_pointer_focus_repick_target (GtkPointerFocus *focus);
|
||||
|
||||
#endif /* _GTK_POINTER_FOCUS_PRIVATE_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user