In SCK backend move dpi to and set may_contain_cursor in frame callback

Bug: webrtc:367915807
Change-Id: Id29b979ab7909d21eb92bc926f9decdae3345381
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365084
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Andreas Pehrson <apehrson@mozilla.com>
Cr-Commit-Position: refs/heads/main@{#44204}
diff --git a/modules/desktop_capture/mac/screen_capturer_sck.mm b/modules/desktop_capture/mac/screen_capturer_sck.mm
index c8f5411..7825d85 100644
--- a/modules/desktop_capture/mac/screen_capturer_sck.mm
+++ b/modules/desktop_capture/mac/screen_capturer_sck.mm
@@ -171,7 +171,6 @@
     MutexLock lock(&latest_frame_lock_);
     if (latest_frame_) {
       frame = latest_frame_->Share();
-      frame->set_dpi(DesktopVector(latest_frame_dpi_, latest_frame_dpi_));
       if (frame_is_dirty_) {
         frame->mutable_updated_region()->AddRect(
             DesktopRect::MakeSize(frame->size()));
@@ -357,6 +356,9 @@
 
   if (dirty) {
     MutexLock lock(&latest_frame_lock_);
+    frame->set_dpi(DesktopVector(latest_frame_dpi_, latest_frame_dpi_));
+    frame->set_may_contain_cursor(capture_options_.prefer_cursor_embedded());
+
     frame_is_dirty_ = true;
     std::swap(latest_frame_, frame);
   }