laamaa / m8c

Cross-platform M8 tracker headless client
Other
382 stars 81 forks source link

Fullscreen flag in config.ini not working #26

Closed sgoff closed 2 years ago

sgoff commented 2 years ago

I'm getting my headless M8 up and running on a raspberry pi, with the intent of having a fully standalone unit. In pursuit of this, I have set up the m8c application to run at startup, and I'm trying to find a way to get it to start automatically in fullscreen mode, as the display I'm using is a Hyper Pixel 4 inch display that hangs off the GPIO on the host Pi, and screen real estate is limited. I have tried changing the fullscreen flag to true in m8c's config.ini, which didn't work. Also tried changing the c.init_fullscreen variable in config.c to "1", with no luck, either. Additionally, I have tried executing m8c with flags from the command line (-fs, -maximize, -fullscreen; all with both one and two dashes preceeding), which had no effect.

Any thoughts on how I can get m8c to start up in fullscreen when starting the application from a linux autostart .desktop entry? Thanks so much for making this project available! Loving my headless m8, so far :-D

sgoff commented 2 years ago

Oh, I should add: when opening m8c by double clicking the executable and selecting "execute" on the window that pops up, it does open in fullscreen mode. Also, opening m8c using the command line when in the install directory (in my case /home/pi/code/m8c) respects the config.ini fullscreen flag. But, for some reason, opening it from the command line from any other directory does not respect the fullscreen entry in config.ini. And, nor does opening the program using the autostart .desktop entry, even though the full path to the executable is included in the entry.

laamaa commented 2 years ago

Are you starting the program from the directory that contains config.ini? You could also force fullscreen start by changing line 64 in main.c to say …initialize_sdl(1)… instead of initialize_sdl(conf.init_fullscreen) in case you can't set the working directory for the shortcut launch

On Sun 21. Nov 2021 at 21.57, sgoff @.***> wrote:

Oh, I should add: when opening m8c by double clicking the executable and selecting "execute" on the window that pops up, it does open in fullscreen mode. For some reason, opening it from the command line (and from the the autostart .desktop entry, which essentially opens m8c from the command line, from my understanding) does not respect or read the fullscreen entry in config.ini.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/laamaa/m8c/issues/26#issuecomment-974884762, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNUYFRT3OLHDQ7XXX3RO3LUNFFLLANCNFSM5IPQBJ7Q .

laamaa commented 2 years ago

This problem is most likely due to the program not finding config.ini in the directory where the program is started. m8c currently needs to be started inside the directory with config.ini for it work. This is something that will be addressed in future updates, I'll close this issue for now.

...for the .desktop file, you can edit it in a text editor to have something like this for the program to start in the correct directory:

Exec=bash -c 'cd /home/pi/code/m8c && ./m8c'