Skip to content

Commit 10e3f89

Browse files
MagicalTuxclaude
andcommitted
Implement stub handlers and add focus/cursor/pointer tracking
- Implement SetInputFocus, GetInputFocus, FreeGC, ClearArea, QueryPointer, TranslateCoordinates, CreateGlyphCursor, CreateCursor, and FreeCursor handlers - Fix QueryTree to use actual window parent/children hierarchy - Add focused_window, cursor map, and pointer position tracking to Server struct with proper coordinate translation - Update ChangeWindowAttributes to apply cursors via backend - Track pointer position from motion/button/enter events - Fix unused variable warnings in macOS backend - Fix formatting issues flagged by cargo fmt - Add XOR fill function support in macOS Swift backend Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9bf3aa9 commit 10e3f89

File tree

5 files changed

+507
-176
lines changed

5 files changed

+507
-176
lines changed

src/backend/macos.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ extern "C" {
8585
r: f32,
8686
g: f32,
8787
b: f32,
88+
gc_function: i32,
8889
) -> i32;
8990
fn macos_backend_draw_line(
9091
handle: BackendHandle,
@@ -726,6 +727,7 @@ impl Backend for MacOSBackend {
726727
r,
727728
g,
728729
b,
730+
gc.function as i32,
729731
);
730732

731733
Ok(())
@@ -1272,8 +1274,8 @@ impl MacOSBackend {
12721274
window_id: i32,
12731275
x: i32,
12741276
y: i32,
1275-
width: i32,
1276-
height: i32,
1277+
_width: i32,
1278+
_height: i32,
12771279
keycode: i32,
12781280
button: i32,
12791281
state: i32,

src/server/extensions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,7 +1987,7 @@ fn encode_xkb_get_map_reply(sequence: u16) -> Vec<u8> {
19871987
buffer[1] = 0; // deviceID (use core keyboard)
19881988
buffer[2..4].copy_from_slice(&write_u16_le(sequence));
19891989
buffer[4..8].copy_from_slice(&write_u32_le(2)); // length: 8 extra bytes = 2 words
1990-
// Bytes 8-9: pad
1990+
// Bytes 8-9: pad
19911991
buffer[10] = 8; // minKeyCode (standard)
19921992
buffer[11] = 255; // maxKeyCode (standard)
19931993
buffer[12..14].copy_from_slice(&write_u16_le(0)); // present (no components)
@@ -1997,7 +1997,7 @@ fn encode_xkb_get_map_reply(sequence: u16) -> Vec<u8> {
19971997
buffer[18] = 8; // firstKeySym
19981998
buffer[19] = 0; // totalSyms (high byte)
19991999
buffer[20] = 0; // nKeySyms
2000-
// Rest of the header fields are 0 (no key actions, behaviors, etc.)
2000+
// Rest of the header fields are 0 (no key actions, behaviors, etc.)
20012001
buffer
20022002
}
20032003

0 commit comments

Comments
 (0)