From 1004a41f5d9db6df273d8d3d4bd87dbd4272f10b Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Sat, 8 Feb 2020 14:54:17 +0100 Subject: [PATCH] gtk: Disable bits not available in Flatpak When the FLATPAK macro is defined, this disables bits of the UI for features which won't work in a heavily sandboxed environment. --- flips-gtk.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flips-gtk.cpp b/flips-gtk.cpp index a047073..d015a2d 100644 --- a/flips-gtk.cpp +++ b/flips-gtk.cpp @@ -994,6 +994,10 @@ int GUIShow(const char * filename) button(0,0, "_Apply Patch", G_CALLBACK(a_ApplyPatch)); button(1,0, "_Create Patch", G_CALLBACK(a_CreatePatch)); button(0,1, "Apply and _Run", G_CALLBACK(a_ApplyRun)); +#ifdef FLATPAK + gtk_widget_set_sensitive(button, false); + gtk_widget_set_tooltip_text(button, "Running in emulators is not available in Flatpak"); +#endif button(1,1, "_Settings", G_CALLBACK(a_ShowSettings)); #undef button