Skip to content

Commit

Permalink
switcher: check switcher-status-report-enabled property to determine
Browse files Browse the repository at this point in the history
policy of whether or not to respond to CTRL+ALT+R when pressed.

OXT-335

Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
  • Loading branch information
Chris Patterson committed Jul 21, 2015
1 parent c9a28eb commit 57bd94b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include "project.h"

#include "rpcgen/xenmgr_client.h"

static struct domain *current, *surface_current;

Expand Down Expand Up @@ -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];
Expand All @@ -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);
Expand Down

0 comments on commit 57bd94b

Please sign in to comment.