[gtk] window: Don't manually queue a draw on the new focus widget
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] window: Don't manually queue a draw on the new focus widget
- Date: Wed, 16 Jan 2019 18:24:09 +0000 (UTC)
commit c1c764255f5108ea7b16ac590cc492a748d6fb26
Author: Timm Bäder <mail baedert org>
Date: Tue Jan 15 06:11:03 2019 +0100
window: Don't manually queue a draw on the new focus widget
This is either unneeded and OK to remove, or it is needed and there's a
bug somewhere else.
gtk/gtkwindow.c | 25 -------------------------
1 file changed, 25 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 75e962ed42..4c6162cf5c 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7749,33 +7749,24 @@ gtk_window_real_set_focus (GtkWindow *window,
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *old_focus = priv->focus_widget;
- gboolean had_default = FALSE;
- gboolean focus_had_default = FALSE;
- gboolean old_focus_had_default = FALSE;
if (old_focus)
{
g_object_ref (old_focus);
g_object_freeze_notify (G_OBJECT (old_focus));
- old_focus_had_default = gtk_widget_has_default (old_focus);
}
if (focus)
{
g_object_ref (focus);
g_object_freeze_notify (G_OBJECT (focus));
- focus_had_default = gtk_widget_has_default (focus);
}
- if (priv->default_widget)
- had_default = gtk_widget_has_default (priv->default_widget);
-
if (priv->focus_widget)
{
if (gtk_widget_get_receives_default (priv->focus_widget) &&
(priv->focus_widget != priv->default_widget))
{
_gtk_widget_set_has_default (priv->focus_widget, FALSE);
- gtk_widget_queue_draw (priv->focus_widget);
if (priv->default_widget)
_gtk_widget_set_has_default (priv->default_widget, TRUE);
@@ -7816,29 +7807,13 @@ gtk_window_real_set_focus (GtkWindow *window,
g_object_notify (G_OBJECT (priv->focus_widget), "is-focus");
}
- /* If the default widget changed, a redraw will have been queued
- * on the old and new default widgets by gtk_window_set_default(), so
- * we only have to worry about the case where it didn't change.
- * We'll sometimes queue a draw twice on the new widget but that
- * is harmless.
- */
- if (priv->default_widget &&
- (had_default != gtk_widget_has_default (priv->default_widget)))
- gtk_widget_queue_draw (priv->default_widget);
-
if (old_focus)
{
- if (old_focus_had_default != gtk_widget_has_default (old_focus))
- gtk_widget_queue_draw (old_focus);
-
g_object_thaw_notify (G_OBJECT (old_focus));
g_object_unref (old_focus);
}
if (focus)
{
- if (focus_had_default != gtk_widget_has_default (focus))
- gtk_widget_queue_draw (focus);
-
g_object_thaw_notify (G_OBJECT (focus));
g_object_unref (focus);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]