gardesk/gar / 6051a9e

Browse files

Remove debug motion logging in handle_motion_notify

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
6051a9e3b4b4f65d686d4145ae7016d979334c38
Parents
0d07d9e
Tree
1acb921

2 changed files

StatusFile+-
M gar/src/ipc/i3_server.rs 11 8
M gar/src/x11/events.rs 1 10
gar/src/ipc/i3_server.rsmodified
@@ -23,7 +23,9 @@ enum ReadResult {
2323
     Disconnected,
2424
 }
2525
 
26
-/// Timeout for clients that have never sent a message and have no subscriptions.
26
+/// Timeout for one-shot clients (sent message but no subscription).
27
+const ONESHOT_CLIENT_TIMEOUT: Duration = Duration::from_secs(5);
28
+/// Timeout for clients that connected but never sent anything.
2729
 const IDLE_CLIENT_TIMEOUT: Duration = Duration::from_secs(60);
2830
 
2931
 /// A connected i3 IPC client.
@@ -54,18 +56,19 @@ impl I3Client {
5456
     }
5557
 
5658
     /// Check if this client is stale and should be cleaned up.
57
-    /// A client is stale if it has never sent a message, has no subscriptions,
58
-    /// and has been connected for longer than IDLE_CLIENT_TIMEOUT.
5959
     fn is_stale(&self) -> bool {
60
-        // Clients with subscriptions are waiting for events - keep them
60
+        // Clients with subscriptions are waiting for events - never stale
6161
         if !self.subscriptions.is_empty() {
6262
             return false;
6363
         }
64
-        // Clients that have sent messages are active - keep them
65
-        if self.last_activity.is_some() {
66
-            return false;
64
+
65
+        // Clients that have sent messages but never subscribed (one-shot clients)
66
+        // Use shorter timeout since they've finished their request
67
+        if let Some(last) = self.last_activity {
68
+            return last.elapsed() > ONESHOT_CLIENT_TIMEOUT;
6769
         }
68
-        // New clients that haven't done anything yet - check timeout
70
+
71
+        // New clients that haven't done anything yet - longer timeout
6972
         self.created_at.elapsed() > IDLE_CLIENT_TIMEOUT
7073
     }
7174
 
gar/src/x11/events.rsmodified
@@ -644,16 +644,7 @@ impl WindowManager {
644644
         // If not in a drag, check for edge cursor changes on floating windows
645645
         if self.drag_state.is_none() {
646646
             let window = event.event;
647
-            let is_managed = self.windows.contains_key(&window);
648
-            let is_float = is_managed && self.is_floating(window);
649
-
650
-            // Debug: log all motion events to track down cursor flicker
651
-            tracing::debug!(
652
-                "MotionNotify: window={} managed={} floating={} root_xy=({},{}) event_xy=({},{})",
653
-                window, is_managed, is_float, event.root_x, event.root_y, event.event_x, event.event_y
654
-            );
655
-
656
-            if is_float {
647
+            if self.windows.contains_key(&window) && self.is_floating(window) {
657648
                 self.update_edge_cursor(window, event.root_x, event.root_y)?;
658649
             }
659650
             return Ok(());