Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

縮放模式下選字視窗偏移 #581

Open
0xff07 opened this issue Nov 4, 2018 · 6 comments
Open

縮放模式下選字視窗偏移 #581

0xff07 opened this issue Nov 4, 2018 · 6 comments

Comments

@0xff07
Copy link

0xff07 commented Nov 4, 2018

作業系統:ubuntu 18.10
hime 版本:0.9.10+git20170427+dfsg1-3build1 (由 apt 安裝)
Kernel : 4.18.0-10-generic
桌面環境:GNOME 3.30.1
libgtk-3-0 版本:3.24.1-1ubuntu2
libgtk2.0-0 版本:2.24.32-3ubuntu1

當啟用縮放模式的時候,輸入法的選字視窗會偏移。但若不使用縮放則不會有這種狀況。

比如使用 2880x1800 的解析度,並且把縮放(Scale) 調為 200% 的話:

screenshot from 2018-11-04 05-22-10

選字視窗會偏移:

screenshot from 2018-11-04 04-51-17

但如果是使用 1440x900 ,並將縮放調整成 100% 的話則不會發生這種狀況:

screenshot from 2018-11-04 04-50-44

而解析度調整成 2800x1800,並且把縮放調整成 100% ,一樣不會偏移:

screenshot from 2018-11-04 04-56-47

查了一下之前有類似的問題 #570 是因為沒有安裝 hime-gtk3-immodule hime-gtk2-immodule 其中之一,但我兩個都有安裝。

希望知道在較高解析度的狀況下要怎麼調整才能使選字視窗正常?非常感謝

@xatier
Copy link
Contributor

xatier commented May 19, 2020

看來應該是這邊的問題 (?) 不過我沒有 Gnome DE 無法測試 Orz。

https://github.com/xatier/hime/blob/master/src/gtk-im/gtkimcontexthime.c#L478

@0xff07
Copy link
Author

0xff07 commented May 21, 2020

我剛剛測試了一下,在 200% 的配置下把 hime_im_client_set_cursor_location 中計算的 x, y 值都變成 2 倍 (這裡)

static void gtk_im_context_hime_set_cursor_location (GtkIMContext *context,
                                                     GdkRectangle *area) {
[...]
    if (context_xim->hime_ch) {
        hime_im_client_set_cursor_location (
            context_xim->hime_ch,
            area->x * 2,
            area->y * 2 + area->height);
    }
[...]
}

選字視窗的位置就會回到對的地方,看起來像這樣:

2020-05-21 21-15-26 的螢幕擷圖

(原先大概像這樣)

2020-05-21 21-23-21 的螢幕擷圖

但如果縮放模式調回 100% 的話,就會超出去,所以我想問題可就是出在這邊。不過改了之後,在 Firefox 中一輸入就會 crush。所以我不確定是否在其他地方還有問題。

@xatier
Copy link
Contributor

xatier commented May 21, 2020

感謝幫測試

不知道 gtk 有沒有 API 可以撈到 縮放模式 的設定... XDrz


看來 gtk3 有這個,不過 HIME 還沒完全 port 到 gtk3 ... 還有好多 API 要修 Orz
https://developer.gnome.org/gdk3/stable/GdkMonitor.html#gdk-monitor-get-scale-factor

@macthecadillac
Copy link

看來應該是這邊的問題 (?) 不過我沒有 Gnome DE 無法測試 Orz。

https://github.com/xatier/hime/blob/master/src/gtk-im/gtkimcontexthime.c#L478

在我的電腦上無論是Gnome或Plasma也有同樣的問題。我試過gcin也跟hime一樣的問題。fcitx沒有這個問題,但是他們的行列輸入法就是不好用…

@xatier
Copy link
Contributor

xatier commented May 17, 2022

@macthecadillac
Copy link

@xatier 我不會注音…像我這樣一般不用國語思考的人來說就是學了用起來也是不舒服

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants