Skip to content

Wayland (Sway) Support #292

Description

@glyh

Describe the bug
If the problem is about you can not use fcitx in certain application, or the input window is placed in wrong place, be sure to include which application is being typed, and the output of fcitx5-diagnose command.

To Reproduce
Steps to reproduce the behavior:

  1. Open chromium with "--enable-features=UseOzonePlatform --ozone-platform=wayland", try to type, but I can just input english.
  2. Open alacritty, try to type. Successfully type something but I can't see the pop-up window, so I don't know what I'm typing. Also, because of fcitx5 is running in the background, it make alacritty lags all the time.

Expected behavior
A clear and concise description of what you expected to happen.
My input is hooked by fcitx5, and I can see the pop-up window by IME.

Desktop (please complete the following information):

  • Window Manager: Sway
  • Display server type: Wayland
  • The output of fcitx5-diagnose if possible.
# System Info:
1.  `uname -a`:

        Linux arch 5.12.9-arch1-1 #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000 x86_64 GNU/Linux

2.  `lsb_release -a`:

        LSB Version:	1.4
        Distributor ID:	Arch
        Description:	Arch Linux
        Release:	rolling
        Codename:	n/a

3.  `lsb_release -d`:

        Description:	Arch Linux

4.  `/etc/lsb-release`:

        LSB_VERSION=1.4
        DISTRIB_ID=Arch
        DISTRIB_RELEASE=rolling
        DISTRIB_DESCRIPTION="Arch Linux"

5.  `/etc/os-release`:

        NAME="Arch Linux"
        PRETTY_NAME="Arch Linux"
        ID=arch
        BUILD_ID=rolling
        ANSI_COLOR="38;2;23;147;209"
        HOME_URL="https://archlinux.org/"
        DOCUMENTATION_URL="https://wiki.archlinux.org/"
        SUPPORT_URL="https://bbs.archlinux.org/"
        BUG_REPORT_URL="https://bugs.archlinux.org/"
        LOGO=archlinux

6.  Desktop Environment:

    Cannot determine desktop environment.

7.  Bash Version:

        BASH_VERSION='5.1.8(1)-release'

# Environment:
1.  DISPLAY:

        DISPLAY=':1'

2.  Keyboard Layout:

    1.  `setxkbmap`:

            xkb_keymap {
            	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
            	xkb_types     { include "complete"	};
            	xkb_compat    { include "complete"	};
            	xkb_symbols   { include "pc+us+inet(evdev)"	};
            	xkb_geometry  { include "pc(pc105)"	};
            };

    2.  `xprop`:

            _XKB_RULES_NAMES(STRING) = "evdev", "pc105", "us", "", ""

3.  Locale:

    1.  All locale:

            C
            en_US.utf8
            POSIX
            zh_CN.utf8
            zh_HK.utf8
            zh_TW.utf8

    2.  Current locale:

            LANG=en_US.UTF8
            LC_CTYPE="en_US.UTF8"
            LC_NUMERIC="en_US.UTF8"
            LC_TIME="en_US.UTF8"
            LC_COLLATE="en_US.UTF8"
            LC_MONETARY="en_US.UTF8"
            LC_MESSAGES="en_US.UTF8"
            LC_PAPER="en_US.UTF8"
            LC_NAME="en_US.UTF8"
            LC_ADDRESS="en_US.UTF8"
            LC_TELEPHONE="en_US.UTF8"
            LC_MEASUREMENT="en_US.UTF8"
            LC_IDENTIFICATION="en_US.UTF8"
            LC_ALL=

4.  Directories:

    1.  Home:

            /home/lyh

    2.  `${XDG_CONFIG_HOME}`:

        Environment variable `XDG_CONFIG_HOME` is not set.

        Current value of `XDG_CONFIG_HOME` is `~/.config` (`/home/lyh/.config`).

    3.  Fcitx5 Settings Directory:

        Current fcitx5 settings directory is `~/.config/fcitx5` (`/home/lyh/.config/fcitx5`).

5.  Current user:

    The script is run as lyh (1000).

# Fcitx State:
1.  executable:

    Found fcitx5 at `/usr/bin/fcitx5`.

2.  version:

    Fcitx version: `5.0.8`

