signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.61k stars 2.66k forks source link

`ctrl-2` broken under Wayland #5307

Open RagnarGrootKoerkamp opened 3 years ago

RagnarGrootKoerkamp commented 3 years ago

Bug Description

When running signal-desktop as native Wayland application (under Sway) using

/usr/bin/signal-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland

the ctrl-2 shortcut to switch the active conversation doesn't work.

I wouldn't be surprised if this has something to do with my setup, but given that it does work on slack, I don't think Sway is the problem here.

Steps to Reproduce

  1. Run /usr/bin/signal-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland to launch the app.
  2. Do ctrl-1 to switch to the first conversation.
  3. Do ctrl-2 to switch to the second conversation. This doesn't work.

Actual Result: ctrl-2 is ignored. Nothing seems to happen.

Expected Result: The second conversation is selected.

Screenshots

omitted

Platform Info

Signal Version: 5.3.0

Operating System: Arch; running sway 1.6

Link to Debug Log

https://debuglogs.org/6a263ec931c7200618321d7bd26c029c09b668823cf3b607efbc3f828dfc63c6

scottnonnenberg-signal commented 3 years ago

Is ctrl-2 special in some way on your platform? Our handling of those shortcuts is the same, no matter the number.

RagnarGrootKoerkamp commented 3 years ago

As far as I'm aware ctrl-2 is not special - it's definitely not bound in my sway config, and also works fine in all other applications, both running under XWayland and native Wayland.

My guess is it's got to do with the wayland flags I'm passing, but it's a weird bug.

Anyway, at least this is up here in case someone else runs into it.

hiqua commented 3 years ago

@RagnarGrootKoerkamp can you try with another desktop environment using Wayland? Maybe Gnome?

RagnarGrootKoerkamp commented 3 years ago

Somewhat surprisingly, it's also broken on the fresh Gnome install I did: just like with Sway, ctrl-2 works fine when run via XWayland, but is completely ignored when starting Wayland native signal-desktop with the ozone flags.

hiqua commented 3 years ago

Did you try the other CTRL-1 CTRL-3 etc.? I just remembered that Gnome has some shortcuts for these, I think.

RagnarGrootKoerkamp commented 3 years ago

Yeah, those work fine...

For the record: it's not tied to the particular chat that's currently in second position: after drafting some messages so that those move to the top and another conversation moves to the 2nd position, things are still broken.

This is such a weird bug. Anyway it's not very high priority - probably there's just something in my setup that's acting weird.

baal-zebub commented 3 years ago

Same issue for me on sway 1.6.1 and flatpak, but the second conversation is "Note to Self" - could that somehow be the problem?

hiqua commented 3 years ago

@baal-zebub what happens if you just move it? E.g. archive it.

baal-zebub commented 3 years ago

Well turns out it's not that, I didn't archive it but the other conversation moved to the second place and it doesn't work on it either.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been closed due to inactivity.

x10an14 commented 2 years ago

Can confirm, same bug still present on Sway 1.7, Signal-desktop version 5.42.0

kekkoudesu commented 2 years ago

This issue also occurs for me on the Wayland version of Signal-desktop 5.44.1. Potentially relevant data points:

codewiz commented 2 years ago

This bizarre bug is still present on Signal Desktop 5.51.1.

I'm running the Wayland session of KDE Plasma 5.25.3, and CTRL-2 works fine in other Wayland apps.

codewiz commented 1 year ago

Still present on Signal Desktop 6.2.0 running in GNOME 43.2

RagnarGrootKoerkamp commented 1 year ago

Ok so here is something else I just ran into, that seems completely unrelated but may have the same root cause, and points towards wayland being the issue.

to reproduce:

When running chromium under x (ie without ozone flags), ctrl-2 makes a 2 as expected.

I don't have time to dive into this now, but since this is a javascript site, debugging this may give some further hints at what is wrong.

scottnonnenberg-signal commented 1 year ago

@RagnarGrootKoerkamp So you're saying that running chromium under wayland settings specifically breaks ctrl-2? Wild.

RagnarGrootKoerkamp commented 1 year ago

Ah sorry no, I did test, and ctrl-1/2/3/4 work absolutely fine when using them to change focus to the 1st/2nd/3rd/4th tab.

There really is something deeper going on. Also in the sudoku app, when letters are not enabled, ctrl-2 does simply make a 2. All the stars need to perfectly align to make this bug appear...

codewiz commented 1 year ago

Confirmed: I also get a B when typing ctrl-2 in the Sudoku app, using Chrome under Wayland. Works in Firefox on Wayland.

At least now we know it's not specific to Signal Desktop and not specific to Electron. It probably belongs to the Chromium bug tracker.

RagnarGrootKoerkamp commented 1 year ago

Thanks for confirming!

Did some logging of javascript events, and it turns out that key is Unidentified for ctrl-2, but eg 1 for digits. Everything else in th events looks the same.

Event KeyboardEvent {isTrusted: true, key: '1', code: 'Digit1', location: 0, ctrlKey: true, …}
Event KeyboardEvent {isTrusted: true, key: 'Unidentified', code: 'Digit2', location: 0, ctrlKey: true, …}
Event KeyboardEvent {isTrusted: true, key: '3', code: 'Digit3', location: 0, ctrlKey: true, …}
Event KeyboardEvent {isTrusted: true, key: '4', code: 'Digit4', location: 0, ctrlKey: true, …}

Googling that actually gives one other person with the same issue: https://discuss.prosemirror.net/t/chrome-os-keyboard-event-key-is-unidentified/2317

So yes, this appears to be a chromium issue.

RagnarGrootKoerkamp commented 1 year ago

Another way to reproduce: type ctrl-1/2/3 into the box on this page: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code

it will switch tabs, but when you go back, you can see that only ctrl-2 has key="unidentified"

RagnarGrootKoerkamp commented 1 year ago

Chromium issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1410732

RagnarGrootKoerkamp commented 1 year ago

The issue was probably fixed in chromium. But will probably take some time to be released.