[gtk/x11-props: 3/4] window: Drop keep above/below
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/x11-props: 3/4] window: Drop keep above/below
- Date: Sat, 14 Mar 2020 05:57:23 +0000 (UTC)
commit f5bd70942874af82415f166f1365e4ffedd60497
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 14 01:43:30 2020 -0400
window: Drop keep above/below
gtk/gtkwindow.c | 93 ---------------------------------------------------------
gtk/gtkwindow.h | 4 ---
2 files changed, 97 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f1476a3797..dcf42933d2 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -230,9 +230,7 @@ typedef struct
*/
guint need_default_size : 1;
- guint above_initially : 1;
guint accept_focus : 1;
- guint below_initially : 1;
guint builder_visible : 1;
guint configure_notify_received : 1;
guint decorated : 1;
@@ -4885,9 +4883,6 @@ gtk_window_map (GtkWidget *widget)
gtk_widget_get_child_visible (priv->title_box))
gtk_widget_map (priv->title_box);
- gdk_toplevel_set_keep_above (GDK_TOPLEVEL (priv->surface), priv->above_initially);
- gdk_toplevel_set_keep_below (GDK_TOPLEVEL (priv->surface), priv->below_initially);
-
layout = gdk_toplevel_layout_new (1, 1);
gdk_toplevel_layout_set_resizable (layout, priv->resizable);
gdk_toplevel_layout_set_maximized (layout, priv->maximize_initially);
@@ -4957,8 +4952,6 @@ gtk_window_unmap (GtkWidget *widget)
state = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface));
priv->minimize_initially = (state & GDK_SURFACE_STATE_MINIMIZED) != 0;
priv->maximize_initially = (state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
- priv->above_initially = (state & GDK_SURFACE_STATE_ABOVE) != 0;
- priv->below_initially = (state & GDK_SURFACE_STATE_BELOW) != 0;
if (priv->title_box != NULL)
gtk_widget_unmap (priv->title_box);
@@ -6686,7 +6679,6 @@ ontop_window_clicked (GtkModelButton *button,
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
gtk_popover_popdown (GTK_POPOVER (priv->popup_menu));
- gtk_window_set_keep_above (window, !priv->above_initially);
}
static void
@@ -6783,7 +6775,6 @@ gtk_window_do_popup_fallback (GtkWindow *window,
g_object_set (menuitem,
"text", _("Always on Top"),
"role", GTK_BUTTON_ROLE_CHECK,
- "active", priv->above_initially,
NULL);
if (maximized)
@@ -7810,90 +7801,6 @@ gtk_window_unfullscreen (GtkWindow *window)
gtk_window_update_toplevel (window);
}
-/**
- * gtk_window_set_keep_above:
- * @window: a #GtkWindow
- * @setting: whether to keep @window above other windows
- *
- * Asks to keep @window above, so that it stays on top. Note that
- * you shouldn’t assume the window is definitely above afterward,
- * because other entities (e.g. the user or
- * [window manager][gtk-X11-arch]) could not keep it above,
- * and not all window managers support keeping windows above. But
- * normally the window will end kept above. Just don’t write code
- * that crashes if not.
- *
- * It’s permitted to call this function before showing a window,
- * in which case the window will be kept above when it appears onscreen
- * initially.
- *
- * You can track iconification via the #GdkSurface::state property
- *
- * Note that, according to the
- * [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec),
- * the above state is mainly meant for user preferences and should not
- * be used by applications e.g. for drawing attention to their
- * dialogs.
- **/
-void
-gtk_window_set_keep_above (GtkWindow *window,
- gboolean setting)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
- g_return_if_fail (GTK_IS_WINDOW (window));
-
- setting = setting != FALSE;
-
- priv->above_initially = setting;
- priv->below_initially &= !setting;
-
- if (priv->surface)
- gdk_toplevel_set_keep_above (GDK_TOPLEVEL (priv->surface), setting);
-}
-
-/**
- * gtk_window_set_keep_below:
- * @window: a #GtkWindow
- * @setting: whether to keep @window below other windows
- *
- * Asks to keep @window below, so that it stays in bottom. Note that
- * you shouldn’t assume the window is definitely below afterward,
- * because other entities (e.g. the user or
- * [window manager][gtk-X11-arch]) could not keep it below,
- * and not all window managers support putting windows below. But
- * normally the window will be kept below. Just don’t write code
- * that crashes if not.
- *
- * It’s permitted to call this function before showing a window,
- * in which case the window will be kept below when it appears onscreen
- * initially.
- *
- * You can track iconification via the #GdkSurface::state property
- *
- * Note that, according to the
- * [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec),
- * the above state is mainly meant for user preferences and should not
- * be used by applications e.g. for drawing attention to their
- * dialogs.
- **/
-void
-gtk_window_set_keep_below (GtkWindow *window,
- gboolean setting)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
- g_return_if_fail (GTK_IS_WINDOW (window));
-
- setting = setting != FALSE;
-
- priv->below_initially = setting;
- priv->above_initially &= !setting;
-
- if (priv->surface)
- gdk_toplevel_set_keep_below (GDK_TOPLEVEL (priv->surface), setting);
-}
-
/**
* gtk_window_set_resizable:
* @window: a #GtkWindow
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index c8db7dda96..4f0b4385b7 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -252,10 +252,6 @@ void gtk_window_fullscreen_on_monitor (GtkWindow *window,
GdkMonitor *monitor);
GDK_AVAILABLE_IN_ALL
void gtk_window_close (GtkWindow *window);
-GDK_AVAILABLE_IN_ALL
-void gtk_window_set_keep_above (GtkWindow *window, gboolean setting);
-GDK_AVAILABLE_IN_ALL
-void gtk_window_set_keep_below (GtkWindow *window, gboolean setting);
/* Set initial default size of the window (does not constrain user
* resize operations)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]