Envek / obs-studio-node-example

Learn how to use OBS Studio from your Electron app for screen video recording
GNU General Public License v2.0
105 stars 19 forks source link

Preview window doesn't scale on move between displays #7

Open Envek opened 4 years ago

Envek commented 4 years ago

When I move the window from a scaled to a secondary non-scaled screen, the preview overflows the rest of the window. But I don't know how to detect when the scaling changed... problem_01

Originally posted by @hrueger in https://github.com/Envek/obs-studio-node-example/pull/6#issuecomment-626653368

emptycrown commented 4 years ago

Maybe related but it doesn't seem possible to even detect the resolution of the given monitor/screen in obs-studio-node.

obs-studio-node indexes the monitors in a multi-monitor setup simply with 0, 1, 2, ... but these do not match with Electron's indexing, so it's not possible to accurately use an external method.

Have you seen a clean way to figure out the resolution and thus calculate the scaling required for the scene? Using Electron's primaryDisplay is a good hack but not consistent in multi-monitor setups.