Skip to content

Commit

Permalink
Set visiblity on Cursor::show, remove on {show, set_scale} if
Browse files Browse the repository at this point in the history
visible
  • Loading branch information
tarek-y-ismail committed Feb 6, 2025
1 parent 24b53e2 commit bd302df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/graphics/software_cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ void mg::SoftwareCursor::show(std::shared_ptr<CursorImage> const& cursor_image)
this->current_cursor_image = cursor_image;

set_scale(current_scale);

visible = true;
}


Expand Down Expand Up @@ -211,7 +213,7 @@ void mir::graphics::SoftwareCursor::set_scale(float new_scale)
std::lock_guard lg{guard};

current_scale = new_scale;
auto const to_remove = renderable? renderable: nullptr;
auto const to_remove = visible? renderable: nullptr;
renderable = create_scaled_renderable_for_current_cursor(new_scale);
hotspot = current_cursor_image->hotspot() * new_scale;

Expand Down

0 comments on commit bd302df

Please sign in to comment.