[gtk/default-handling: 11/18] Drop gtk_window_activate_default
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/default-handling: 11/18] Drop gtk_window_activate_default
- Date: Sun, 28 Apr 2019 19:32:44 +0000 (UTC)
commit 1be08b2673aade8ed22d7606e147baa5c398611f
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 28 18:41:43 2019 +0000
Drop gtk_window_activate_default
This api has been replaced by an action that
can be activated with gtk_widget_activate_action.
docs/reference/gtk/gtk4-sections.txt | 1 -
gtk/gtkwindow.c | 31 +++++--------------------------
gtk/gtkwindow.h | 2 --
3 files changed, 5 insertions(+), 29 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 33b23a0211..0aeda53ff1 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4649,7 +4649,6 @@ gtk_window_get_resizable
gtk_window_add_accel_group
gtk_window_remove_accel_group
gtk_window_activate_focus
-gtk_window_activate_default
gtk_window_set_modal
gtk_window_set_default_size
gtk_window_set_hide_on_close
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index c6bd84f4a7..9dd3f83847 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1780,7 +1780,7 @@ activate_default_cb (GSimpleAction *action,
GVariant *parameter,
gpointer data)
{
- gtk_window_activate_default (GTK_WINDOW (data));
+ gtk_window_real_activate_default (GTK_WINDOW (data));
}
static void
@@ -2927,31 +2927,16 @@ gtk_window_get_focus (GtkWindow *window)
return priv->focus_widget;
}
-/**
- * gtk_window_activate_default:
- * @window: a #GtkWindow
- *
- * Activates the default widget for the window, unless the current
- * focused widget has been configured to receive the default action
- * (see gtk_widget_set_receives_default()), in which case the
- * focused widget is activated.
- *
- * Returns: %TRUE if a widget got activated.
- **/
-gboolean
-gtk_window_activate_default (GtkWindow *window)
+static void
+gtk_window_real_activate_default (GtkWindow *window)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
-
if (priv->default_widget && gtk_widget_is_sensitive (priv->default_widget) &&
(!priv->focus_widget || !gtk_widget_get_receives_default (priv->focus_widget)))
- return gtk_widget_activate (priv->default_widget);
+ gtk_widget_activate (priv->default_widget);
else if (priv->focus_widget && gtk_widget_is_sensitive (priv->focus_widget))
- return gtk_widget_activate (priv->focus_widget);
-
- return FALSE;
+ gtk_widget_activate (priv->focus_widget);
}
/**
@@ -6273,12 +6258,6 @@ get_active_region_type (GtkWindow *window, gint x, gint y)
return GTK_WINDOW_REGION_CONTENT;
}
-static void
-gtk_window_real_activate_default (GtkWindow *window)
-{
- gtk_window_activate_default (window);
-}
-
static void
gtk_window_real_activate_focus (GtkWindow *window)
{
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 4fe9dfa609..167df62b52 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -169,8 +169,6 @@ void gtk_window_set_default_widget (GtkWindow *window,
GtkWidget *default_widget);
GDK_AVAILABLE_IN_ALL
GtkWidget *gtk_window_get_default_widget (GtkWindow *window);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_window_activate_default (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
void gtk_window_set_transient_for (GtkWindow *window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]