add new stevia patch

This commit is contained in:
Henry Hiles 2026-11-16 19:55:39 -05:00
commit 9ed2241b31
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 41 additions and 2 deletions

View file

@ -31,9 +31,13 @@ let
swayosd-client = lib.getExe' pkgs.swayosd "swayosd-client"; swayosd-client = lib.getExe' pkgs.swayosd "swayosd-client";
# Stevia normally needs a phoc-only protocol to start.
stevia = pkgs.stevia.overrideAttrs (old: { stevia = pkgs.stevia.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ./stevia-optional-device-state.patch ]; patches = (old.patches or [ ]) ++ [
# Stevia normally needs a phoc-only protocol to start.
./stevia-optional-device-state.patch
# Bring back stevia on textfield re-focus
./stevia-reshow-on-tap.patch
];
}); });
lock = pkgs.writeShellScript "lock" '' lock = pkgs.writeShellScript "lock" ''

View file

@ -0,0 +1,35 @@
--- a/src/pos-input-method.c
+++ b/src/pos-input-method.c
@@ -62,6 +62,8 @@
PosImState *submitted;
guint serial;
+ /* Activated again while already active, e.g. after tapping a focused text field. */
+ gboolean reactivated;
};
G_DEFINE_TYPE (PosInputMethod, pos_input_method, G_TYPE_OBJECT)
@@ -93,8 +95,11 @@
g_debug ("%s", __func__);
- if (self->pending->active == TRUE)
+ /* Let the keyboard show itself again if it was hidden by the user. */
+ if (self->pending->active == TRUE) {
+ self->reactivated = TRUE;
return;
+ }
self->pending->active = TRUE;
g_clear_pointer (&self->pending->surrounding_text, g_free);
@@ -194,8 +199,9 @@
self->submitted = pos_im_state_dup (self->pending);
- if (current->active != self->submitted->active)
+ if (current->active != self->submitted->active || self->reactivated)
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ACTIVE]);
+ self->reactivated = FALSE;
if (g_strcmp0 (current->surrounding_text, self->submitted->surrounding_text) ||
current->cursor != self->submitted->cursor ||