Skip to content

changed window state config update - #15299

Merged
Nir-Az merged 2 commits into
realsenseai:developmentfrom
Binyaminp:viewer-window-flush
Jul 7, 2026
Merged

Nir-Az merged 2 commits into
realsenseai:developmentfrom
Binyaminp:viewer-window-flush

Conversation

@Binyaminp

Copy link
Copy Markdown
Contributor

Summary

  • The viewer config file was being written on every pixel of movement while dragging the window, because glfwSetWindowPosCallback / glfwSetWindowSizeCallback called config_file::instance().set() directly and GLFW fires these callbacks at the OS event rate.
  • Replace the immediate writes with a 300 ms debounce: callbacks now store the incoming position/size into pending member variables and reset a stopwatch; the new flush_pending_window_state() method — called each frame from begin_frame() — commits to config only once the window has been still for 300 ms.
  • Move glfwSetWindowUserPointer to before the callback registrations so this is available in all GLFW callbacks from the point they are registered.

Changes

  • common/ux-window.h — add six private members (_pending_pos_x/y, _pending_pos_dirty, _window_moved_timer, and the size equivalents); declare flush_pending_window_state().
  • common/ux-window.cpp — rewrite the two GLFW callbacks to store pending state; add flush_pending_window_state(); call it from begin_frame(); introduce file-scope constexpr double window_settle_ms = 300.0.

Comment thread common/ux-window.h Resolved
Comment thread common/ux-window.h Resolved
Comment thread common/ux-window.cpp Resolved

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Binyaminp Binyaminp closed this Jul 5, 2026
@Binyaminp Binyaminp reopened this Jul 5, 2026
@Nir-Az
Nir-Az merged commit 13c8139 into realsenseai:development Jul 7, 2026
58 checks passed
@Binyaminp
Binyaminp deleted the viewer-window-flush branch July 23, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants