A pointer bug

When I input Chinese, the mouse pointer will not move to the latest position, and English has no such problem.

Assigned to
1 year, 6 months ago
1 year, 6 months ago
No labels applied.

~eliasnaur 1 year, 6 months ago

It would help to have a complete program demonstrating the problem (or just of the gio-examples). Also, please state your operating system and the inputs (what you enter, what did you expect to see, what happened instead).

~esword 1 year, 6 months ago · edit


This is my github link. When I input the Chinese "什么", I find that the mouse pointer does not move. When I input English letters or numbers, there is no such problem.

The following is a gif demonstration.


I don't know why gif can't be displayed. This is a gif link.


~eliasnaur 1 year, 6 months ago

Thank you for the clear report. I don't have a Window machine at the moment, so the issue is difficult to reproduce for me. Perhaps you can take a look at the Windows IME calls (here) in order to determine what's different from English characters to Chinese composite text. Thanks you.

Has Chinese IME ever worked for you? If so, please try to git bisect to a particular commit that breaks it.

~esword 1 year, 6 months ago · edit

OK, I'll try to solve this problem. What I know is that a Chinese character has three lengths, while an English character has one length. I think this should be the length. I can make a mistake here. I treat Chinese characters as one length.

~esword 1 year, 6 months ago · edit

I don't know how to use IME. I haven't. I plan to study it and see if I can solve this problem. I can't guarantee success.

~eliasnaur 1 year, 6 months ago

I finally got a Windows 11 VM up and running, but I can't reproduce the issue. I tried

  1. Running your example:
% go run github.com/Esword618/giogui@latest
go: downloading github.com/Esword618/giogui v0.0.0-20221117034659-09f171727686
go: github.com/Esword618/giogui@latest: github.com/Esword618/giogui@v0.0.0-20221117034659-09f171727686: parsing go.mod:
	module declares its path as: guigio
	        but was required as: github.com/Esword618/giogui

I think you need to declare your module name as github.com/Esword618/giogui

  1. Ran Kitchen example with Chinese input enabled:
$ go run gioui.org/example/kitchen

however, inputting Chinese characters advanced the caret as expected.

My Chinese input looks different than yours, however.

~eliasnaur 1 year, 6 months ago

Does Chinese input work for you with the kitchen example?

~esword 1 year, 6 months ago · edit

The default font of Kitchen does not support Chinese. Have you changed its font?

~eliasnaur 1 year, 6 months ago

I have not, but the characters are replaced with rectangles and that's enough to verify the issue. You can tell whether the caret moves correctly or not after inserting text.

~esword 1 year, 6 months ago · edit


You can take a look at the video link. This is recorded by the example I ran with the following command. Obviously, when I input Chinese characters, I will find that the pointer and cursor do not move.

~esword 1 year, 6 months ago · edit

go run gioui.org/example/kitchen

~eliasnaur 1 year, 6 months ago

It seems that you're running Windows 11 as well, right? If so, the only difference I can think of is our Input Method Editor (IME). I've tested the "Chinese, Simplified" input method, and it works. What are you using?

I've uploaded a screencast of my testing here: https://file.io/O9G1HN1UgpXo .

~esword 1 year, 6 months ago · edit

I found a problem. The input method software I used is a third-party software, not Microsoft's own input method software, so this problem occurs. But why does the third-party input method software not support it?

~esword 1 year, 6 months ago · edit

When I first input the Chinese character "你好是的", I used Microsoft's own input method. The second time I input "你好是的", I used a third-party input method called Sogou input method.

I've uploaded a screencast of my testing here:https://file.io/HynEsbyaNhgX

~esword 1 year, 6 months ago · edit

I uploaded another test video:https://file.io/YJDPrvjeD4MZ

~eliasnaur REPORTED FIXED 1 year, 6 months ago

Elias Naur referenced this ticket in commit dee53b3.

Register here or Log in to comment, or comment via email.