[gtk/present-toplevel-2: 62/70] toplevel: Add wm properties
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/present-toplevel-2: 62/70] toplevel: Add wm properties
- Date: Wed, 4 Mar 2020 00:10:41 +0000 (UTC)
commit 2274ebd23342343e62e863c0d7a9eba4206a1fa9
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Mar 3 12:19:24 2020 -0800
toplevel: Add wm properties
Add properties for decorations and functions.
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 82114fefad..733151a2c1 100644
--- a/gdk/gdktoplevel.c
+++ b/gdk/gdktoplevel.c
@@ -132,6 +132,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_flags ("decorations",
+ "Decorations",
+ "Decorations",
+ GDK_TYPE_WM_DECORATION, 0,
+ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
+ g_object_interface_install_property (iface,
+ g_param_spec_flags ("functions",
+ "Functions",
+ "Functions",
+ GDK_TYPE_WM_FUNCTION, 0,
+ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
}
guint
@@ -148,6 +160,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_DECORATIONS, "decorations");
+ g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_FUNCTIONS, "functions");
return GDK_TOPLEVEL_NUM_PROPERTIES;
}
@@ -427,3 +441,21 @@ gdk_toplevel_set_focus_on_map (GdkToplevel *toplevel,
g_object_set (toplevel, "focus-on-map", focus_on_map, NULL);
}
+
+void
+gdk_toplevel_set_decorations (GdkToplevel *toplevel,
+ GdkWMDecoration decorations)
+{
+ g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
+
+ g_object_set (toplevel, "decorations", decorations, NULL);
+}
+
+void
+gdk_toplevel_set_functions (GdkToplevel *toplevel,
+ GdkWMFunction functions)
+{
+ g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
+
+ g_object_set (toplevel, "functions", functions, NULL);
+}
diff --git a/gdk/gdktoplevel.h b/gdk/gdktoplevel.h
index 800d9cdff3..0c5323f3bc 100644
--- a/gdk/gdktoplevel.h
+++ b/gdk/gdktoplevel.h
@@ -88,6 +88,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_decorations (GdkToplevel *toplevel,
+ GdkWMDecoration decorations);
+
+GDK_AVAILABLE_IN_ALL
+void gdk_toplevel_set_functions (GdkToplevel *toplevel,
+ GdkWMFunction functions);
G_END_DECLS
#endif /* __GDK_TOPLEVEL_H__ */
diff --git a/gdk/gdktoplevelprivate.h b/gdk/gdktoplevelprivate.h
index 062814776b..04be01e602 100644
--- a/gdk/gdktoplevelprivate.h
+++ b/gdk/gdktoplevelprivate.h
@@ -32,6 +32,8 @@ typedef enum {
GDK_TOPLEVEL_PROP_KEEP_BELOW,
GDK_TOPLEVEL_PROP_ACCEPT_FOCUS,
GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
+ GDK_TOPLEVEL_PROP_DECORATIONS,
+ GDK_TOPLEVEL_PROP_FUNCTIONS,
GDK_TOPLEVEL_NUM_PROPERTIES
} GdkToplevelProperties;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]