From 7baee200fbbd56569876ae57c4e057a1458ed880 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Mon, 16 Nov 2026 23:53:11 -0500 Subject: [PATCH] use remote stevia --- flake.lock | 18 ++++++++++ flake.nix | 4 +++ modules/mobile/niri.nix | 17 ++++++--- .../mobile/stevia-optional-device-state.patch | 22 ------------ modules/mobile/stevia-reshow-on-tap.patch | 35 ------------------- 5 files changed, 34 insertions(+), 62 deletions(-) delete mode 100644 modules/mobile/stevia-optional-device-state.patch delete mode 100644 modules/mobile/stevia-reshow-on-tap.patch diff --git a/flake.lock b/flake.lock index 394c0d2..877eff4 100644 --- a/flake.lock +++ b/flake.lock @@ -1253,6 +1253,7 @@ "run0-sudo-shim": "run0-sudo-shim", "sable": "sable", "sable-next": "sable-next", + "stevia-mobile": "stevia-mobile", "stylix": "stylix", "wrapper-manager": "wrapper-manager" } @@ -1374,6 +1375,23 @@ "url": "https://git.sable.moe/SableClient/sable-next" } }, + "stevia-mobile": { + "flake": false, + "locked": { + "lastModified": 1794890246, + "narHash": "sha256-l/7hLzzMnjCiy2M5pPrCbHS1qOIYv9Q+D7rS+y8K4xQ=", + "ref": "quad/mobile", + "rev": "6008f299dd78270e132dbb26f64adfa3c53885e3", + "revCount": 1348, + "type": "git", + "url": "https://gitlab.gnome.org/Henry-Hiles/stevia" + }, + "original": { + "ref": "quad/mobile", + "type": "git", + "url": "https://gitlab.gnome.org/Henry-Hiles/stevia" + } + }, "stylix": { "inputs": { "base16": "base16", diff --git a/flake.nix b/flake.nix index d5dbbe0..4bfc9f3 100755 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,10 @@ url = "github:Henry-Hiles/niri/quad/mobile"; inputs.nixpkgs.follows = "nixpkgs"; }; + stevia-mobile = { + url = "git+https://gitlab.gnome.org/Henry-Hiles/stevia?ref=quad/mobile"; + flake = false; + }; nixphone = { url = "git+https://codeberg.org/nixphone/nixphone"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/mobile/niri.nix b/modules/mobile/niri.nix index b19231d..b8046a7 100644 --- a/modules/mobile/niri.nix +++ b/modules/mobile/niri.nix @@ -17,11 +17,18 @@ let swayosd-client = lib.getExe' pkgs.swayosd "swayosd-client"; stevia = pkgs.stevia.overrideAttrs (old: { - 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 + version = "quad-mobile-${inputs.stevia-mobile.shortRev}"; + src = inputs.stevia-mobile; + # Needed by newer Stevia than nixpkgs has + buildInputs = old.buildInputs ++ [ + pkgs.gsettings-desktop-schemas + pkgs.gst_all_1.gstreamer + pkgs.gst_all_1.gst-plugins-base + pkgs.libsoup_3 + ]; + mesonFlags = old.mesonFlags ++ [ + "-Duim=disabled" + "-Dgovarnam=disabled" ]; }); diff --git a/modules/mobile/stevia-optional-device-state.patch b/modules/mobile/stevia-optional-device-state.patch deleted file mode 100644 index b0cbbcb..0000000 --- a/modules/mobile/stevia-optional-device-state.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/src/pos-hw-tracker.c -+++ b/src/pos-hw-tracker.c -@@ -72,7 +72,9 @@ - gpointer device_state) - { - self->device_state = device_state; -- zphoc_device_state_v1_add_listener (self->device_state, &device_state_listener, self); -+ /* Only phoc has the device state protocol. Without it, assume there is no hardware keyboard. */ -+ if (self->device_state) -+ zphoc_device_state_v1_add_listener (self->device_state, &device_state_listener, self); - } - - ---- a/src/pos-wayland.c -+++ b/src/pos-wayland.c -@@ -387,6 +387,5 @@ - self->zwlr_foreign_toplevel_manager_v1 && - self->layer_shell && - self->zxdg_output_manager_v1 && -- self->zphoc_device_state_v1 && - self->wlr_data_control_manager); - } diff --git a/modules/mobile/stevia-reshow-on-tap.patch b/modules/mobile/stevia-reshow-on-tap.patch deleted file mode 100644 index 3f6f7de..0000000 --- a/modules/mobile/stevia-reshow-on-tap.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- 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 ||