A small patch - I think it is safe.  But a second opinion would be appreciated.

J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.

From 0c4c71a90510ca967a5941250e172c72623221cd Mon Sep 17 00:00:00 2001
From: John Darrington <j...@darrington.wattle.id.au>
Date: Mon, 20 May 2013 07:29:46 +0200
Subject: [PATCH] Avoid use of deprecated symbols setting focus in
 pspp-sheet-view.

Recent Gtk+ deprecated the GTK_HAS_FOCUS flag and and the GTK_WIDGET_{UN}SET_FLAGS macros.  So use
the new gtk_widget_grab_focus function instead.

This change deletes one path from the code - there seems to be no modern way of unsetting the "has focus"
flag and probably intentionally so.  It makes no sense to ungrab the focus.  Instead, the onus is on
some other widget to grab it.
---
 src/ui/gui/pspp-sheet-view.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c
index 03b191d..bd291a7 100644
--- a/src/ui/gui/pspp-sheet-view.c
+++ b/src/ui/gui/pspp-sheet-view.c
@@ -8552,10 +8552,8 @@ send_focus_change (GtkWidget *widget,
 
   g_object_ref (widget);
    
- if (in)
-   GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
- else
-   GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
+  if (in)
+   gtk_widget_grab_focus (widget, TRUE);
 
   fevent->focus_change.type = GDK_FOCUS_CHANGE;
   fevent->focus_change.window = g_object_ref (widget->window);
-- 
1.7.10.4

Attachment: signature.asc
Description: Digital signature

_______________________________________________
pspp-dev mailing list
pspp-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to