aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-09-11 10:46:12 +0200
committerPierre Ossman <ossman@cendio.se>2014-09-11 10:46:12 +0200
commit6d66d6deb790545dd475f3e74cf817be97d23cea (patch)
tree642621fc2c24d4c286f591bb31e0558c43e606a6
parent38fcebbb00d849d46158f66793ae0f7f3c7c7ec4 (diff)
downloadtigervnc-6d66d6deb790545dd475f3e74cf817be97d23cea.tar.gz
tigervnc-6d66d6deb790545dd475f3e74cf817be97d23cea.zip
Protect the optional IM disabling calls with #ifdef:s
-rw-r--r--CMakeLists.txt3
-rw-r--r--config.h.in1
-rw-r--r--vncviewer/Viewport.cxx4
3 files changed, 8 insertions, 0 deletions
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 <FL/Fl.H>\nint main(int c, char** v) { Fl::add_xhandler(NULL, NULL); return 0; }" HAVE_FLTK_XHANDLERS)
+ # FLTK STR #xxxx
+ check_cxx_source_compiles("#include <FL/Fl.H>\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: