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<()> {
1090
                             None
1090
                             None
1091
                         };
1091
                         };
1092
 
1092
 
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
+
1093
                         // Check if we should trigger based on dwell time and movement
1102
                         // Check if we should trigger based on dwell time and movement
1094
                         if let Some(edge_dir) = at_edge {
1103
                         if let Some(edge_dir) = at_edge {
1095
                             // Only care about edges with neighbors
1104
                             // Only care about edges with neighbors
@@ -1122,8 +1131,8 @@ async fn run_daemon(config_path: &std::path::Path) -> anyhow::Result<()> {
1122
                                                 if has_peer {
1131
                                                 if has_peer {
1123
                                                     // Check if we're in ReceivedControl state from this direction
1132
                                                     // Check if we're in ReceivedControl state from this direction
1124
                                                     let current_state = transfer_manager.state().await;
1133
                                                     let current_state = transfer_manager.state().await;
1125
-                                                    if let transfer::TransferState::ReceivedControl { from, .. } = current_state {
1134
+                                                    if let transfer::TransferState::ReceivedControl { from, .. } = &current_state {
1126
-                                                        if from == edge_dir {
1135
+                                                        if *from == edge_dir {
1127
                                                             info!(
1136
                                                             info!(
1128
                                                                 "CURSOR EDGE: {:?} at ({}, {}) - returning control",
1137
                                                                 "CURSOR EDGE: {:?} at ({}, {}) - returning control",
1129
                                                                 edge_dir, cx, cy
1138
                                                                 edge_dir, cx, cy
@@ -1133,7 +1142,17 @@ async fn run_daemon(config_path: &std::path::Path) -> anyhow::Result<()> {
1133
                                                             }
1142
                                                             }
1134
                                                             edge_dwell_start = None;
1143
                                                             edge_dwell_start = None;
1135
                                                             continue;
1144
                                                             continue;
1145
+                                                        } else {
1146
+                                                            tracing::debug!(
1147
+                                                                "CURSOR EDGE: {:?} - ReceivedControl from {:?}, not matching",
1148
+                                                                edge_dir, from
1149
+                                                            );
1136
                                                         }
1150
                                                         }
1151
+                                                    } else {
1152
+                                                        tracing::debug!(
1153
+                                                            "CURSOR EDGE: {:?} - state is {:?}, not ReceivedControl",
1154
+                                                            edge_dir, current_state
1155
+                                                        );
1137
                                                     }
1156
                                                     }
1138
 
1157
 
1139
                                                     // Check cooldown to prevent bounce-back
1158
                                                     // Check cooldown to prevent bounce-back