From a163f2b5431ab8b274e7ac2e4b7dbf2299675905 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 8 Oct 2015 19:33:33 +0200 Subject: Add fullscreen bg to printergui; preserve job name --- src/pwgui/main.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/pwgui/main.cpp') diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp index edd594c..5dd5a07 100644 --- a/src/pwgui/main.cpp +++ b/src/pwgui/main.cpp @@ -282,13 +282,21 @@ static int run_backend(char *backend, char *uri, char *jobid, char *user, char * } } setenv("DEVICE_URI", uri, 1); - ERROR("DEVICE_URI: '%s'", uri); + char *args[8]; args[0] = uri; args[1] = jobid; args[2] = user; - args[3] = title; + // Fix job title if possible + if (strncmp(title, "gui-", 4) == 0) { + args[3] = strchr(title, ' '); + if (args[3] == NULL) { + args[3] = title; + } + } else { + args[3] = title; + } args[4] = copies; args[5] = options; args[6] = file; @@ -316,7 +324,7 @@ static int run_backend(char *backend, char *uri, char *jobid, char *user, char * if (strstr(buffer, "Unable to get printer status (Unauthorized)") != NULL) { needAuth = true; if (kill(pid, SIGTERM) < 0) { - ERROR("Sending SIGTERM to backend %d failed: %d\n", (int)pid, errno); + ERROR("Sending SIGTERM to backend %d failed: %d\n", (int)pid, (int)errno); } break; } else if (strstr(buffer, "Destination printer does not exist") != NULL) { -- cgit v1.2.3-55-g7522