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;
static int width = DEFAULT_WIDTH, height = DEFAULT_HEIGHT,
meter_scale = DEFAULT_METER_SCALE;
static Uint32 video_flags = SDL_RESIZABLE;
static float scale = DEFAULT_SCALE;
static pthread_t ph;
static struct selector selector;
......@@ -1507,7 +1508,7 @@ static SDL_Surface* set_size(int w, int h, struct rect *r)
{
SDL_Surface *surface;
surface = SDL_SetVideoMode(w, h, 32, SDL_RESIZABLE);
surface = SDL_SetVideoMode(w, h, 32, video_flags);
if (surface == NULL) {
fprintf(stderr, "%s\n", SDL_GetError());
return NULL;
......@@ -1789,7 +1790,7 @@ static int parse_geometry(const char *s)
* error
*/
int interface_start(struct library *lib, const char *geo)
int interface_start(struct library *lib, const char *geo, bool decor)
{
size_t n;
......@@ -1798,6 +1799,9 @@ int interface_start(struct library *lib, const char *geo)
return -1;
}
if (!decor)
video_flags |= SDL_NOFRAME;
for (n = 0; n < ndeck; n++) {
if (timecoder_monitor_init(&deck[n].timecoder, zoom(SCOPE_SIZE)) == -1)
return -1;
......
......@@ -23,7 +23,7 @@
#include "deck.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();
#endif
......@@ -86,6 +86,13 @@ to SDL, which may use it to set the display mode, or size of an X window.
See the
.B EXAMPLES.
.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
Display the help message and default values.
.SH "ALSA DEVICE OPTIONS"
......
......@@ -80,6 +80,7 @@ static void usage(FILE *fd)
" -k Lock real-time memory into RAM\n"
" -q <n> Real-time priority (0 for no priority, default %d)\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",
DEFAULT_PRIORITY);
......@@ -184,7 +185,7 @@ int main(int argc, char *argv[])
int rc = -1, n, priority;
const char *scanner, *geo;
char *endptr;
bool use_mlock;
bool use_mlock, decor;
struct library library;
......@@ -212,6 +213,7 @@ int main(int argc, char *argv[])
ndeck = 0;
geo = "";
decor = true;
nctl = 0;
priority = DEFAULT_PRIORITY;
importer = DEFAULT_IMPORTER;
......@@ -501,6 +503,13 @@ int main(int argc, char *argv[])
argv += 2;
argc -= 2;
} else if (!strcmp(argv[0], "--no-decor")) {
decor = false;
argv++;
argc--;
} else if (!strcmp(argv[0], "-i")) {
/* Importer script for subsequent decks */
......@@ -601,7 +610,7 @@ int main(int argc, char *argv[])
goto out_rt;
}
if (interface_start(&library, geo) == -1)
if (interface_start(&library, geo, decor) == -1)
goto out_rt;
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