~eliasnaur/gio#458: 
A pointer bug

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

Status
RESOLVED FIXED
Submitter
~esword
Assigned to
No-one
Submitted
2 years ago
Updated
2 years ago
Labels
No labels applied.

~eliasnaur 2 years 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 2 years ago · edit

https://github.com/Esword618/giogui

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.

image

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

https://github.com/Esword618/giogui/blob/main/img/pointerbug.gif

~eliasnaur 2 years 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 2 years 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 2 years 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 2 years 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 2 years ago

Does Chinese input work for you with the kitchen example?

~esword 2 years ago · edit

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

~eliasnaur 2 years 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 2 years ago · edit

https://github.com/Esword618/giogui/blob/main/img/kitchen.mp4

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 2 years ago · edit

go run gioui.org/example/kitchen

~eliasnaur 2 years 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 2 years 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 2 years 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 2 years ago · edit

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

~eliasnaur REPORTED FIXED 2 years ago

Elias Naur referenced this ticket in commit dee53b3.

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