nathan-fiscaletti / framecast

An application that allows you to stream a particular region of your screen to a window. This window can then be shared on video conferencing applications such as Google Meet.
MIT License
19 stars 1 forks source link

Windows bug: "select region" only works OK on primary monitor #2

Open darkvertex opened 1 year ago

darkvertex commented 1 year ago

I suspect maybe it has something to do with the fact my Windows "Display Scaling" is set to 125% on my primary monitor and 150% on my secondary monitor. My second monitor is rotated sideways to look vertical, if it makes a difference.

nathan-fiscaletti commented 1 year ago

What exactly is happening? I'm assuming that it's not recording the specific region you've selected. I'm aware that using display scaling in general will normally cause an issue where the region you've selected won't be what's recorded. I'm still looking into a solution for display scaling.

darkvertex commented 1 year ago

That's basically it, but I figured out another curious detail:

If you press the button to select the region, and drag the translucent window from the screen it appeared in to another screen with different display scaling %, the window "pops" briefly as it transitions between screens, looking correct.. but then when you Save, it's totally the wrong region. The part that it records is like the top right of that monitor for me, in a totally different place.

I tried moving the main window between monitors but the "region picker" always spawned on my "primary" monitor.

Perhaps if it spawned on the monitor the app window is in, maybe the scaling would be more correct?

nathan-fiscaletti commented 1 year ago

The issue is specifically caused by me not taking into account display scaling currently. Electron uses units that are scaled based on the display scaling factor. But gdigrab, the ffmpeg module we use to capture the screen on windows does not use display scaling.

However, accounting for this is difficult due to oddities in the way that Electron handles things. I believe that an issue with electron is making it difficult to support display scaling the way I'd like to. (Possibly this issue, I'm not certain: https://github.com/electron/electron/issues/10862)

I'm still digging into it, but it might be some time before display scaling is fully supported.

nathan-fiscaletti commented 1 month ago

Given how long this underlying issue with Electron has remained unaddressed, I'm considering moving this project to an alternative like Lorca or Wails.