Skip to content

Commit

Permalink
Replace flatpak define with runtime test, should make reproducible bu…
Browse files Browse the repository at this point in the history
…ilds work better (except I don't have that configured, but maybe one of my users do.)
  • Loading branch information
Alcaro committed Apr 14, 2020
1 parent 304815c commit 6ae40f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion flatpak/com.github.Alcaro.Flips.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"name" : "flips",
"buildsystem" : "simple",
"build-commands": [
"sh make.sh --cflags=-DFLATPAK",
"sh make.sh",
"make install PREFIX=/app"
],
"sources" : [
Expand Down
13 changes: 7 additions & 6 deletions flips-gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ filemap* filemap::create(const char * filename)

static bool canShowGUI;
static GtkWidget* window;
static bool isFlatpak;

//struct {
// char signature[9];
Expand Down Expand Up @@ -700,15 +701,14 @@ static void a_ApplyRun(GtkButton* widget, gpointer user_data)
g_free(romname);
}

#ifdef FLATPAK
static void flatpakDisable(GtkWidget* widget)
{
gtk_widget_set_sensitive(widget, false);
gtk_widget_set_tooltip_text(widget, "Running in emulators is not available in Flatpak");
if (isFlatpak)
{
gtk_widget_set_sensitive(widget, false);
gtk_widget_set_tooltip_text(widget, "Running in emulators is not available in Flatpak");
}
}
#else
static void flatpakDisable(GtkWidget* widget) {}
#endif

static void a_SetEmulator(GtkButton* widget, gpointer user_data);
static void a_ShowSettings(GtkButton* widget, gpointer user_data)
Expand Down Expand Up @@ -1045,6 +1045,7 @@ int main(int argc, char * argv[])
{
g_set_prgname("com.github.Alcaro.Flips");
canShowGUI = gtk_parse_args(&argc, &argv);
isFlatpak = (access("/.flatpak-info", F_OK) == 0);
cfg.init_file(g_build_filename(g_get_user_config_dir(), "flipscfg", NULL));
return flipsmain(argc, argv);
}
Expand Down

0 comments on commit 6ae40f0

Please sign in to comment.