From 6d66d6deb790545dd475f3e74cf817be97d23cea Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 11 Sep 2014 10:46:12 +0200 Subject: Protect the optional IM disabling calls with #ifdef:s --- CMakeLists.txt | 3 +++ config.h.in | 1 + vncviewer/Viewport.cxx | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5a016ac..a3e0931a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,6 +303,9 @@ if(FLTK_FOUND) # FLTK STR #xxxx check_cxx_source_compiles("#include \nint main(int c, char** v) { Fl::add_xhandler(NULL, NULL); return 0; }" HAVE_FLTK_XHANDLERS) + # FLTK STR #xxxx + check_cxx_source_compiles("#include \nint main(int c, char** v) { Fl::disable_im(); return 0; }" HAVE_FLTK_IM) + set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) endif() diff --git a/config.h.in b/config.h.in index bac626b7..a50e723d 100644 --- a/config.h.in +++ b/config.h.in @@ -18,6 +18,7 @@ #cmakedefine HAVE_FLTK_WORK_AREA #cmakedefine HAVE_FLTK_ICONS #cmakedefine HAVE_FLTK_XHANDLERS +#cmakedefine HAVE_FLTK_IM #cmakedefine HAVE_ACTIVE_DESKTOP_H #cmakedefine HAVE_ACTIVE_DESKTOP_L #cmakedefine ENABLE_NLS 1 diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index ec48b02e..595a4aa8 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -410,7 +410,9 @@ int Viewport::handle(int event) return 1; case FL_FOCUS: +#ifdef HAVE_FLTK_IM Fl::disable_im(); +#endif // Yes, we would like some focus please! return 1; @@ -419,7 +421,9 @@ int Viewport::handle(int event) // sense (e.g. Alt+Tab where we only see the Alt press) while (!downKeySym.empty()) handleKeyRelease(downKeySym.begin()->first); +#ifdef HAVE_FLTK_IM Fl::enable_im(); +#endif return 1; case FL_KEYDOWN: -- cgit v1.2.3