]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Go to window mode only if there is enough space
authorc vw <dl1ycf@darc.de>
Thu, 5 Dec 2019 09:42:56 +0000 (10:42 +0100)
committerc vw <dl1ycf@darc.de>
Thu, 5 Dec 2019 09:42:56 +0000 (10:42 +0100)
main.c

diff --git a/main.c b/main.c
index bed1b68e80d3acf4ef99af611245ce1da9830322..ded7365d23e6cdd1b563ea1d5ca361ee74c67d08 100644 (file)
--- 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;