Auto paste is not working properly
Auto paste in not working in Kde neon which is based on ubuntu 22.04. Here is os info
OS: KDE neon 5.27 x86_64
Kernel: 5.19.0-46-generic
DE: Plasma
WM: KWin
I am previously using x11 emoji picker. For x11 emoji picker auto paste is working fine. But for emoji mart sometime it works and sometime it does not work.
Thanks for the report @vpsone
I also got some inconsistencies with xdotool, but got it too a state where it works almost everytime on my machine...
I noticed that xdotool sometimes fails to paste if I have not specifically focused a text field, is the auto-paste failing even when a text field is properly selected?
Otherwise it could be that on your machine sometime the window takes too much time to close, and xdotool gets triggered before it has been closed
Something to test that could solve the issue:
- Use
xdotool type emojiinstead ofxdtool key ctrl+v, that might help with auto-focus of text field? - Look into adding a wait before triggering the paste to make sure the window is closed
But since I cannot reproduce the problem myself, it will be hard to test, so I will need you @vpsone :) I'll let you know when I have the time to make the changes, test them, and push a new version, so you can try it and tell me if it is improved
On another note, I have a small question: after xdotool is ran through EmojiMart I lose the emoji that was just selected (either I get the previous item in the clipboard, or clipboard cleared). Are you also having this behavior, or do you have the selected emoji in your clipboard after your emoji get auto-pasted by xdotool?
I will definitely help to test the new version and I always have selected emoji in my clipboard but it didn't get auto-pasted.
I have tried the current version of the app, and now the auto-paste feature works more often than the previous version, but it is not working perfectly.
Hi @vpsone , thanks for the feedback!
I have the same behavior too, "60% of the time it works everytime" ...
I wonder if it is just a question of playing with the wait in between hiding the window and running xdotool... Since I just added 50ms of wait, and now it works a bit better... But I am not really keen on adding a lot of wait time, I can already see the window freezing almost half a second when I pick an emoji
There are a lot of pending development that might help us to improve the system though:
- Upgrading to the next tauri major version (still in alpha) which use a new system for the clipboard: https://github.com/tauri-apps/tauri/issues/7345
- Waiting for the compatibility between Enigo and Tauri to be resolved (cf. https://github.com/enigo-rs/enigo/issues/15 and https://github.com/tauri-apps/tauri/issues/6421)
- Using libei: once it has been implemented by mutter: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628 and merged to flatpak https://github.com/flatpak/xdg-desktop-portal/pull/762 it is developed for wayland, but Mutter support wayland and x11, so it might also work on x11 (did not dug too much, so not sure at all)
I'll try other things out when I have the time and will let you know!
accidentally stumbled across this issue:
but Mutter support wayland and x11, so it might also work on x11 (did not dug too much, so not sure at all)
Xwayland as of this PR supports libei and the xdg-desktop-portal, so an unmodified xdotool under Wayland will connect to Xwayland which will then use the portal to get a libei connection from mutter. It will then convert the XTest events to libei events, so xdotool will work unmodified - at least for pointer/keyboard events.
I am not sure if it is related to the app or IntelliJ, but for me, the automatically pasted emojis appear as "weird" characters, but when I then manually paste the emoji, it is inserted as expected :man_shrugging: For other apps, e.g., Sublime, Text editor, browsers, it's working just fine :1st_place_medal:
οΎπΎ ο€π€ οπ
OS: Ubuntu 22.04.3 LTS x86_64
Kernel: 6.2.0-33-generic
DE: Gnome 42.9
WM: X11
IntelliJ IDEA 2023.2.3 (Ultimate Edition)
Build #IU-232.10072.27, built on October 11, 2023