tenseleyflow/hyprkvm / 3d82f64

Browse files

fix: set cooldown after RECOVERY movefocus to prevent immediate transfer

When RECOVERY does movefocus (because we're not at edge), Hyprland fires
an IPC Move callback. If movefocus moved us to the edge window, IPC Move
would see at_edge=true and initiate a transfer, causing a single
Super+Arrow to both move focus AND transfer.

Set last_control_return after RECOVERY movefocus so the IPC Move callback
hits the cooldown and skips transfer initiation.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
3d82f64d9b1fbfc26af62e4b50bd4371adebda11
Parents
c9a8dd6
Tree
96fa18d

1 changed file

StatusFile+-
M hyprkvm-daemon/src/main.rs 7 1
hyprkvm-daemon/src/main.rsmodified
@@ -986,7 +986,13 @@ async fn run_daemon(config_path: &std::path::Path) -> anyhow::Result<()> {
986986
                                 };
987987
                                 info!("RECOVERY HOTKEY: Not at edge, doing movefocus {} (libinput dropped the keypress)", hypr_dir);
988988
                                 match hypr_client.dispatch("movefocus", hypr_dir).await {
989
-                                    Ok(()) => info!("  RECOVERY movefocus succeeded"),
989
+                                    Ok(()) => {
990
+                                        info!("  RECOVERY movefocus succeeded");
991
+                                        // Set cooldown to prevent the IPC Move callback from initiating transfer
992
+                                        // (Hyprland fires IPC Move after movefocus, which would see at_edge=true
993
+                                        // after we moved to the edge window)
994
+                                        last_control_return = Some(std::time::Instant::now());
995
+                                    }
990996
                                     Err(e) => tracing::error!("  RECOVERY movefocus failed: {}", e),
991997
                                 }
992998
                             } else {