Bug 464591 - Fcitx IME candidate list has wrong position/size in some Qt6 apps on HiDPI Wayland
Summary: Fcitx IME candidate list has wrong position/size in some Qt6 apps on HiDPI Wa...
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.26.90
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-21 12:54 UTC by hexchain
Modified: 2023-02-03 02:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
IME window position in Telegram (94.31 KB, image/png)
2023-01-21 12:54 UTC, hexchain
Details
IME window size in qdbusviewer6 (97.94 KB, image/png)
2023-01-21 12:55 UTC, hexchain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hexchain 2023-01-21 12:54:55 UTC
Created attachment 155468 [details]
IME window position in Telegram

SUMMARY
On HiDPI Wayland, in Telegram flatpak (which uses Qt 6.4.2), the candidate list window is placed away from the cursor but close to the top left screen. It seems to be at screen position (dx/2, dy/2), where dx and dy are roughly the relative positions of the text cursor inside the window. This happens regardless of whether Kimpanel is active.

Also, with Qt 6.5.0beta3 (in Arch Linux kde-unstable), the candidate window is at the correct position but twice as large. It also looks stretched. Kimpanel doesn't seem to be able to replace the candidate window in Qt6 apps. This does not happen with Qt 6.5.4 (the window position is also correct)

STEPS TO REPRODUCE
1. Type some text with an IME.

OBSERVED RESULT
Please see the attached screenshots.

EXPECTED RESULT
The candidate window should be at the correct position with the right size.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8 and 6.5.0beta3
Kernel Version: 6.1.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 hexchain 2023-01-21 12:55:23 UTC
Created attachment 155469 [details]
IME window size in qdbusviewer6
Comment 2 Fushan Wen 2023-01-25 13:06:00 UTC
Qt 6.5.4?
Comment 3 hexchain 2023-01-25 13:11:56 UTC
Sorry, should be 6.4.2.
Comment 4 hexchain 2023-01-29 11:16:39 UTC
Qt6 in kde-unstable has been updated to 6.5.0beta2 today (and I just realized it was beta1, not beta3 - sorry for the confusion!) and Fcitx's candidate list is back to normal (no longer 2x stretched).

The other issue with Telegram still exists.
Comment 5 hexchain 2023-01-31 17:33:51 UTC
(In reply to hexchain from comment #4)
> Qt6 in kde-unstable has been updated to 6.5.0beta2 today (and I just
> realized it was beta1, not beta3 - sorry for the confusion!) and Fcitx's
> candidate list is back to normal (no longer 2x stretched).
> 
> The other issue with Telegram still exists.

For some reason, the issue with Qt 6.5.0beta* is happening again. I was not sure why it become normal that day.

As a side note, I've done some tests with both KWin 5.26 and 5.27 in nested mode, and it didn't happen in 5.26 (in qdbusviewer6, the candidate window size is correct).
Comment 6 hexchain 2023-02-01 17:09:04 UTC
The issue with Qt 6.5 (oversized candidate window) seems to be fcitx5-qt having problems when fractional scaling is present. I've opened a bug report for it: https://github.com/fcitx/fcitx5-qt/issues/38