3.  process:

    **Fcitx5 is not running.**
    **Please check the Configure link of your distribution in [Beginner's Guide](http://fcitx-im.org/wiki/Beginner%27s_Guide) for how to setup fcitx5 autostart.**

# Fcitx Configure UI:
1.  Config Tool Wrapper:

    Found fcitx5-configtool at `/usr/bin/fcitx5-configtool`.

2.  Config GUI for qt:

    Found `fcitx5-config-qt` at `/usr/bin/fcitx5-config-qt`.

3.  Config GUI for kde:

    **`kcmshell5` not found.**

# Frontends setup:
## Xim:
1.  `${XMODIFIERS}`:

    **XMODIFIERS is not set**

    **Please set environment variable XMODIFIERS to "@im=fcitx" using the tool your distribution provides or add `export XMODIFIERS=@im=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: XMODIFIERS](http://fcitx-im.org/wiki/Input_method_related_environment_variables#XMODIFIERS).**
    Xim Server Name from Environment variable is fcitx.

2.  XIM_SERVERS on root window:

    **Cannot find xim_server on root window.**

## Qt:
1.  qt4 - `${QT4_IM_MODULE}`:

    **Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add `export QT_IM_MODULE=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: QT_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables#QT_IM_MODULE).**

2.  qt5 - `${QT_IM_MODULE}`:

    **Please set environment variable QT_IM_MODULE to "fcitx" using the tool your distribution provides or add `export QT_IM_MODULE=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: QT_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables#QT_IM_MODULE).**

3.  Qt IM module files:

    Found fcitx5 im module for qt: `/usr/lib/qt/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.
    Found unknown fcitx qt module: `/usr/lib/qt/plugins/kcms/kcm_fcitx5.so`.
    Found unknown fcitx qt module: `/usr/lib/office6/qt/plugins/inputmethods/libqim-fcitx.so`.
    Found fcitx5 qt5 module: `/usr/lib/fcitx5/qt5/libfcitx-quickphrase-editor5.so`.
    Found fcitx5 im module for qt6: `/usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so`.
    **Cannot find fcitx5 input method module for Qt4.**

## Gtk:
1.  gtk - `${GTK_IM_MODULE}`:

    **Please set environment variable GTK_IM_MODULE to "fcitx" using the tool your distribution provides or add `export GTK_IM_MODULE=fcitx` to your `~/.xprofile`. See [Input Method Related Environment Variables: GTK_IM_MODULE](http://fcitx-im.org/wiki/Input_method_related_environment_variables#GTK_IM_MODULE).**

2.  `gtk-query-immodules`:

    1.  gtk 2:

        Found `gtk-query-immodules` for gtk `2.24.33` at `/usr/bin/gtk-query-immodules-2.0`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33

        **Failed to find fcitx5 in the output of `/usr/bin/gtk-query-immodules-2.0`**

        **Cannot find fcitx5 im module for gtk 2.**

    2.  gtk 3:

        Found `gtk-query-immodules` for gtk `3.24.29` at `/usr/bin/gtk-query-immodules-3.0`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.29

        **Failed to find fcitx5 in the output of `/usr/bin/gtk-query-immodules-3.0`**

        **Cannot find fcitx5 im module for gtk 3.**

3.  Gtk IM module cache:

    1.  gtk 2:

        Found immodules cache for gtk `2.24.33` at `/usr/lib/gtk-2.0/2.10.0/immodules.cache`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33

        **Failed to find fcitx5 in immodule cache at `/usr/lib/gtk-2.0/2.10.0/immodules.cache`**

        **Cannot find fcitx5 im module for gtk 2 in cache.**

    2.  gtk 3:

        Found immodules cache for gtk `3.24.29` at `/usr/lib/gtk-3.0/3.0.0/immodules.cache`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.29

        **Failed to find fcitx5 in immodule cache at `/usr/lib/gtk-3.0/3.0.0/immodules.cache`**

        **Cannot find fcitx5 im module for gtk 3 in cache.**

    3.  gtk 4:

        **Cannot find immodules cache for gtk 4**

        **Cannot find fcitx5 im module for gtk 4 in cache.**

4.  Gtk IM module files:

    1.  gtk 2:

        All found Gtk 2 immodule files exist.

    2.  gtk 3:

        All found Gtk 3 immodule files exist.

    3.  gtk 4:

        All found Gtk 4 immodule files exist.

# Configuration:
## Fcitx Addons:
1.  Addon Config Dir:

    Found fcitx5 addon config directory: `/usr/share/fcitx5/addon`.

2.  Addon List:

    1.  Found 20 enabled addons:

            Classic User Inteface
            Clipboard
            DBus
            DBus Frontend
            Emoji
            Fcitx4 Frontend
            IBus Frontend
            Input method selector
            Keyboard
            KDE Input Method Panel
            Status Notifier
            Notification
            Quick Phrase
            Rime
            Spell
            Unicode
            Wayland
            Wayland Input method frontend
            XCB
            X Input Method Frontend

    2.  Found 0 disabled addons:

3.  Addon Libraries:

    All libraries for all addons are found.

4.  User Interface:

    Found 2 enabled user interface addons:

        Classic User Inteface
        KDE Input Method Panel

# Log:
1.  `date`:

        Thu Jun 10 07:59:55 AM CST 2021

2.  `/home/lyh/.config/fcitx5/crash.log`:

    `/crash.log` not found.


Additional context
Add any other context about the problem here.

This seems long been a problem that mainstreams IMEs don't have good support for Wayland.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions