entry: Return boolean from gtk_entry_grab_focus_without_selecting()
authorBenjamin Otte <otte@redhat.com>
Wed, 16 Oct 2019 19:36:05 +0000 (21:36 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 16 Oct 2019 20:08:53 +0000 (22:08 +0200)
This follows recent changes to gtk_widget_grab_focus().

gtk/gtkentry.c
gtk/gtkentry.h

index 778e0b0657245e9168a7ff6dc4dbd8c5db8bfdeb..b9e33f4aed42571747526db0eaae205de79d0c59 100644 (file)
@@ -1695,14 +1695,17 @@ gtk_entry_snapshot (GtkWidget   *widget,
  * You only want to call this on some special entries
  * which the user usually doesn't want to replace all text in,
  * such as search-as-you-type entries.
+ *
+ * Returns: %TRUE if focus is now inside @self
  */
-void
+gboolean
 gtk_entry_grab_focus_without_selecting (GtkEntry *entry)
 {
-  g_return_if_fail (GTK_IS_ENTRY (entry));
   GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
 
-  gtk_text_grab_focus_without_selecting (GTK_TEXT (priv->text));
+  g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE);
+
+  return gtk_text_grab_focus_without_selecting (GTK_TEXT (priv->text));
 }
 
 static void
index 80ebd94bfa515bca6163ce8ca164532caa3342e0..fca03bc2b847d034fc7c098e1ae6a4aaa1dd694d 100644 (file)
@@ -304,7 +304,7 @@ GDK_AVAILABLE_IN_ALL
 PangoTabArray  *gtk_entry_get_tabs                           (GtkEntry             *entry);
 
 GDK_AVAILABLE_IN_ALL
-void           gtk_entry_grab_focus_without_selecting        (GtkEntry             *entry);
+gboolean       gtk_entry_grab_focus_without_selecting        (GtkEntry             *entry);
 
 GDK_AVAILABLE_IN_ALL
 void           gtk_entry_set_extra_menu                      (GtkEntry             *entry,