Fix mouse capture bugs and super-space problem on Wayland (ibus-lotus)#599
Fix mouse capture bugs and super-space problem on Wayland (ibus-lotus)#599hien-ngo29 wants to merge 3 commits intoBambooEngine:masterfrom
Conversation
|
Hơi ngoài lề một chút, nhưng không biết mình có nên thêm một PR lại cho cái này không? #581 |
luongthanhlam
left a comment
There was a problem hiding this comment.
a few questions and some minor improvements
| func (e *IBusBambooEngine) Reset() *dbus.Error { | ||
| fmt.Print("Reset.\n") | ||
| if e.checkInputMode(config.PreeditIM) { | ||
| e.commitPreeditAndReset(e.getPreeditString()) |
There was a problem hiding this comment.
when mouse capture is not active, and you're typing text in one location and then clicking elsewhere will commit any remaining buffered input at the new cursor position. That's annoying in x11.
There was a problem hiding this comment.
That's odd because my gnome wayland would automatically commit the text when i click my cursor elsewhere, even if the line e.commitPreeditAndReset(e.getPreeditString()) was removed. With that normal code before my PR, ibus-bamboo spams 2 duplicate words: one in the old location and one in the new location that mouse just clicked.
Did you mean this line is X11 only?
There was a problem hiding this comment.
Yes, it's designed to work on x11 only. What do you think if we disable this entirely on wayland, but still active for X11 users?
There was a problem hiding this comment.
Well i'm not sure. I tried switching to an X11 desktop (GNOME 46 and Cinnamon) and the issue was the same as on Wayland. It duplicated two same words on two different cursor locations instead of "moved" the word from location A to location B like you said. Are you sure you are able reproduce the that x11 issue while mouse capture option is disabled?
I doubt that you're using an older ibus version so that problem persists (mine is 1.5.33 and 1.5.29-rc2). Not too sure.
There was a problem hiding this comment.
It has been a week and you haven't had any response to this. What do you think about integrating both features and let users choose whether one they want in the configuration window? It might be that your linux setup was too outdated, we could integrate that feature for users who like to keep their machine stable and outdated. But i would say, i wouldn't like that, it's a dirty workaround. What do you think?
We can hold up this and discuss more if you want. But is it fine to merge the super-space fix on Wayland right now?
| dictionary, _ = loadDictionary(DictVietnameseCm) | ||
| } | ||
| if inStringList(disabledMouseCapturingList, e.getWmClass()) { | ||
| stopMouseCapturing() |
There was a problem hiding this comment.
Sorry if I'm missing something, what exactly is the problem with mouse capturing? Could you send me a link to the relevant discussion? tks
There was a problem hiding this comment.
On most modern desktop environments, they start replacing from X11 to Wayland. And you know, the mouse capturing in the code used xlib to capture mouse events and commit the text, this is pretty a bad idea as not only it doesn't work on Wayland but also causes some trouble like #487, I assume XWayland on GNOME Wayland is trying some way to get the permission to control the mouse by popping up that remote interaction dialog.
to prevent backward compability
Mình đã sử dụng hàm
Reset()từ ibus để bắt những thời điểm thích hợp để commit thay vì phải tự bắt chuột bằng xlib.engine.go:136-142Mình không rõ có ý định gì khi để commit chữ trong hàm
Reset()này. Mình chạy lại test thấy vẫn ok nên chắc thôi kệ đi nhỉ.Cũng chính vì đã có cách fix này rồi nên các phần code liên quan đến bắt sự kiện chuột mình đã xóa đi hết rồi nhé.
Còn vấn đề không đổi bộ gõ bằng super - space được trên Wayland (phím super bị ignore) thì mình chỉ việc thêm
IBusMod4Mask = 1 << 6vàoibus_constants.golà xong. Nếu mn check lại doc của ibus sẽ thấy. Có vẻ như phím super trên wayland dùng giá trị bit khác.Mình định merge thêm cái sửa lỗi không mở được bảng tùy chọn trên Wayland từ ibus-lotus tuy nhiên goatastronaut không đồng ý với cách trên bởi nó yêu cầu phải cài đặt extension từ bên thứ 3 trên GNOME. Mình sẽ để sau để mn bàn lại vậy.