[gtk/present-toplevel-2: 42/79] toplevel: Add lower api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/present-toplevel-2: 42/79] toplevel: Add lower api
- Date: Mon, 9 Mar 2020 15:35:06 +0000 (UTC)
commit e9c729f98122389ed94b6df58fce42f43aac5efd
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Mar 4 16:49:28 2020 -0800
toplevel: Add lower api
Just like minimize, this is somewhat separate from presenting.
gdk/gdktoplevel.c | 25 +++++++++++++++++++++++++
gdk/gdktoplevel.h | 3 +++
gdk/gdktoplevelprivate.h | 1 +
3 files changed, 29 insertions(+)
---
diff --git a/gdk/gdktoplevel.c b/gdk/gdktoplevel.c
index 82114fefad..f0f00eeb6b 100644
--- a/gdk/gdktoplevel.c
+++ b/gdk/gdktoplevel.c
@@ -52,6 +52,12 @@ gdk_toplevel_default_minimize (GdkToplevel *toplevel)
return FALSE;
}
+static gboolean
+gdk_toplevel_default_lower (GdkToplevel *toplevel)
+{
+ return FALSE;
+}
+
static void
gdk_toplevel_default_focus (GdkToplevel *toplevel,
guint32 timestamp)
@@ -70,6 +76,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
{
iface->present = gdk_toplevel_default_present;
iface->minimize = gdk_toplevel_default_minimize;
+ iface->lower = gdk_toplevel_default_lower;
iface->focus = gdk_toplevel_default_focus;
iface->show_window_menu = gdk_toplevel_default_show_window_menu;
@@ -199,6 +206,24 @@ gdk_toplevel_minimize (GdkToplevel *toplevel)
return GDK_TOPLEVEL_GET_IFACE (toplevel)->minimize (toplevel);
}
+/**
+ * gdk_toplevel_lower:
+ * @toplevel: a #GdkToplevel
+ *
+ * Asks to lower the @toplevel below other windows.
+ *
+ * The windowing system may choose to ignore the request.
+ *
+ * Returns: %TRUE if the surface was lowered
+ */
+gboolean
+gdk_toplevel_lower (GdkToplevel *toplevel)
+{
+ g_return_val_if_fail (GDK_IS_TOPLEVEL (toplevel), FALSE);
+
+ return GDK_TOPLEVEL_GET_IFACE (toplevel)->lower (toplevel);
+}
+
/**
* gdk_toplevel_focus:
* @toplevel: a #GdkToplevel
diff --git a/gdk/gdktoplevel.h b/gdk/gdktoplevel.h
index 800d9cdff3..871dbe2ab3 100644
--- a/gdk/gdktoplevel.h
+++ b/gdk/gdktoplevel.h
@@ -43,6 +43,9 @@ gboolean gdk_toplevel_present (GdkToplevel *toplevel,
GDK_AVAILABLE_IN_ALL
gboolean gdk_toplevel_minimize (GdkToplevel *toplevel);
+GDK_AVAILABLE_IN_ALL
+gboolean gdk_toplevel_lower (GdkToplevel *toplevel);
+
GDK_AVAILABLE_IN_ALL
void gdk_toplevel_focus (GdkToplevel *toplevel,
guint32 timestamp);
diff --git a/gdk/gdktoplevelprivate.h b/gdk/gdktoplevelprivate.h
index 062814776b..7460ee258f 100644
--- a/gdk/gdktoplevelprivate.h
+++ b/gdk/gdktoplevelprivate.h
@@ -15,6 +15,7 @@ struct _GdkToplevelInterface
int height,
GdkToplevelLayout *layout);
gboolean (* minimize) (GdkToplevel *toplevel);
+ gboolean (* lower) (GdkToplevel *toplevel);
void (* focus) (GdkToplevel *toplevel,
guint32 timestamp);
gboolean (* show_window_menu) (GdkToplevel *toplevel,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]