From 57bd94bd3ac421cacd0c24f30fdc4492fb2677f0 Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Tue, 21 Jul 2015 12:26:49 -0400 Subject: [PATCH] switcher: check switcher-status-report-enabled property to determine policy of whether or not to respond to CTRL+ALT+R when pressed. OXT-335 Signed-off-by: Chris Patterson --- switch.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/switch.c b/switch.c index 712de00..f7ab996 100644 --- a/switch.c +++ b/switch.c @@ -17,7 +17,7 @@ */ #include "project.h" - +#include "rpcgen/xenmgr_client.h" static struct domain *current, *surface_current; @@ -373,6 +373,20 @@ static int report_window_shown() return r; } +static gboolean +switcher_status_report_enabled(void) +{ + gboolean enabled = TRUE; + + if (!property_get_com_citrix_xenclient_xenmgr_config_ui_switcher_status_report_enabled_( + xcbus_conn, "com.citrix.xenclient.xenmgr", "/", &enabled)) { + warning("failed to get status report property!"); + return TRUE; + } + + return enabled; +} + static int switcher_status_report (void *opaque) { char path[256]; @@ -381,6 +395,8 @@ static int switcher_status_report (void *opaque) return 0; if (auth_window_shown() || report_window_shown()) return 0; + if (!switcher_status_report_enabled()) + return 0; sprintf(path, "/local/domain/%d/report/state", d->domid); xenstore_write_int(1, path);