os_gfx -> report mouse move events; still allow passive mouse interaction if window is unfocused, but have recently received mousemove events

This commit is contained in:
Ryan Fleury
2024-02-03 18:04:21 -08:00
parent 985a6f37e9
commit 0be4680ec9
7 changed files with 29 additions and 5 deletions
+9 -1
View File
@@ -2881,8 +2881,16 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
icon_info.icon_kind_text_map[UI_IconKind_CheckFilled] = df_g_icon_kind_text_table[DF_IconKind_CheckFilled];
}
// rjf: form mouse position used for passive UI mouse interaction
Vec2F32 mouse_ui = os_mouse_from_window(ws->os);
if(!os_window_is_focused(ws->os) &&
df_gfx_state->last_time_mousemoved_us+500000 <= os_now_microseconds())
{
mouse_ui = v2f32(-100, -100);
}
// rjf: begin & push initial stack values
ui_begin_build(events, ws->os, &nav_actions, &icon_info, df_dt(), df_dt());
ui_begin_build(events, mouse_ui, ws->os, &nav_actions, &icon_info, df_dt(), df_dt());
ui_push_font(main_font);
ui_push_font_size(main_font_size);
ui_push_pref_width(ui_em(20.f, 1));
+1
View File
@@ -689,6 +689,7 @@ struct DF_GfxState
// rjf: frame request state
U64 num_frames_requested;
U64 last_time_mousemoved_us;
// rjf: history cache
DF_StateDeltaHistory *hist;