summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2011-07-29 20:37:39 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2011-07-29 20:44:54 -0400
commit126ed568fd60b518af16d0d63fa8980835dce0a3 (patch)
tree5b85e8271b856124c23cca696749cbcc8fba8d50 /src
parentb178ebb5bd45d729aee617cc807bae345d5c7e29 (diff)
Add display switching to the local socket debugging interface.
Allows programmatic switching of the display to a specific domain, server screen, or combined desktop screen.
Diffstat (limited to 'src')
-rw-r--r--src/debug.c3
-rw-r--r--src/display.c4
-rw-r--r--src/display.h7
-rw-r--r--src/local.c26
-rw-r--r--src/local.h1
5 files changed, 37 insertions, 4 deletions
diff --git a/src/debug.c b/src/debug.c
index 86889d5..2781d85 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -39,7 +39,8 @@ usage(void)
{
bail("Usage: linpicker-cli <code> [param...]\n\t"
"0 - Dump views\n\t"
- "1 <domid> <sak> - Register SAK");
+ "1 <domid> <sak> - Register SAK\n\t"
+ "2 <domid|-1|-2> - Switch displays");
}
int
diff --git a/src/display.c b/src/display.c
index 7ae89f2..511430e 100644
--- a/src/display.c
+++ b/src/display.c
@@ -57,8 +57,8 @@
#include "sak.h"
#include "sclient.h"
-static struct display *desktop_display; /* display for the combined desktop */
struct display *server_display; /* display for the server itself */
+struct display *desktop_display; /* display for the combined desktop */
struct display *active_display; /* currently active display */
static struct view_list thumbs; /* global list of thumbnails */
@@ -507,7 +507,7 @@ display_buffer_remove(struct buffer *b)
free(d);
}
-int
+static int
init_graphics(int *argc, char ***argv)
{
DFBDisplayLayerConfig dl_config;
diff --git a/src/display.h b/src/display.h
index f48b619..4574ba7 100644
--- a/src/display.h
+++ b/src/display.h
@@ -65,8 +65,10 @@ struct display {
CIRCLEQ_HEAD(display_cirq, display);
-extern struct display *active_display;
extern struct display *server_display;
+extern struct display *desktop_display;
+extern struct display *active_display;
+
extern IDirectFB *dfb;
extern IDirectFBDisplayLayer *dl;
@@ -83,6 +85,9 @@ void
display_secure_leave(void);
void
+display_switch(struct display *d);
+
+void
display_update_mouselabel(struct display *d, struct client *client);
void
diff --git a/src/local.c b/src/local.c
index 36f1bbe..c3b24f0 100644
--- a/src/local.c
+++ b/src/local.c
@@ -58,6 +58,29 @@ local_set_sak(struct local_message *msg)
}
static void
+local_switch(struct local_message *msg)
+{
+ struct buffer *b;
+ struct display *d;
+
+ switch (msg->param1) {
+ case -1:
+ d = server_display;
+ break;
+ case -2:
+ d = desktop_display;
+ break;
+ default:
+ b = buffer_lookup(msg->param1, 0);
+ d = b ? b->bg_view->display : server_display;
+ break;
+ }
+
+ display_switch(d);
+ display_update_seclabel(d);
+}
+
+static void
local_process(void *closure)
{
struct local_message msg;
@@ -79,6 +102,9 @@ local_process(void *closure)
case LINPICKER_LOCAL_SET_SAK:
local_set_sak(&msg);
break;
+ case LINPICKER_LOCAL_SWITCH:
+ local_switch(&msg);
+ break;
default:
break;
}
diff --git a/src/local.h b/src/local.h
index 1e6c5eb..dfcce59 100644
--- a/src/local.h
+++ b/src/local.h
@@ -21,6 +21,7 @@
/* Messages accepted over the socket */
#define LINPICKER_LOCAL_DUMP_VIEWS 0
#define LINPICKER_LOCAL_SET_SAK 1
+#define LINPICKER_LOCAL_SWITCH 2
struct local_message {
uint32_t type;