summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-12-18 09:29:37 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-12-18 09:29:37 +0100
commitb246b6650ab04cbdf3e258b5a75bf928fc46302c (patch)
treeef73c74ed8ec92d361376ed597fb82d6c9203ea0
parent993b7da3b513ecb33730ab76828e64dcb6b80115 (diff)
Fix "link errors connected with recent Zenity dialog feature" (#602)
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/Fl_Native_File_Chooser_GTK.cxx4
2 files changed, 8 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 43baa24d1..8994d63e3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -212,12 +212,12 @@ if (FLTK_USE_X11 AND NOT OPTION_USE_WAYLAND)
fl_dnd_x.cxx
Fl_Native_File_Chooser_FLTK.cxx
Fl_Native_File_Chooser_GTK.cxx
- Fl_Native_File_Chooser_Zenity.cxx
Fl_get_key.cxx
)
if (OPTION_USE_KDIALOG)
- set (DRIVER_FILES ${DRIVER_FILES} Fl_Native_File_Chooser_Kdialog.cxx)
+ set (DRIVER_FILES ${DRIVER_FILES} Fl_Native_File_Chooser_Kdialog.cxx
+ Fl_Native_File_Chooser_Zenity.cxx)
endif (OPTION_USE_KDIALOG)
if (FLTK_USE_CAIRO)
@@ -287,9 +287,11 @@ elseif (OPTION_USE_WAYLAND)
drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
Fl_Native_File_Chooser_FLTK.cxx
Fl_Native_File_Chooser_GTK.cxx
- Fl_Native_File_Chooser_Kdialog.cxx
- Fl_Native_File_Chooser_Zenity.cxx
)
+ if (OPTION_USE_KDIALOG)
+ set (DRIVER_FILES ${DRIVER_FILES} Fl_Native_File_Chooser_Kdialog.cxx
+ Fl_Native_File_Chooser_Zenity.cxx)
+ endif (OPTION_USE_KDIALOG)
if (FLTK_USE_X11)
list (APPEND DRIVER_FILES
drivers/Cairo/Fl_Display_Cairo_Graphics_Driver.cxx
diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx
index 98dbb5567..cbfe50440 100644
--- a/src/Fl_Native_File_Chooser_GTK.cxx
+++ b/src/Fl_Native_File_Chooser_GTK.cxx
@@ -17,8 +17,8 @@
#include <config.h>
#include <FL/Fl_Native_File_Chooser.H>
-#include "Fl_Native_File_Chooser_Zenity.H"
#if USE_KDIALOG
+# include "Fl_Native_File_Chooser_Zenity.H"
# include "Fl_Native_File_Chooser_Kdialog.H"
#endif
@@ -932,6 +932,7 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
platform_fnfc = NULL;
fl_open_display();
if (Fl::option(Fl::OPTION_FNFC_USES_GTK)) {
+#if USE_KDIALOG
if (Fl::option(Fl::OPTION_FNFC_USES_ZENITY)&& val != BROWSE_MULTI_DIRECTORY) {
if (!Fl_Zenity_Native_File_Chooser_Driver::have_looked_for_zenity) {
// First Time here, try to find zenity
@@ -947,7 +948,6 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
// if we found zenity, we will use the Fl_Zenity_Native_File_Chooser_Driver
if (Fl_Zenity_Native_File_Chooser_Driver::did_find_zenity) platform_fnfc = new Fl_Zenity_Native_File_Chooser_Driver(val);
}
-#if USE_KDIALOG
const char *desktop = getenv("XDG_CURRENT_DESKTOP");
if (!platform_fnfc && desktop && strcmp(desktop, "KDE") == 0 && val != BROWSE_MULTI_DIRECTORY) {
if (!Fl_Kdialog_Native_File_Chooser_Driver::have_looked_for_kdialog) {