Skip to content

Commit

Permalink
Do not lauch FullScreen :
Browse files Browse the repository at this point in the history
- Requires to do -W for fullscreen or -w for windowed.
- FIX required for detecting jail (default fullscreen was nice).
  • Loading branch information
Charles de Noyelle committed Apr 9, 2020
1 parent bfef1db commit 55ce2a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
#include <string>

// See CHANGELOG for a list of what has changed between versions
static const std::string LinthesiaVersionString = "0.6.6";
static const std::string LinthesiaVersionString = "0.6.6h";

#endif // __LINTHESIA_VERSION_H__
10 changes: 8 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ int main(int argc, char *argv[]) {
file_opt = string(getCmdOption(argv, argv + argc, "-f"));

// TODO: parse from command line args
bool fullscreen = !cmdOptionExists(argv, argv+argc, "-w");
bool windowed = cmdOptionExists(argv, argv+argc, "-w");
bool fullscreen = cmdOptionExists(argv, argv+argc, "-W");

// strip any leading or trailing quotes from the filename
// argument (to match the format returned by the open-file
Expand Down Expand Up @@ -494,7 +495,12 @@ int main(int argc, char *argv[]) {

window.set_icon_from_file(GRAPHDIR + std::string("/linthesia.png"));

if (fullscreen) {
// Lauch fullscreen if asked for it OR if neither fullllscreen and windowed is asked AND we are not in jail.
bool injail = true; // FIXME : how to detect we are injail without doing something nasty ?
// Jail is launched by AppImage, within :
// firejail --quiet --noprofile --net=none --appimage ./"$FILENAME" &

if (fullscreen || ( (!windowed && !fullscreen) && (!injail ) ) ) {
window.fullscreen();
}
else {
Expand Down

0 comments on commit 55ce2a5

Please sign in to comment.