wok-next view openbox/stuff/patches/d9a405e9.patch @ rev 21727

created recipe for vbindiff
author Hans-G?nter Theisgen
date Sat Nov 21 14:32:44 2020 +0100 (2020-11-21)
parents
children
line source
1 From d9a405e9b3b0e9bfe5686c6df456138b443d1e35 Mon Sep 17 00:00:00 2001
2 From: Mikael Magnusson <mikachu@gmail.com>
3 Date: Mon, 7 Sep 2015 00:24:03 +0200
4 Subject: [PATCH] Add 'last' as a desktop target for if/foreach
6 ---
7 openbox/actions/if.c | 7 ++++++-
8 1 file changed, 6 insertions(+), 1 deletion(-)
10 diff --git a/openbox/actions/if.c b/openbox/actions/if.c
11 index a9c4094..c76fb71 100644
12 --- a/openbox/actions/if.c
13 +++ b/openbox/actions/if.c
14 @@ -68,6 +68,7 @@ typedef struct {
15 gboolean omnipresent_off;
16 gboolean desktop_current;
17 gboolean desktop_other;
18 + gboolean desktop_last;
19 guint desktop_number;
20 guint screendesktop_number;
21 guint client_monitor;
22 @@ -192,8 +193,10 @@ static void setup_query(Options* o, xmlNodePtr node, QueryTarget target) {
23 if ((s = obt_xml_node_string(n))) {
24 if (!g_ascii_strcasecmp(s, "current"))
25 q->desktop_current = TRUE;
26 - if (!g_ascii_strcasecmp(s, "other"))
27 + else if (!g_ascii_strcasecmp(s, "other"))
28 q->desktop_other = TRUE;
29 + else if (!g_ascii_strcasecmp(s, "last"))
30 + q->desktop_last = TRUE;
31 else
32 q->desktop_number = atoi(s);
33 g_free(s);
34 @@ -392,6 +395,8 @@ static gboolean run_func_if(ObActionsData *data, gpointer options)
35 is_true &= is_on_current_desktop;
36 if (q->desktop_other)
37 is_true &= !is_on_current_desktop;
38 + if (q->desktop_last)
39 + is_true &= query_target->desktop == screen_last_desktop;
41 if (q->desktop_number) {
42 gboolean is_on_desktop =
43 --
44 1.9.1