diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/debug.c | 3 | ||||
-rw-r--r-- | src/display.c | 4 | ||||
-rw-r--r-- | src/display.h | 7 | ||||
-rw-r--r-- | src/local.c | 26 | ||||
-rw-r--r-- | src/local.h | 1 |
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; |