elementary / switchboard-plug-keyboard

Switchboard Keyboard Plug
GNU General Public License v2.0
28 stars 22 forks source link

ibus没有跟随光标的位置 #419

Closed sauntor closed 2 years ago

sauntor commented 2 years ago

What Happened?

  1. 当切换成中文输入法(智能拼音)时,候选词会离开正在输入的光标位置很远,并没有跟随光标。
  2. 我正在提交这个问题时(使用的默认【浏览器】),甚至连候选词都不显示了

Steps to Reproduce

  1. 安装elementary os时,选择 中文 语言、中文键盘
  2. 打开【代码】,切换输入法到中文模式,然后随便输入些什么,例如:我(wo)

Expected Behavior

候选词正常显示跟随输入光标所在的位置

OS Version

6.x (Odin)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

Dell XPS 15 9560

sauntor commented 2 years ago

这是问题截图(请注意右下角):

kb

sauntor commented 2 years ago

is there anybody read this issue? comment back!

sauntor commented 2 years ago

It's a bug caused by ibus and hidpi scale (I set my screen scale to x2), I finally get a workaround, as the fellow:

  1. create a wrapper script
    
    # vi ~/.local/bin/ibus-hidpi.sh
    #!/bin/bash

sleep 2 GDK_SCALE=1 ibus-daemon -drx

2. make the wrapper script runnable
```bash
chmod +x ~/.local/bin/ibus-hidpi.sh
  1. copy IBus autostart

    cp ~/.config/autostart/ibus-daemon.desktop ~/.config/autostart/ibus-hidpi.desktop
  2. and edit as the fellow(the HiDPI is an identifier for step 5):

    Name[zh_CN]=IBus 守护进程(HiDPI)
    Comment[zh_CN]=使用和管理输入法
    Exec=/home/sauntor/.local/bin/ibus-hidpi.sh
    Icon=ibus-setup
    Type=Application
    X-GNOME-Autostart-enabled=true
  3. open settings > Applications and switch the default ibus daemon off an the new HiDPI daemon on 2022-10-02 05-58-18 的屏幕截图@2x

  4. restart, and login