Fixed bug 5103 - Port fcitx support to both fcitx 4 & 5

wengxt

Due to the new major fcitx version is coming close, the existing code need to be ported to use new Fcitx dbus interface.

The new dbus interface is supported by both fcitx 4 and 5, and has a good side effect, which is that it will work with flatpak for free. Also the patch remove the dependency on fcitx header. Instead, it just hardcodes a few enum value in the code so need to handle the different header for fcitx4 or 5.
This commit is contained in:
Sam Lantinga committed 2020-05-11 14:31:04 -07:00
1 parent 33642b47b2
commit eadc8693dd
9 files changed
+160 -113

No files matched your search

+8 -19
View File
@@ -2731,24 +2731,13 @@ CheckFcitx()
AS_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
, enable_fcitx=yes)
if test x$enable_fcitx = xyes; then
PKG_CHECK_MODULES([FCITX], [fcitx], have_fcitx=yes, have_fcitx=no)
CFLAGS="$CFLAGS $FCITX_CFLAGS"
AC_CHECK_HEADER(fcitx/frontend.h,
have_fcitx_frontend_h_hdr=yes,
have_fcitx_frontend_h_hdr=no)
CFLAGS="$save_CFLAGS"
if test x$have_fcitx_frontend_h_hdr = xyes; then
if test x$enable_ime != xyes; then
AC_MSG_WARN([IME support is required for fcitx.])
have_fcitx_frontend_h_hdr=no
elif test x$enable_dbus != xyes; then
AC_MSG_WARN([DBus support is required for fcitx.])
have_fcitx_frontend_h_hdr=no
else
AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
fi
if test x$enable_ime != xyes; then
AC_MSG_WARN([IME support is required for fcitx.])
elif test x$enable_dbus != xyes; then
AC_MSG_WARN([DBus support is required for fcitx.])
else
AC_DEFINE(HAVE_FCITX, 1, [ ])
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
fi
fi
}
@@ -4408,7 +4397,7 @@ if test x$have_ibus_ibus_h_hdr = xyes; then
else
SUMMARY="${SUMMARY}Using ibus : NO\n"
fi
if test x$have_fcitx_frontend_h_hdr = xyes; then
if test x$enable_fcitx = xyes; then
SUMMARY="${SUMMARY}Using fcitx : YES\n"
else
SUMMARY="${SUMMARY}Using fcitx : NO\n"