forked from AuroraMiddleware/gtk
popover: Only give back focus to drawable widgets
If the previous focus widget is not drawable anymore, don't even bother in transmitting the focus grab to it.
This commit is contained in:
parent
aa7e00fcb8
commit
08e9c93b17
@ -275,10 +275,12 @@ gtk_popover_apply_modality (GtkPopover *popover,
|
|||||||
{
|
{
|
||||||
gtk_grab_remove (GTK_WIDGET (popover));
|
gtk_grab_remove (GTK_WIDGET (popover));
|
||||||
|
|
||||||
/* Let prev_focus_widget regain focus */
|
|
||||||
if (priv->prev_focus_widget)
|
if (priv->prev_focus_widget)
|
||||||
{
|
{
|
||||||
gtk_widget_grab_focus (priv->prev_focus_widget);
|
/* Let prev_focus_widget regain focus */
|
||||||
|
if (gtk_widget_is_drawable (priv->prev_focus_widget))
|
||||||
|
gtk_widget_grab_focus (priv->prev_focus_widget);
|
||||||
|
|
||||||
g_object_unref (priv->prev_focus_widget);
|
g_object_unref (priv->prev_focus_widget);
|
||||||
priv->prev_focus_widget = NULL;
|
priv->prev_focus_widget = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user