From: c vw Date: Thu, 5 Dec 2019 09:42:56 +0000 (+0100) Subject: Go to window mode only if there is enough space X-Git-Url: https://git.rkrishnan.org/listings/vdrive/index.php?a=commitdiff_plain;h=5f501ec0109ebcfcd3890511a62b0ef6e60c4d46;p=pihpsdr.git Go to window mode only if there is enough space --- diff --git a/main.c b/main.c index bed1b68..ded7365 100644 --- a/main.c +++ b/main.c @@ -216,7 +216,10 @@ static void activate_pihpsdr(GtkApplication *app, gpointer data) { fprintf(stderr,"width=%d height=%d\n", display_width, display_height); - if(display_width>MAX_DISPLAY_WIDTH || display_height>MAX_DISPLAY_HEIGHT) { + // Go to "window" mode if there is enough space on the screen. + // Do not forget extra space needed for window top bars, screen bars etc. + + if(display_width>(MAX_DISPLAY_WIDTH+10) && display_height>(MAX_DISPLAY_HEIGHT+30)) { display_width=MAX_DISPLAY_WIDTH; display_height=MAX_DISPLAY_HEIGHT; full_screen=0;