Always allow sending messages by enter even with IMEs

Qt.inputMethod.visible is true in kwin_wayland when maliit is enabled and activated,
however kwin does not actually show maliit w/o touch input [1].

Moreover, having send by enter might still be desired even for virtual keyboards.

Remove the check for virtual keyboards as suggested by @deepbluev7,
people could still use Settings.invertEnterKey for newlines.

[1]: https://invent.kde.org/plasma/kwin/-/blob/v6.1.4/src/inputmethod.cpp?ref_type=tags#L185
This commit is contained in:
q234rty 2024-08-14 16:32:51 +08:00
parent c8c3d1c611
commit 87cb63e1fd
No known key found for this signature in database
GPG key ID: D7E83C63C8CC4545

View file

@ -173,7 +173,7 @@ Rectangle {
} else if (event.matches(StandardKey.InsertLineSeparator)) { } else if (event.matches(StandardKey.InsertLineSeparator)) {
if (popup.opened) if (popup.opened)
popup.close(); popup.close();
if (Settings.invertEnterKey && (!Qt.inputMethod.visible || Qt.platform.os === "windows")) { if (Settings.invertEnterKey) {
room.input.send(); room.input.send();
event.accepted = true; event.accepted = true;
} }
@ -195,7 +195,7 @@ Rectangle {
return; return;
} }
} }
if (!Settings.invertEnterKey && (!Qt.inputMethod.visible || Qt.platform.os === "windows")) { if (!Settings.invertEnterKey) {
room.input.send(); room.input.send();
event.accepted = true; event.accepted = true;
} }