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

Remove all ibus workarounds #674

Merged
merged 2 commits into from Nov 18, 2022

Conversation

mattrose
Copy link
Member

I am sick of ibus breaking every single time we issue a new release, so as of now, I've gone through the code and removed all of the workarounds that we have put in to try and get around issues in ibus, and GTK Input Methods in general.

The code as it stands should work, I'm going to mention a bunch of people in this PR and ask them to beta test this change.

I am sick of ibus breaking every single time we issue a new
release, so as of now, I've gone through the code and removed
all of the workarounds that we have put in to try and get
around issues in ibus, and GTK Input Methods in general.

The code as it stands should work, I'm going to mention a
bunch of people in this PR and ask them to beta test this
change.
@mattrose
Copy link
Member Author

mattrose commented Nov 14, 2022

The following is a list of users that have seen issues with GTK input methods and Terminators.

Can I ask anyone receiving this message, or anyone else interested to test out the change

  1. check out the code git clone https://github.com/gnome-terminator/terminator.git ; cd terminator
  2. pull down my changes git checkout -b mattrose-remove-ibus-hacks master && git pull git@github.com:mattrose/terminator.git remove-ibus-hacks
  3. run the following code python3 ./terminator -u -g /dev/null

Then once you've checked out the relevant code:

  1. Report if it breaks their current input method.
  2. Report if it doubles characters on broadcast (see https://terminator-gtk3.readthedocs.io/en/latest/grouping.html for instructions on how to set that up )
  3. Report any other problems
  4. Can we come up with a way of automating the testing of this?

@mjw10086
@shilkazx
@mikeperalta1
@sayaleeraut
@pacientes
@anbaccar
@PenelopeFudd
@kellyschoenhofen
@ros-financial-com
@dreamonhigh
@Ajk4
@sailing0505
@RockLobstah271
@gouzhuang
@yurenchen000
@jhhenriquee
@Isgleas
@lazyfrosch
@ozzdemir
@Joshua-Snapp
@xbello
@kimba74
@yuki

@ozzdemir
Copy link
Contributor

ozzdemir commented Nov 14, 2022

On ubuntu 18.04:
Tested and observed no discrepancy, no double character on broadcast, etc.

@yurenchen000
Copy link

yurenchen000 commented Nov 14, 2022

about automatic testing

on ubuntu22, x11 (not sure on wayland, maybe not work)

this cmd can focus terminator window, and simulate keyboard input 'abc'
//and can reproduce double char problem as if it were done manually

xdotool search  --onlyvisible --all  terminator windowactivate windowfocus sleep 0.5 type 'abc'

xdotool search  --onlyvisible --class  terminator windowactivate --sync  windowfocus --sync type 'abc'

// I don't know if there is an existing test platform

@yurenchen000
Copy link

yurenchen000 commented Nov 14, 2022

on ubuntu 22 lts, x11,
with ibus installed, use en input methd when testing

the test steps got this test result:

terminator_test2

//seems got doubles characters

@yurenchen000
Copy link

have to say
on ubuntu22, x11, with ibus

even with those hacks
broadcast still got double char 😿

$ apt list -a terminator
terminator/jammy,jammy,now 2.1.1-1 all [installed]

$ GTK_IM_MODULE= IBUS_DISABLE_SNOOPER=1 /usr/bin/terminator -u

unless I stop ibus by ibus exit


once ibus come back, it brings back the double char

@mattrose
Copy link
Member Author

mattrose commented Nov 14, 2022

have to say on ubuntu22, x11, with ibus

even with those hacks broadcast still got double char crying_cat_face

$ apt list -a terminator
terminator/jammy,jammy,now 2.1.1-1 all [installed]

$ GTK_IM_MODULE= IBUS_DISABLE_SNOOPER=1 /usr/bin/terminator -u

unless I stop ibus by ibus exit

once ibus come back, it brings back the double char

@yurenchen000 How are you setting up ibus with the en input method? I added en_US keyboard through ibus-setup but that didn't seem to make a difference.

@yurenchen000
Copy link

yurenchen000 commented Nov 14, 2022

terminator_test3

ibus with en layout,
or without en layout (use pinyin's en mode),
got same result

@mattrose
Copy link
Member Author

I see. That seems to be a problem only with that input method. I tried installing a bunch of other keyboards and they all worked as expected, and even worse, it doesn't even need to be on that keyboard, it just has to have the plugin installed.

Can you open an issue with them? I have no idea why this is happening, but ibus-libpinyin seems to cause doubled characters in a bunch of different applications and programs. https://github.com/libpinyin/ibus-libpinyin

@yurenchen000
Copy link

yurenchen000 commented Nov 14, 2022

I see. That seems to be a problem only with that input method. I tried installing a bunch of other keyboards and they all worked as expected, and even worse, it doesn't even need to be on that keyboard, it just has to have the plugin installed.

Can you open an issue with them? I have no idea why this is happening, but ibus-libpinyin seems to cause doubled characters in a bunch of different applications and programs. https://github.com/libpinyin/ibus-libpinyin

I'm not sure source cause is that ibus-libpinyin.

another input method wubi (seems provide by ibus-table-wubi package)
seem also have some promlem.
(add it into system input source, but use en in terminator)

terminator_test4

chen@u22:~$ apt list ibus-table-wubi 
ibus-table-wubi/jammy,jammy,now 1.8.2-3 all [installed]

chen@u22:~$ dpkg -L ibus-table-wubi
/usr/share/ibus-table/icons/wubi-haifeng86.svg
/usr/share/ibus-table/icons/wubi-jidian86.svg
/usr/share/ibus-table/tables/wubi-haifeng86.db
/usr/share/ibus-table/tables/wubi-jidian86.db

chen@u22:~$ pgrep -af table
97023 /usr/bin/python3 /usr/share/ibus-table/engine/main.py --ibus

the issue disapper only if I do all those operations:

  • remove issue input method from system input source
  • do ibus restart
  • do gnome-shell restart (by Alt+F2, r, Enter)

// with / without restart terminator no effect
// direct kill input method's process no effect //need ibus restart without it & gnome-shell restart


I will try more & report to them later

@mattrose
Copy link
Member Author

@yurenchen000 thank you for doing all this digging. We can definitely look at opening a bug against ibus itself, but given that very few input methods actually trigger this behaviour, I'm thinking it's something that those input methods in particular are doing. The reason I asked you to open a bug against the ibus-libpinyin library in particular was mostly because all the issues were in Chinese and I didn't understand any of them, so it was hard for me to see if there were any similar issues.

@xbello
Copy link

xbello commented Nov 15, 2022

If it's still useful, it works for me (no duplicated broadcast):

$ uname -a
Linux xbello 6.0.7-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC
Thu Nov 3 17:09:02 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ echo $XDG_SESSION_TYPE
x11
$ echo $XDG_CURRENT_DESKTOP 
LXDE

BUT I'm not sure I'm still using ibus. Maybe I removed it at some point in the last year, can't remember:

$ echo $GTK_IM_MODULE 
gtk-im-context-simple
$ echo $QT_IM_MODULE
xim

The execution of the terminator command throws the following Warning:

$ python3 ./terminator -u -g /dev/null
/home/xbello/terminator/terminatorlib/plugins/command_notify.py:26: Warning: invalid (NULL) pointer instance
Vte.Terminal().connect('notification-received',lambda *args: None,None)
/home/xbello/terminator/terminatorlib/plugins/command_notify.py:26: Warning: g_signal_handlers_disconnect_matched: 
assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
Vte.Terminal().connect('notification-received',lambda *args: None,None)

Edit:

I've installed ibus to test this. Launched with ibus-daemon, and the following vars added to the environment:

export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus

Input methods available: ES (Spanish) and EN (English US). It does the double broadcast. On another console, close ibus with ibus exit, and the double broadcast is gone, even with the above three environment variables set.

$ dnf list installed "ibus*"
Installed Packages
ibus.x86_64                                           1.5.26-9.fc36                     @updates
ibus-anthy.x86_64                                     1.5.14-4.fc36                     @updates
ibus-anthy-python.noarch                              1.5.14-4.fc36                     @updates
ibus-cangjie.noarch                                   2.4-26.fc36                       @fedora 
ibus-cangjie-engine-cangjie.noarch                    2.4-26.fc36                       @fedora 
ibus-gtk2.x86_64                                      1.5.26-9.fc36                     @updates
ibus-gtk3.x86_64                                      1.5.26-9.fc36                     @updates
ibus-hangul.x86_64                                    1.5.4-8.fc36                      @fedora 
ibus-kkc.x86_64                                       1.5.22-19.fc36                    @fedora 
ibus-libpinyin.x86_64                                 1.13.0-1.fc36                     @updates
ibus-libs.x86_64                                      1.5.26-9.fc36                     @updates
ibus-libzhuyin.x86_64                                 1.10.0-4.fc36                     @fedora 
ibus-m17n.x86_64                                      1.4.17-1.fc36                     @updates
ibus-rawcode.x86_64                                   1.3.2-22.fc36                     @fedora 
ibus-setup.noarch                                     1.5.26-9.fc36                     @updates
ibus-typing-booster.noarch                            2.19.7-1.fc36                     @updates

@PenelopeFudd
Copy link

PenelopeFudd commented Nov 15, 2022

Alas, still doubling broadcast output.

Fedora 35, Wayland 1.20.0, Plasma 5.25.4 desktop, plain English (US):

$ uname -a
Linux thinkpad.localdomain 6.0.5-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 16:27:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ env | grep ibus
GTK_IM_MODULE=ibus:xim
XMODIFIERS=@im=ibus
QT_IM_MODULE=ibus

$ python3 ./terminator -u -g /dev/null
/home/user/work/terminator/terminatorlib/plugins/command_notify.py:26: Warning: invalid (NULL) pointer instance
  Vte.Terminal().connect('notification-received',lambda *args: None,None)
/home/user/work/terminator/terminatorlib/plugins/command_notify.py:26: Warning: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
  Vte.Terminal().connect('notification-received',lambda *args: None,None)

image

@ros-financial-com
Copy link

I'd like to give some feedback, too.
I'm on ArchLinux, X11, and with the current regular packages, I cannot reproduce the "double characters" anymore.

System looks like this:
$ uname -a
Linux sioux 6.0.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Nov 2022 21:14:24 +0000 x86_64 GNU/Linux
$ python3 /usr/bin/terminator -u -g /dev/null

** (terminator:12324): WARNING **: 10:35:44.515: Binding 'a' failed!
Unable to bind hide_window key, another instance/window has it.
$ echo $GTK_IM_MODULE

$ echo $QT_IM_MODULE
ibus
$ echo $XDG_SESSION_TYPE
x11
$ echo $XDG_CURRENT_DESKTOP
GNOME
$ yay -Q | grep ibus
ibus 1.5.27-1
libibus 1.5.27-1
libusb 1.0.26-1
libusb-compat 0.1.7-1
libusbmuxd 2.0.2-1

@mattrose
Copy link
Member Author

Alas, still doubling broadcast output.

Fedora 35, Wayland 1.20.0, Plasma 5.25.4 desktop, plain English (US):

@PenelopeFudd Can you list the output of rpm -qa | grep ibus and gsettings get org.gnome.desktop.input-sources sources to see what ibus input methods you have installed?

Also, I'm surprised to see this because fedora 35 on wayland is basically my development environment, and I've never run into it there.

@mattrose
Copy link
Member Author

mattrose commented Nov 15, 2022

ibus-libpinyin.x86_64 1.13.0-1.fc36

@xbello Interesting, we know this module causes problems, and likely ibus-hangul as well.

@xbello
Copy link

xbello commented Nov 15, 2022

ibus-libpinyin.x86_64 1.13.0-1.fc36

@xbello Interesting, we know this module causes problems, and likely ibus-hangul as well.

I'm trying to reproduce in my second PC, which is almost the same as the previous one, and double broadcast is gone.

$ uname -a
Linux Barebone 6.0.7-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 3 17:09:02 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Revelant env:

GTK_IM_MODULE=ibus
XMODIFIERS=@im=ibus
QT_IM_MODULE=ibus
XDG_SESSION_TYPE=x11
XDG_CURRENT_DESKTOP=LXDE

Installed:

$ dnf list installed "ibus*"
Paquetes instalados
ibus.x86_64                                            1.5.26-9.fc36                      @updates
ibus-cangjie.noarch                                    2.4-26.fc36                        @fedora 
ibus-cangjie-engine-cangjie.noarch                     2.4-26.fc36                        @fedora 
ibus-gtk2.x86_64                                       1.5.26-9.fc36                      @updates
ibus-gtk3.x86_64                                       1.5.26-9.fc36                      @updates
ibus-gtk4.x86_64                                       1.5.26-9.fc36                      @updates
ibus-hangul.x86_64                                     1.5.4-8.fc36                       @fedora 
ibus-kkc.x86_64                                        1.5.22-19.fc36                     @fedora 
ibus-libpinyin.x86_64                                  1.13.0-1.fc36                      @updates
ibus-libs.x86_64                                       1.5.26-9.fc36                      @updates
ibus-libzhuyin.x86_64                                  1.10.0-4.fc36                      @fedora 
ibus-m17n.x86_64                                       1.4.17-1.fc36                      @updates
ibus-setup.noarch                                      1.5.26-9.fc36                      @updates

Maybe solved in ibus-gtk4 ? I'm lost.

@PenelopeFudd
Copy link

$ rpm -qa | grep ibus 

libusbmuxd-2.0.2-5.fc35.x86_64
libusal-1.1.11-48.fc35.x86_64
libuser-0.63-7.fc35.x86_64
libusb-0.1.7-6.fc35.x86_64
ibus-hangul-1.5.4-7.fc35.x86_64
ibus-kkc-1.5.22-18.fc35.x86_64
ibus-libpinyin-1.12.1-1.fc35.x86_64
ibus-libzhuyin-1.10.0-3.fc35.x86_64
ibus-qt-1.3.3-32.fc35.x86_64
libusb-devel-0.1.7-6.fc35.x86_64
ibus-libs-1.5.25-6.fc35.x86_64
ibus-gtk2-1.5.25-6.fc35.x86_64
ibus-gtk3-1.5.25-6.fc35.x86_64
ibus-setup-1.5.25-6.fc35.noarch
ibus-1.5.25-6.fc35.x86_64
ibus-cangjie-2.4-25.fc35.noarch
ibus-cangjie-engine-cangjie-2.4-25.fc35.noarch
ibus-anthy-python-1.5.14-1.fc35.noarch
ibus-anthy-1.5.14-1.fc35.x86_64
libusb1-1.0.25-8.fc35.x86_64
libusb1-devel-1.0.25-8.fc35.x86_64
ibus-m17n-1.4.17-1.fc35.x86_64
ibus-typing-booster-2.19.7-1.fc35.noarch

$ gsettings get org.gnome.desktop.input-sources sources

[('xkb', 'us')]

@mattrose
Copy link
Member Author

Thanks for the feedback everyone. At least now I can reproduce the problem, and know of what usually causes it.

@mattrose mattrose merged commit 1d1e57b into gnome-terminator:master Nov 18, 2022
@shilkazx
Copy link

I've tested the patch, There is no duplicating problem, and the group broadcasting seems fine without activating fcitx(input application like ibus) or fcitx input language is set to English. But the group broadcasting malfunctioned when inputting CJK characters using fcitx(see the attached screenshot).
2022-11-28_12-58_1
2022-11-28_12-58

@PenelopeFudd
Copy link

PenelopeFudd commented Nov 29, 2022

I've just tested it, but it's still doing double-input for me.
Is there anything I have to do other than reboot, git checkout master; git pull, close all terminator windows, and then run ./terminator?

@mattrose
Copy link
Member Author

I've just tested it, but it's still doing double-input for me.
Is there anything I have to do other than reboot, git checkout master; git pull, close all terminator windows, and then run ./terminator?

Make sure there are no running terminator instances before running terminator, or run ./terminator -u

@JohelEGP
Copy link

Or terminator -g /dev/null.

@mattrose
Copy link
Member Author

Or terminator -g /dev/null.

That will not work. Unless you specify to disable dbus using -u, trying to start a new instance of terminator will attach to an already running instance.

@PenelopeFudd
Copy link

Ok, terminator -u is still generating double-keystrokes when broadcasting. :-(

@mattrose
Copy link
Member Author

mattrose commented Dec 1, 2022

@PenelopeFudd F37 is out and it has a new version of IBus that may fix this. F35 is coming EOL in a month or so.

@shilkazx
Copy link

@mattrose Could you kindly release a new version for #674 #667 fixed? So the downstream(e.g. Archlinux package) can update to the newer version. Thanks a lot.

@itJunky
Copy link

itJunky commented Dec 22, 2023

Have terminator 2.1.1 in ubuntu 22.04.3. But bug with double input is still here (((
May be need more newer version? What it by number?

@dukercs
Copy link

dukercs commented Mar 12, 2024

Thanks I've done as you said here and no more double keystrokes, thanks a lot!

The following is a list of users that have seen issues with GTK input methods and Terminators.

Can I ask anyone receiving this message, or anyone else interested to test out the change

1. check out the code `git clone https://github.com/gnome-terminator/terminator.git ; cd terminator `

2. pull down my changes `git checkout -b mattrose-remove-ibus-hacks master && git pull git@github.com:mattrose/terminator.git remove-ibus-hacks`

3. run the following code `python3 ./terminator -u -g /dev/null`

Then once you've checked out the relevant code:

1. Report if it breaks their current input method.

2. Report if it doubles characters on broadcast (see https://terminator-gtk3.readthedocs.io/en/latest/grouping.html for instructions on how to set that up )

3. Report any other problems

4. Can we come up with a way of automating the testing of this?

@mjw10086 @shilkazx @mikeperalta1 @sayaleeraut @pacientes @anbaccar @PenelopeFudd @kellyschoenhofen @ros-financial-com @dreamonhigh @Ajk4 @sailing0505 @RockLobstah271 @gouzhuang @yurenchen000 @jhhenriquee @Isgleas @lazyfrosch @ozzdemir @Joshua-Snapp @xbello @kimba74 @yuki

@awsms
Copy link

awsms commented Apr 6, 2024

The following is a list of users that have seen issues with GTK input methods and Terminators.

Can I ask anyone receiving this message, or anyone else interested to test out the change

  1. check out the code git clone https://github.com/gnome-terminator/terminator.git ; cd terminator
  2. pull down my changes git checkout -b mattrose-remove-ibus-hacks master && git pull git@github.com:mattrose/terminator.git remove-ibus-hacks
  3. run the following code python3 ./terminator -u -g /dev/null

Then once you've checked out the relevant code:

  1. Report if it breaks their current input method.
  2. Report if it doubles characters on broadcast (see https://terminator-gtk3.readthedocs.io/en/latest/grouping.html for instructions on how to set that up )
  3. Report any other problems
  4. Can we come up with a way of automating the testing of this?
  1. I can type fine.
  2. The double tap issue still happens.
  3. /

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

Successfully merging this pull request may close these issues.

None yet