-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hunt Lin
committed
Sep 10, 2020
1 parent
93d4c0a
commit 75b4260
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
From 278b2210204a68a74c67605fd8b622f155ece5f0 Mon Sep 17 00:00:00 2001 | ||
From: Hunt Lin <[email protected]> | ||
Date: Thu, 10 Sep 2020 11:22:20 +0800 | ||
Subject: [PATCH] SDL_USE_IME | ||
|
||
--- | ||
CMakeLists.txt | 14 ++++++++++++++ | ||
include/SDL_config.h.cmake | 2 ++ | ||
2 files changed, 16 insertions(+) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 610f150..dbc64ec 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1062,6 +1062,10 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID) | ||
#endif | ||
int main(int argc, char** argv) {}" HAVE_INPUT_EVENTS) | ||
|
||
+ check_c_source_compiles(" | ||
+ #include <X11/keysym.h> | ||
+ int main(int argc, char** argv) {}" HAVE_IME) | ||
+ | ||
check_c_source_compiles(" | ||
#include <linux/kd.h> | ||
#include <linux/keyboard.h> | ||
@@ -1080,6 +1084,10 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID) | ||
set(SDL_INPUT_LINUXEV 1) | ||
endif() | ||
|
||
+ if(HAVE_IME) | ||
+ set(SDL_USE_IME 1) | ||
+ endif() | ||
+ | ||
if(SDL_HAPTIC AND HAVE_INPUT_EVENTS) | ||
set(SDL_HAPTIC_LINUX 1) | ||
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c) | ||
@@ -1116,6 +1124,12 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID) | ||
endif() | ||
|
||
check_include_file("fcitx/frontend.h" HAVE_FCITX_FRONTEND_H) | ||
+ | ||
+ if(HAVE_FCITX_FRONTEND_H) | ||
+ set(SDL_USE_IME 1) | ||
+ endif() | ||
+ | ||
+ set(SDL_USE_IME 1) | ||
endif() | ||
|
||
if(INPUT_TSLIB) | ||
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake | ||
index 5e9e5bc..120f4f6 100644 | ||
--- a/include/SDL_config.h.cmake | ||
+++ b/include/SDL_config.h.cmake | ||
@@ -198,6 +198,7 @@ | ||
#cmakedefine HAVE_ALTIVEC_H 1 | ||
#cmakedefine HAVE_DBUS_DBUS_H 1 | ||
#cmakedefine HAVE_FCITX_FRONTEND_H 1 | ||
+#cmakedefine HAVE_IME 1 | ||
#cmakedefine HAVE_IBUS_IBUS_H 1 | ||
#cmakedefine HAVE_IMMINTRIN_H 1 | ||
#cmakedefine HAVE_LIBSAMPLERATE_H 1 | ||
@@ -274,6 +275,7 @@ | ||
/* Enable various input drivers */ | ||
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ | ||
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@ | ||
+#cmakedefine SDL_USE_IME @SDL_USE_IME@ | ||
#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ | ||
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@ | ||
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ | ||
-- | ||
2.25.1 |