[gtk/x11-props] Drop focus-related properties
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/x11-props] Drop focus-related properties
- Date: Sat, 14 Mar 2020 14:09:12 +0000 (UTC)
commit 67ece3721b6da41c217bf0774fbbb9b2309f1254
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 14 10:05:11 2020 -0400
Drop focus-related properties
We don't use these, and they are only implemented on X11.
gtk/gtkwindow.c | 138 --------------------------------------------------------
gtk/gtkwindow.h | 10 ----
2 files changed, 148 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index dcf42933d2..416ceddae2 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -300,8 +300,6 @@ enum {
PROP_HIDE_ON_CLOSE,
PROP_ICON_NAME,
PROP_DISPLAY,
- PROP_ACCEPT_FOCUS,
- PROP_FOCUS_ON_MAP,
PROP_DECORATED,
PROP_DELETABLE,
PROP_TRANSIENT_FOR,
@@ -929,30 +927,6 @@ gtk_window_class_init (GtkWindowClass *klass)
FALSE,
GTK_PARAM_READABLE);
- /**
- * GtkWindow:accept-focus:
- *
- * Whether the window should receive the input focus.
- */
- window_props[PROP_ACCEPT_FOCUS] =
- g_param_spec_boolean ("accept-focus",
- P_("Accept focus"),
- P_("TRUE if the window should receive the input focus."),
- TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
-
- /**
- * GtkWindow:focus-on-map:
- *
- * Whether the window should receive the input focus when mapped.
- */
- window_props[PROP_FOCUS_ON_MAP] =
- g_param_spec_boolean ("focus-on-map",
- P_("Focus on map"),
- P_("TRUE if the window should receive the input focus when mapped."),
- TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
-
/**
* GtkWindow:decorated:
*
@@ -1945,14 +1919,6 @@ gtk_window_set_property (GObject *object,
case PROP_DISPLAY:
gtk_window_set_display (window, g_value_get_object (value));
break;
- case PROP_ACCEPT_FOCUS:
- gtk_window_set_accept_focus (window,
- g_value_get_boolean (value));
- break;
- case PROP_FOCUS_ON_MAP:
- gtk_window_set_focus_on_map (window,
- g_value_get_boolean (value));
- break;
case PROP_DECORATED:
gtk_window_set_decorated (window, g_value_get_boolean (value));
break;
@@ -2036,14 +2002,6 @@ gtk_window_get_property (GObject *object,
case PROP_IS_ACTIVE:
g_value_set_boolean (value, priv->is_active);
break;
- case PROP_ACCEPT_FOCUS:
- g_value_set_boolean (value,
- gtk_window_get_accept_focus (window));
- break;
- case PROP_FOCUS_ON_MAP:
- g_value_set_boolean (value,
- gtk_window_get_focus_on_map (window));
- break;
case PROP_DECORATED:
g_value_set_boolean (value, gtk_window_get_decorated (window));
break;
@@ -3320,98 +3278,6 @@ gtk_window_set_application (GtkWindow *window,
}
}
-/**
- * gtk_window_set_accept_focus:
- * @window: a #GtkWindow
- * @setting: %TRUE to let this window receive input focus
- *
- * Windows may set a hint asking the desktop environment not to receive
- * the input focus. This function sets this hint.
- **/
-void
-gtk_window_set_accept_focus (GtkWindow *window,
- gboolean setting)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
- g_return_if_fail (GTK_IS_WINDOW (window));
-
- setting = setting != FALSE;
-
- if (priv->accept_focus != setting)
- {
- priv->accept_focus = setting;
- if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- gdk_toplevel_set_accept_focus (GDK_TOPLEVEL (priv->surface), priv->accept_focus);
- g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ACCEPT_FOCUS]);
- }
-}
-
-/**
- * gtk_window_get_accept_focus:
- * @window: a #GtkWindow
- *
- * Gets the value set by gtk_window_set_accept_focus().
- *
- * Returns: %TRUE if window should receive the input focus
- **/
-gboolean
-gtk_window_get_accept_focus (GtkWindow *window)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
- g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
-
- return priv->accept_focus;
-}
-
-/**
- * gtk_window_set_focus_on_map:
- * @window: a #GtkWindow
- * @setting: %TRUE to let this window receive input focus on map
- *
- * Windows may set a hint asking the desktop environment not to receive
- * the input focus when the window is mapped. This function sets this
- * hint.
- **/
-void
-gtk_window_set_focus_on_map (GtkWindow *window,
- gboolean setting)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
- g_return_if_fail (GTK_IS_WINDOW (window));
-
- setting = setting != FALSE;
-
- if (priv->focus_on_map != setting)
- {
- priv->focus_on_map = setting;
- if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- gdk_toplevel_set_focus_on_map (GDK_TOPLEVEL (priv->surface), priv->focus_on_map);
- g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FOCUS_ON_MAP]);
- }
-}
-
-/**
- * gtk_window_get_focus_on_map:
- * @window: a #GtkWindow
- *
- * Gets the value set by gtk_window_set_focus_on_map().
- *
- * Returns: %TRUE if window should receive the input focus when
- * mapped.
- **/
-gboolean
-gtk_window_get_focus_on_map (GtkWindow *window)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
- g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
-
- return priv->focus_on_map;
-}
-
/**
* gtk_window_set_destroy_with_parent:
* @window: a #GtkWindow
@@ -5494,10 +5360,6 @@ gtk_window_realize (GtkWidget *widget)
gdk_wayland_surface_announce_csd (surface);
#endif
- gdk_toplevel_set_accept_focus (GDK_TOPLEVEL (surface),
- gtk_window_get_accept_focus (window));
- gdk_toplevel_set_focus_on_map (GDK_TOPLEVEL (surface),
- gtk_window_get_focus_on_map (window));
gdk_toplevel_set_modal (GDK_TOPLEVEL (surface), priv->modal);
if (priv->startup_id)
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 4f0b4385b7..8c14324e89 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -124,16 +124,6 @@ void gtk_window_set_attached_to (GtkWindow *window,
GDK_AVAILABLE_IN_ALL
GtkWidget *gtk_window_get_attached_to (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
-void gtk_window_set_accept_focus (GtkWindow *window,
- gboolean setting);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_window_get_accept_focus (GtkWindow *window);
-GDK_AVAILABLE_IN_ALL
-void gtk_window_set_focus_on_map (GtkWindow *window,
- gboolean setting);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_window_get_focus_on_map (GtkWindow *window);
-GDK_AVAILABLE_IN_ALL
void gtk_window_set_destroy_with_parent (GtkWindow *window,
gboolean setting);
GDK_AVAILABLE_IN_ALL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]