[gtk/present-toplevel-2: 45/79] toplevel: Add wm properties
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/present-toplevel-2: 45/79] toplevel: Add wm properties
- Date: Mon, 9 Mar 2020 15:35:22 +0000 (UTC)
commit 869b8348a9f81ca67cdb83c26fe999dd656e239f
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Mar 3 12:19:24 2020 -0800
toplevel: Add wm properties
Add "decorated" and "deletable" properties. This is
just what we are using mwm hints for in some places.
gdk/gdktoplevel.c | 32 ++++++++++++++++++++++++++++++++
gdk/gdktoplevel.h | 8 ++++++++
gdk/gdktoplevelprivate.h | 2 ++
3 files changed, 42 insertions(+)
---
diff --git a/gdk/gdktoplevel.c b/gdk/gdktoplevel.c
index f0f00eeb6b..6b52870b2e 100644
--- a/gdk/gdktoplevel.c
+++ b/gdk/gdktoplevel.c
@@ -139,6 +139,18 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
"Whether the surface should receive keyboard focus on map",
TRUE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
+ g_object_interface_install_property (iface,
+ g_param_spec_boolean ("decorated",
+ "Decorated",
+ "Decorated",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
+ g_object_interface_install_property (iface,
+ g_param_spec_boolean ("deletable",
+ "Deletable",
+ "Deletable",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
}
guint
@@ -155,6 +167,8 @@ gdk_toplevel_install_properties (GObjectClass *object_class,
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_KEEP_BELOW, "keep-below");
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS,
"accept-focus");
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
"focus-on-map");
+ g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_DECORATED, "decorated");
+ g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_DELETABLE, "deletable");
return GDK_TOPLEVEL_NUM_PROPERTIES;
}
@@ -452,3 +466,21 @@ gdk_toplevel_set_focus_on_map (GdkToplevel *toplevel,
g_object_set (toplevel, "focus-on-map", focus_on_map, NULL);
}
+
+void
+gdk_toplevel_set_decorated (GdkToplevel *toplevel,
+ gboolean decorated)
+{
+ g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
+
+ g_object_set (toplevel, "decorated", decorated, NULL);
+}
+
+void
+gdk_toplevel_set_deletable (GdkToplevel *toplevel,
+ gboolean deletable)
+{
+ g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
+
+ g_object_set (toplevel, "deletable", deletable, NULL);
+}
diff --git a/gdk/gdktoplevel.h b/gdk/gdktoplevel.h
index 871dbe2ab3..6b6b31506f 100644
--- a/gdk/gdktoplevel.h
+++ b/gdk/gdktoplevel.h
@@ -91,6 +91,14 @@ void gdk_toplevel_set_accept_focus (GdkToplevel *toplevel,
GDK_AVAILABLE_IN_ALL
void gdk_toplevel_set_focus_on_map (GdkToplevel *toplevel,
gboolean focus_on_map);
+
+GDK_AVAILABLE_IN_ALL
+void gdk_toplevel_set_decorated (GdkToplevel *toplevel,
+ gboolean decorated);
+
+GDK_AVAILABLE_IN_ALL
+void gdk_toplevel_set_deletable (GdkToplevel *toplevel,
+ gboolean deletable);
G_END_DECLS
#endif /* __GDK_TOPLEVEL_H__ */
diff --git a/gdk/gdktoplevelprivate.h b/gdk/gdktoplevelprivate.h
index 7460ee258f..71e9c348d0 100644
--- a/gdk/gdktoplevelprivate.h
+++ b/gdk/gdktoplevelprivate.h
@@ -33,6 +33,8 @@ typedef enum {
GDK_TOPLEVEL_PROP_KEEP_BELOW,
GDK_TOPLEVEL_PROP_ACCEPT_FOCUS,
GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
+ GDK_TOPLEVEL_PROP_DECORATED,
+ GDK_TOPLEVEL_PROP_DELETABLE,
GDK_TOPLEVEL_NUM_PROPERTIES
} GdkToplevelProperties;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]