fix(ascii_composer): Fix good old caps lock behavior#1011
fix(ascii_composer): Fix good old caps lock behavior#1011lotem merged 1 commit intorime:masterfrom heiher:fix-good-old-caps-lock
Conversation
Recent version of GNOME inspect how input methods handle the Caps Lock key. If the key event is consumed by the input method, the desktop environment no longer toggles the Caps Lock state, which can lead to unexpected behavior. This patch allows the Caps Lock key event to pass through the input method when `good_old_caps_lock` is enabled, restoring the expected toggle behavior. Fixes rime/ibus-rime#171
|
Filtering out Caps Lock key events in an input method can prevent GUI applications from detecting changes in the Caps Lock state. For example, in the following example, the Caps Lock warning in a GTK3 /*
* gcc -o gtk3-entry gtk3-entry.c `pkg-config --cflags --libs gtk+-3.0`
*/
#include <gtk/gtk.h>
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *entry;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
entry = gtk_entry_new ();
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_container_add (GTK_CONTAINER (window), entry);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}Works well (Caps lock warning is shown) without ibus-rime: Doesn't work properly (Caps lock warning is not shown) with ibus-rime: |
|
RFR @lotem Thanks |
|
Maybe we should always return I cannot remember the specific reason why these events are reported as such, maybe because they conceptually are "processed by the IME" as hotkeys. |
|
This change can affect other platforms in unexpected ways. Please help verify. The code comments in |
|
I don't know how good old caps lock works, and how to test this. |
IIRC, the
|
When |
with ci output
|
|
保守修改,應該能行,發現問題再說吧。 |


Pull request
Issue tracker
Fixes rime/ibus-rime#171
Feature
Recent version of GNOME inspect how input methods handle the Caps Lock key. If the key event is consumed by the input method, the desktop environment no longer toggles the Caps Lock state, which can lead to unexpected behavior.
This patch allows the Caps Lock key event to pass through the input method when
good_old_caps_lockis enabled, restoring the expected toggle behavior.Unit test
Manual test
Code Review
Additional Info