helmerapp / micro

top notch GIFs, right from your desktop
https://www.helmer.app/micro
Other
41 stars 8 forks source link

feat: multi-display support (windows) #96

Closed amit-chaudhari1 closed 2 months ago

amit-chaudhari1 commented 3 months ago

For some reason, this patch is giving me None for monitors, so i decided to use coordinate geometry to determine which monitor my cursor lives on when spawning.

I was trying to find time to do it right by using the method we exposed from tao, but I could not spare enough time to dig into it.

image

amit-chaudhari1 commented 3 months ago

This will solve #59 Multi monitor support.

Should work on more than 2 monitors. But have not tested it.

clearlysid commented 3 months ago

@RohanPunjani can you look at this PR today or tomorrow?

RohanPunjani commented 3 months ago

Hey @amit-chaudhari1

I tested your PR on my local machine with proper scale factor and multiple monitor, but there was as issue I faced here.. I was able to render the cropper and recorder on the display where the cursor was headed, but after we start recording the area, it only captured the area of main display, even though the selected area was from secondary monitor.

clearlysid commented 3 months ago

Will check this on mac and merge within the weekend.

clearlysid commented 3 months ago

This PR doesn't work on macOS yet because it compares Monitor names to match the target and not ID. Let's find a way to use ID for matching monitor before merging.

amit-chaudhari1 commented 3 months ago

This PR doesn't work on macOS yet because it compares Monitor names to match the target and not ID.

I realized this while writing that this might be an issue, but I saw that this PR was trying to support Mac systems. and decided that did not need to worry about mac systems. Is that not the case?

Agree, that we should use ID for monitors, but I saw that either scap or tauri ( looks like tauri, i don't exactly remember which, sorry) did not rely-on/expose the monitor ID. Do you suggest we expose ID from there first?

Can you share how the Window object looks on mac? I can't really test on mac systems as i don't have any rn.

Another option: We could merge and release a patch that fixes this on apple devices. But I understand that you'd probably just want this feature work on every system all at one release version.

clearlysid commented 3 months ago
  1. Everything works great, just the matching fails because of name.
  2. Tauri doesn't expose the ID, scap does.
  3. The Monitor ID in scap is just the HMONITOR on Windows or CGDisplayID on mac — we just need to find a way to construct these from whatever Tauri returns and then we should be good 🙌

I'll ask around how to do this in the Tauri Discord.

clearlysid commented 3 months ago

Good work on this otherwise, it works just like I'd hoped it would 👏