Commitb5f6c14dRecorded29 Oct 2026Repositorysigil-wm

Merge lock pointer routing and first presentation timing

Changed
 src/c/host.c | 3 ++-
 src/c/lock.h | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)
Diff

A merge. Shown against its first parent, so this is the effect of merging rather than the work of the branch.

src/c/host.cmodified
@@ -124,7 +124,7 @@ static struct {
124
bool terminal_delivered;
125
atomic_int state;
126
atomic_uint_fast64_t frames, objects, overflow, rejected, bytes, pixel_nodes, pixel_drops, saved_trees, snapshots;
−127
atomic_uint_fast64_t input_expired,motion_coalesced,timer_wakes;
+127
atomic_uint_fast64_t input_expired,motion_coalesced,timer_wakes,first_present_ms;
128
atomic_bool input_resync;
129
char socket[64],requested_socket[64];
130
int64_t protocols,request_deadline;
@@ -2603,6 +2603,7 @@ uint64_t wm_stat(int which) {
2603
case 10: return atomic_load(&bridge.input_expired);
2604
case 11: return atomic_load(&bridge.motion_coalesced);
2605
case 12: return atomic_load(&bridge.timer_wakes);
+2606
case 13: return atomic_load(&bridge.first_present_ms);
2607
default: return UINT64_MAX;
2608
}
2609
}
src/c/lock.hmodified
@@ -44,12 +44,15 @@ static void lock_ack(struct server *s) {
44
static void lock_present(struct wl_listener *listener,void *data) {
45
struct output *o=wl_container_of(listener,o,lock_present);
46
struct wlr_output_event_present *e=data;
+47
uint64_t unset=0;
+48
if(e->presented) atomic_compare_exchange_strong(&bridge.first_present_ms,&unset,now_ms());
49
if(trace_output_present(&o->trace,e->commit_seq,o->id,e->presented,&e->when)) wake(bridge.event_fd);
50
layer_output_present(o, e);
51
if(!o->server->lock_state || !e->presented || !o->lock_armed ||
52
o->lock_generation!=o->server->lock_generation ||
53
(int32_t)(e->commit_seq-o->lock_commit)<0) return;
54
o->lock_presented=true; o->lock_armed=false;
+55
route_motion(o->server,now_ms(),false);
56
lock_ack(o->server);
57
}
58
static void lock_arm(struct output *o) {
@@ -134,6 +137,7 @@ static void lock_map(struct wl_listener *listener,void *data) {
137
wlr_scene_node_set_enabled(&surface->tree->node,true);
138
if(surface->output) lock_configure(surface->output);
139
lock_focus_available(surface->server);
+140
route_motion(surface->server,now_ms(),false);
141
EVENT(64,surface->id,surface->output ? surface->output->id : 0,surface->server->lock_generation,1);
142
}
143
static void lock_unmap(struct wl_listener *listener,void *data) {
@@ -143,6 +147,7 @@ static void lock_unmap(struct wl_listener *listener,void *data) {
147
if(surface->server->seat->keyboard_state.focused_surface==surface->native->surface)
148
lock_clear_input(surface->server);
149
lock_focus_available(surface->server);
+150
route_motion(surface->server,now_ms(),false);
151
EVENT(64,surface->id,surface->output ? surface->output->id : 0,surface->server->lock_generation,0);
152
}
153
static void lock_surface_destroy(struct wl_listener *listener,void *data) {