tenseleyflow/hyprkvm / ca11bc3

Browse files

debug: add logging for Up/Down edge detection troubleshooting

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
ca11bc3807a56c8fe960d1a9e5d3b36d21adbab8
Parents
e7c88f9
Tree
9699077

1 changed file

StatusFile+-
M hyprkvm-daemon/src/main.rs 21 2
hyprkvm-daemon/src/main.rsmodified
@@ -1090,6 +1090,15 @@ async fn run_daemon(config_path: &std::path::Path) -> anyhow::Result<()> {
10901090
                             None
10911091
                         };
10921092
 
1093
+                        // Debug: Log when cursor is at Up/Down edge
1094
+                        if matches!(at_edge, Some(Direction::Up) | Some(Direction::Down)) {
1095
+                            let current_state = transfer_manager.state().await;
1096
+                            tracing::debug!(
1097
+                                "CURSOR at {:?} edge: pos=({}, {}), bounds=(0,0)-({}x{}), state={:?}, enabled_edges={:?}",
1098
+                                at_edge, cx, cy, screen_width, screen_height, current_state, enabled_edges
1099
+                            );
1100
+                        }
1101
+
10931102
                         // Check if we should trigger based on dwell time and movement
10941103
                         if let Some(edge_dir) = at_edge {
10951104
                             // Only care about edges with neighbors
@@ -1122,8 +1131,8 @@ async fn run_daemon(config_path: &std::path::Path) -> anyhow::Result<()> {
11221131
                                                 if has_peer {
11231132
                                                     // Check if we're in ReceivedControl state from this direction
11241133
                                                     let current_state = transfer_manager.state().await;
1125
-                                                    if let transfer::TransferState::ReceivedControl { from, .. } = current_state {
1126
-                                                        if from == edge_dir {
1134
+                                                    if let transfer::TransferState::ReceivedControl { from, .. } = &current_state {
1135
+                                                        if *from == edge_dir {
11271136
                                                             info!(
11281137
                                                                 "CURSOR EDGE: {:?} at ({}, {}) - returning control",
11291138
                                                                 edge_dir, cx, cy
@@ -1133,7 +1142,17 @@ async fn run_daemon(config_path: &std::path::Path) -> anyhow::Result<()> {
11331142
                                                             }
11341143
                                                             edge_dwell_start = None;
11351144
                                                             continue;
1145
+                                                        } else {
1146
+                                                            tracing::debug!(
1147
+                                                                "CURSOR EDGE: {:?} - ReceivedControl from {:?}, not matching",
1148
+                                                                edge_dir, from
1149
+                                                            );
11361150
                                                         }
1151
+                                                    } else {
1152
+                                                        tracing::debug!(
1153
+                                                            "CURSOR EDGE: {:?} - state is {:?}, not ReceivedControl",
1154
+                                                            edge_dir, current_state
1155
+                                                        );
11371156
                                                     }
11381157
 
11391158
                                                     // Check cooldown to prevent bounce-back