gardesk/ers / b6ab4ca

Browse files

JB-style post-creation SetWindowTags (verified ineffective on Tahoe)

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
b6ab4ca2b05e2aaf672498f9f5a9ad17c3944b9e
Parents
24ca1e9
Tree
7ffb488

1 changed file

StatusFile+-
M src/main.rs 17 0
src/main.rsmodified
@@ -1362,6 +1362,23 @@ fn create_overlay(
13621362
         SLSFlushWindowContentRegion(cid, wid, ptr::null());
13631363
         CGContextRelease(ctx);
13641364
 
1365
+        // Post-creation tag mutation matching JankyBorders' pattern
1366
+        // at .refs/JankyBorders/src/misc/window.h:266-267. Verified
1367
+        // ineffective on Tahoe: tags set on windows owned by a
1368
+        // SLSNewConnection-created cid do NOT propagate to the global
1369
+        // server-side tag store, regardless of which cid issues the
1370
+        // SLSSetWindowTags call (tested both fresh and main cid).
1371
+        // The screencaptureui picker queries via _CGSGetWindowTags
1372
+        // from its own connection (otool confirmed) and reads 0x0 for
1373
+        // our overlays. Kept here aligned with JB so the diff is
1374
+        // legible; the actual fix requires creating overlays on the
1375
+        // process main cid (conflicts with the per-border fresh-cid
1376
+        // requirement in ers/CLAUDE.md) or backing them with NSWindow.
1377
+        let mut set_tags: u64 = (1u64 << 1) | (1u64 << 9);
1378
+        let mut clear_tags: u64 = 0;
1379
+        SLSSetWindowTags(cid, wid, &mut set_tags as *mut u64, 64);
1380
+        SLSClearWindowTags(cid, wid, &mut clear_tags as *mut u64, 64);
1381
+
13651382
         Some((cid, wid, bounds, scale))
13661383
     }
13671384
 }