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

Espanso Freezes the entire desktop when expanding a match #237

Closed
Luctins opened this issue Apr 14, 2020 · 20 comments
Closed

Espanso Freezes the entire desktop when expanding a match #237

Luctins opened this issue Apr 14, 2020 · 20 comments
Labels
bug Something isn't working Linux Related to the Linux operating system

Comments

@Luctins
Copy link

Luctins commented Apr 14, 2020

Every time espanso finds a matching expansion I cannot interact with the desktop for 5-10 seconds, but the mouse cursor still moves.
Most of the time this happens the trigger text is not completely erased.
Espanso's own logs and journalctl were of not much use debugging this.
Tried using clipboard, auto and inject for the backend; same result.

Info:
pt-br keyboard layout

sb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic

gnome-shell --version
GNOME Shell 3.28.4

echo $XDG_SESSION_TYPE 
x11

espanso dump
config.txt

@federico-terzi
Copy link
Collaborator

Hey @Luctins,

That is pretty strange indeed, thanks for pointing it out! Some questions for you:

  • How many matches/packages have you installed?
  • Could you please try the following procedure and see if that helps?
    Switch to a US keyboard layout, restart espanso, type any match.

Let me know if you experience problems in that case as well.

Cheers :)

@Luctins
Copy link
Author

Luctins commented Apr 14, 2020

examples:
On gedit:
espanso-bug
on firefox:
espanso-bug2 gif

@federico-terzi federico-terzi added bug Something isn't working Linux Related to the Linux operating system labels Apr 14, 2020
@Luctins
Copy link
Author

Luctins commented Apr 14, 2020

I use:

espanso package list
basic-emojis - 0.1.0
shruggie - 0.1.0

@Luctins
Copy link
Author

Luctins commented Apr 14, 2020

Uninstalled all packages and tested again, same result;
Also tested with all gnome-extensions disabled, same result;

@Luctins
Copy link
Author

Luctins commented Apr 14, 2020

tested with US keyboard: could not interact with the desktop, and the "shell error tone" was played in quick sucession, could not recover desktop.

@federico-terzi
Copy link
Collaborator

tested with US keyboard: could not interact with the desktop, and the "shell error tone" was played in quick sucession, could not recover desktop.

That is very strange @Luctins, I'm sorry you experienced these issues. Are you using a stock Ubuntu installation?

@Luctins
Copy link
Author

Luctins commented Apr 14, 2020

thanks for taking the time to help 😄.
The only major modification that I recall was uninstalling the nouveau driver (It's a hybrid graphics laptop).
Edit: added lshw output.
log.txt

@Luctins Luctins changed the title Espanso Freezes the entire desktop when expanding a match is found Espanso Freezes the entire desktop when expanding a match Apr 14, 2020
@federico-terzi
Copy link
Collaborator

All right, thank you. I'll try to reproduce this myself and get back to you if I find something :)

@federico-terzi
Copy link
Collaborator

Hey @Luctins,

I was able to reproduce the issue, and after a lot of digging it seems to be a problem related to Gnome with some keyboard layouts, including the pt-br that you are using. (See https://bugs.launchpad.net/ubuntu/+source/meta-gnome3/+bug/1777708)

In the above post, it explains a workaround:

With admin rights, edit the /usr/share/X11/xkb/symbols/br and comment out this line:

modifier_map Mod3 { Scroll_Lock };

so that it becomes:

//modifier_map Mod3 { Scroll_Lock };

Then reboot the system. Espanso should be a lot more responsive by then.

Let me know if that helps!

Cheers :)

@Luctins
Copy link
Author

Luctins commented Apr 17, 2020

Wow, that's a not very obvious issue to track down.
As you have suggested I do have 2 keyboards (It's a laptop with a USB keyboard plugged in).
Applied the suggested modification and it seems to do it, Thanks 😄.

as a bonus, probably will make my desktop more stable overall (I was having mini freezes from time to time for a while now).
Close the issue?

@federico-terzi
Copy link
Collaborator

You're welcome :)
I'm going to close the issue now, let me know if you have other doubts

Cheers

@xnhp
Copy link

xnhp commented Jul 13, 2021

Hi,

I am having a similar issue. However, I am on windows and use the default (german) keyboard layout.

After entering a trigger pattern, all inputs arrive extremely slowly and the trigger pattern is removed and the replacement inserted sluggishly over the next ~6 seconds.

I did not make any real customisations; this is my config:

# espanso configuration file

# This is the default configuration file, change it as you like it
# You can refer to the official documentation:
# https://espanso.org/docs/

# Change the key used to toggle espanso active mode
toggle_key: "OFF"

# Matches are the substitution rules, when you type the "trigger" string
# it gets replaced by the "replace" string.

matches:
  # Simple text replacement
  - trigger: ":espanso"
    replace: "Hi there!"

  - trigger: ".ra"
    replace: "→"

  - trigger: ".dra"
    replace: "⇒"

  - trigger: ".cf"
    replace: "↝"

  - trigger: ".--"
    replace: "—"

  - trigger: ";b"
    replace: " •"

  - trigger: ".phi"
    replace: "ϕ"

  - trigger: ".ck"
    replace: "✓"

  # Dates
  - trigger: ":date"
    replace: "{{mydate}}"
    vars:
      - name: mydate
        type: date
        params:
          format: "%m/%d/%Y"

  # Shell commands
  - trigger: ":shell"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd:  "echo Hello from your shell"

Any ideas?

Best,
Ben

@federico-terzi
Copy link
Collaborator

Hey @xnhp,

I'm sorry you experienced this problem! Does it happen on every application? This sounds strange because espanso is usually pretty snappy on Windows

Cheers :)

@xnhp
Copy link

xnhp commented Jul 14, 2021

Heyo, thanks for the quick reply.

The issue seems unrelated to Espanso. I could observe the same issue in some specific cases of autocompletion by PyCharm. Or maybe anytime if a sequence of characters is entered in quick succession.

In any case, a reboot seems to have fixed it for now. I'll report back if this ever becomes relevant again.

Thanks anyway.

@federico-terzi
Copy link
Collaborator

Sounds good! Thank you for the follow up :)

@arcstur
Copy link

arcstur commented Sep 15, 2021

Hello, I'm having the same issue. Replacement takes longer than 2 seconds. I also use pt-br layout, but it happens in the same way with the en layout. I tried commenting out in the "br" file as above, it made it a little bit faster, but still is taking around 2 seconds.

The thing is, this is happening on Zorin Os 16, but is NOT happening in Boddhi Linux 6.

In Boddhi Linux, the replacements are made in a fraction of a second, every single one.

In Zorin, the replacements with no "special characters" are made in a fraction of a second, but the replacements which contain letters with diacritcs, like ê (which is in my name), á, é, or an emoji 🌎 , are freezing the desktop.

@arcstur
Copy link

arcstur commented Sep 15, 2021

I tried with Zorin Os Lite, which uses XFCE, and it doesn't freeze. So it should be something with GNOME indeed.

@federico-terzi
Copy link
Collaborator

@arcstur Interesting! Thank you for reporting

Given that the upcoming v2 (#594) comes with a brand new engine, we might want to wait for it to see if the problem persists, and then tackle the problem again if so :)

@xnhp
Copy link

xnhp commented Oct 4, 2021

If you want to hear something wild: I've been using Espanso for a while now and the freezes really only occur when Emacs is running. Mind, not necessarily inputting into Emacs, but whenever Emacs is running at all and when inputting anywhere.

@federico-terzi
Copy link
Collaborator

@xnhp That's interesting, thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Linux Related to the Linux operating system
Projects
None yet
Development

No branches or pull requests

4 participants