Skip to content

Commit

Permalink
SDL_Viewer: contouring: override window focus when mouse wheeling ove…
Browse files Browse the repository at this point in the history
…r image viewer window.
  • Loading branch information
Hal Clark committed Jan 19, 2024
1 parent c5440d4 commit f47f2e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Operations/SDL_Viewer.cc
Expand Up @@ -5178,6 +5178,14 @@ std::cout << "Collision detected between " << obj.pos << " and " << obj_j.pos
real_pos.y = pos.y - (real_extent.y * uv_min.y);
ImGui::End(); // "Images".

// Force focus if there is a mouse wheel scroll while hovering the image viewer.
if( image_mouse_pos.image_window_hovered
&& !image_mouse_pos.image_window_focused
&& (io.MouseWheel != 0.0) ){
ImGui::SetWindowFocus("Images");
image_mouse_pos.image_window_focused = true;
}

// Attempt to acquire an exclusive lock.
std::unique_lock<std::shared_timed_mutex> drover_lock(drover_mutex, mutex_dt);
if(!drover_lock) return;
Expand Down

0 comments on commit f47f2e8

Please sign in to comment.