Commit 29bec72e authored by Mark Hills's avatar Mark Hills
Browse files

Implement an option to remove window decorations

As well as clarity to the implementation there is some flexibilty here
if we might wish to control other video flags.
parent 3926905a
...@@ -167,6 +167,7 @@ static unsigned short *spinner_angle, spinner_size; ...@@ -167,6 +167,7 @@ static unsigned short *spinner_angle, spinner_size;
static int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT, static int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT,
meter_scale = DEFAULT_METER_SCALE; meter_scale = DEFAULT_METER_SCALE;
static Uint32 video_flags = SDL_RESIZABLE;
static float scale = DEFAULT_SCALE; static float scale = DEFAULT_SCALE;
static pthread_t ph; static pthread_t ph;
static struct selector selector; static struct selector selector;
...@@ -1507,7 +1508,7 @@ static SDL_Surface* set_size(int w, int h, struct rect *r) ...@@ -1507,7 +1508,7 @@ static SDL_Surface* set_size(int w, int h, struct rect *r)
{ {
SDL_Surface *surface; SDL_Surface *surface;
surface = SDL_SetVideoMode(w, h, 32, SDL_RESIZABLE); surface = SDL_SetVideoMode(w, h, 32, video_flags);
if (surface == NULL) { if (surface == NULL) {
fprintf(stderr, "%s\n", SDL_GetError()); fprintf(stderr, "%s\n", SDL_GetError());
return NULL; return NULL;
...@@ -1789,7 +1790,7 @@ static int parse_geometry(const char *s) ...@@ -1789,7 +1790,7 @@ static int parse_geometry(const char *s)
* error * error
*/ */
int interface_start(struct library *lib, const char *geo) int interface_start(struct library *lib, const char *geo, bool decor)
{ {
size_t n; size_t n;
...@@ -1798,6 +1799,9 @@ int interface_start(struct library *lib, const char *geo) ...@@ -1798,6 +1799,9 @@ int interface_start(struct library *lib, const char *geo)
return -1; return -1;
} }
if (!decor)
video_flags |= SDL_NOFRAME;
for (n = 0; n < ndeck; n++) { for (n = 0; n < ndeck; n++) {
if (timecoder_monitor_init(&deck[n].timecoder, zoom(SCOPE_SIZE)) == -1) if (timecoder_monitor_init(&deck[n].timecoder, zoom(SCOPE_SIZE)) == -1)
return -1; return -1;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "deck.h" #include "deck.h"
#include "library.h" #include "library.h"
int interface_start(struct library *lib, const char *geo); int interface_start(struct library *lib, const char *geo, bool decor);
void interface_stop(); void interface_stop();
#endif #endif
...@@ -86,6 +86,13 @@ to SDL, which may use it to set the display mode, or size of an X window. ...@@ -86,6 +86,13 @@ to SDL, which may use it to set the display mode, or size of an X window.
See the See the
.B EXAMPLES. .B EXAMPLES.
.TP .TP
.B \-\-no\-decor
Request to the window manager to create a 'frameless' window which
does not have the regular controls such as title bars and buttons.
This can be useful in conjunction with the
.B \-g
flag for dedicated xwax installations.
.TP
.B \-h .B \-h
Display the help message and default values. Display the help message and default values.
.SH "ALSA DEVICE OPTIONS" .SH "ALSA DEVICE OPTIONS"
......
...@@ -80,6 +80,7 @@ static void usage(FILE *fd) ...@@ -80,6 +80,7 @@ static void usage(FILE *fd)
" -k Lock real-time memory into RAM\n" " -k Lock real-time memory into RAM\n"
" -q <n> Real-time priority (0 for no priority, default %d)\n" " -q <n> Real-time priority (0 for no priority, default %d)\n"
" -g <s> Set display geometry (see man page)\n" " -g <s> Set display geometry (see man page)\n"
" --no-decor Request a window with no decorations\n"
" -h Display this message to stdout and exit\n\n", " -h Display this message to stdout and exit\n\n",
DEFAULT_PRIORITY); DEFAULT_PRIORITY);
...@@ -184,7 +185,7 @@ int main(int argc, char *argv[]) ...@@ -184,7 +185,7 @@ int main(int argc, char *argv[])
int rc = -1, n, priority; int rc = -1, n, priority;
const char *scanner, *geo; const char *scanner, *geo;
char *endptr; char *endptr;
bool use_mlock; bool use_mlock, decor;
struct library library; struct library library;
...@@ -212,6 +213,7 @@ int main(int argc, char *argv[]) ...@@ -212,6 +213,7 @@ int main(int argc, char *argv[])
ndeck = 0; ndeck = 0;
geo = ""; geo = "";
decor = true;
nctl = 0; nctl = 0;
priority = DEFAULT_PRIORITY; priority = DEFAULT_PRIORITY;
importer = DEFAULT_IMPORTER; importer = DEFAULT_IMPORTER;
...@@ -501,6 +503,13 @@ int main(int argc, char *argv[]) ...@@ -501,6 +503,13 @@ int main(int argc, char *argv[])
argv += 2; argv += 2;
argc -= 2; argc -= 2;
} else if (!strcmp(argv[0], "--no-decor")) {
decor = false;
argv++;
argc--;
} else if (!strcmp(argv[0], "-i")) { } else if (!strcmp(argv[0], "-i")) {
/* Importer script for subsequent decks */ /* Importer script for subsequent decks */
...@@ -601,7 +610,7 @@ int main(int argc, char *argv[]) ...@@ -601,7 +610,7 @@ int main(int argc, char *argv[])
goto out_rt; goto out_rt;
} }
if (interface_start(&library, geo) == -1) if (interface_start(&library, geo, decor) == -1)
goto out_rt; goto out_rt;
if (rig_main() == -1) if (rig_main() == -1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment