[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch for review
From: |
Ben Pfaff |
Subject: |
Re: Patch for review |
Date: |
Mon, 20 May 2013 20:10:33 -0700 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, May 20, 2013 at 07:33:19AM +0200, John Darrington wrote:
> A small patch - I think it is safe. But a second opinion would be
> appreciated.
It looks OK at first glance. But here is the corresponding patch from
the GTK+ repository that makes the same change to GtkTreeView. It might
be better to adapt that change to PsppSheetView.
--8<--------------------------cut here-------------------------->8--
From: Emmanuele Bassi <address@hidden>
Date: Mon, 12 Apr 2010 14:54:41 +0100
Subject: [PATCH] tree-view: Use gtk_widget_send_focus_change()
Remove the second (and last) internal user of the GTK_HAS_FOCUS flag.
https://bugzilla.gnome.org/show_bug.cgi?id=593671
---
gtk/gtktreeview.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 93bb688..f464ec4 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -10268,22 +10268,12 @@ send_focus_change (GtkWidget *widget,
{
GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
- g_object_ref (widget);
-
- if (in)
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
- else
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
-
fevent->focus_change.type = GDK_FOCUS_CHANGE;
- fevent->focus_change.window = g_object_ref (widget->window);
+ fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget));
fevent->focus_change.in = in;
-
- gtk_widget_event (widget, fevent);
-
- g_object_notify (G_OBJECT (widget), "has-focus");
- g_object_unref (widget);
+ gtk_widget_send_focus_change (widget, fevent);
+
gdk_event_free (fevent);
}
--
1.7.10.4