]>
Dogcows Code - chaz/openbox/blob - openbox/actions/layer.c
4a1cf651901d6023d3e3c745e9409b1f8cbea804
1 #include "openbox/actions.h"
2 #include "openbox/client.h"
5 gint layer
; /*!< -1 for below, 0 for normal, and 1 for above */
9 static gpointer
setup_func_top(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
);
10 static gpointer
setup_func_bottom(ObParseInst
*i
, xmlDocPtr doc
,
12 static gpointer
setup_func_send(ObParseInst
*i
, xmlDocPtr doc
,
14 static gboolean
run_func(ObActionsData
*data
, gpointer options
);
16 void action_layer_startup()
18 actions_register("ToggleAlwaysOnTop", setup_func_top
, g_free
,
19 run_func_toggle
, NULL
, NULL
);
20 actions_register("ToggleAlwaysOnBottom", setup_func_bottom
, g_free
,
21 run_func_toggle
, NULL
, NULL
);
22 actions_register("SendToLayer", setup_func_send
, g_free
,
23 run_func_send
, NULL
, NULL
);
26 static gpointer
setup_func_top(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
)
28 Options
*o
= g_new0(Options
, 1);
33 static gpointer
setup_func_bottom(ObParseInst
*i
, xmlDocPtr doc
,
36 Options
*o
= g_new0(Options
, 1);
41 static gpointer
setup_func_send(ObParseInst
*i
, xmlDocPtr doc
,
47 o
= g_new0(Options
, 1);
50 if ((n
= parse_find_node("layer", node
))) {
51 gchar
*s
= parse_string(doc
, n
);
52 if (!g_ascii_strcasecmp(s
, "above") ||
53 !g_ascii_strcasecmp(s
, "top"))
55 else if (!g_ascii_strcasecmp(s
, "below") ||
56 !g_ascii_strcasecmp(s
, "bottom"))
58 else if (!g_ascii_strcasecmp(s
, "normal") ||
59 !g_ascii_strcasecmp(s
, "middle"))
67 /* Always return FALSE because its not interactive */
68 static gboolean
run_func(ObActionsData
*data
, gpointer options
)
73 ObClient
*c
= data
->client
;
75 actions_client_move(data
, TRUE
);
78 if (o
->toggle
|| !c
->below
)
79 client_set_layer(c
, c
->below
? 0 : -1);
81 else if (o
->layer
> 0) {
82 if (o
->toggle
|| !c
->above
)
83 client_set_layer(c
, c
->above
? 0 : 1);
85 else if (c
->above
|| c
->below
)
86 client_set_layer(c
, 0);
88 actions_client_move(data
, FALSE
);
This page took 0.040089 seconds and 4 git commands to generate.