qulogic/libgnt
Clone
Summary
Browse
Changes
Graph
Add getter for GntWindow struct members.
2019-04-06, Elliott Sales de Andrade
328db5deb656
Parents
19966e8db87f
Children
5b431ad68d48
Add getter for GntWindow struct members.
3 files changed, 21 insertions(+), 1 deletions(-)
+8
-0
gntwindow.c
+12
-0
gntwindow.h
+1
-1
gntwm.c
--- a/gntwindow.c Sat Apr 06 05:40:21 2019 -0400
+++ b/gntwindow.c Sat Apr 06 06:05:21 2019 -0400
@@ -177,6 +177,14 @@
}
}
+GntMenu *
+gnt_window_get_menu(GntWindow *window)
+{
+ g_return_val_if_fail(GNT_IS_WINDOW(window), NULL);
+
+ return window->menu;
+}
+
const char * gnt_window_get_accel_item(GntWindow *window, const char *key)
{
GntWindowPrivate *priv = gnt_window_get_instance_private(window);
--- a/gntwindow.h Sat Apr 06 05:40:21 2019 -0400
+++ b/gntwindow.h Sat Apr 06 06:05:21 2019 -0400
@@ -110,6 +110,18 @@
void gnt_window_set_menu(GntWindow *window, GntMenu *menu);
/**
+ * gnt_window_get_menu:
+ * @window: The window.
+ *
+ * Get the menu for a window.
+ *
+ * Returns: (transfer none) (nullable): The menu for the window.
+ *
+ * Since: 2.14.0
+ */
+GntMenu *gnt_window_get_menu(GntWindow *window);
+
+/**
* gnt_window_get_accel_item:
* @window: The window.
* @key: The keystroke.
--- a/gntwm.c Sat Apr 06 05:40:21 2019 -0400
+++ b/gntwm.c Sat Apr 06 06:05:21 2019 -0400
@@ -2011,7 +2011,7 @@
else if (wm->cws->ordered) {
GntWidget *win = wm->cws->ordered->data;
if (GNT_IS_WINDOW(win)) {
- GntMenu *menu = GNT_WINDOW(win)->menu;
+ GntMenu *menu = gnt_window_get_menu(GNT_WINDOW(win));
if (menu) {
const char *id = gnt_window_get_accel_item(GNT_WINDOW(win), keys);
if (id) {