Open vasusharma7 opened 1 month ago
@Pranav2612000 @clearlysid , PTAL
Thanks for the PR!
A more efficient way to get multi-display to work is to just spawn the record button (and cropper, etc.) on the display that the mouse cursor is present on instead of making 4 croppers and 4 record buttons.
You can use the monitor_from_point
method to implement this, docs here: https://docs.rs/tauri/2.0.0-beta.22/tauri/struct.App.html#method.monitor_from_point
Yes that was my intention to begin with and I resonate with the process and all the steps you mentioned !
But there were a few issues ,firstly, e-spawning of windows is not possible ( that same label cant be reused even after destroying windows)
Then I tried to use the same window spawned before and just to reposition it on the correct monitor and change its inner width and other properties but certain properties were not modifiable after the window is built (.build() method is called ).
I don't correctly remember the issue( I think it was the width not getting modified ) but spent some time on this and then I tried to ship an MVP with a static number of screens.
That being said , I know it's a bad code design and bad UX to have a fixed number of screens
I feel it's the time that I take a step back now and try the above things again.
Please give me some time and I will post an update soon.
Thanks
certain properties were not modifiable after the window is built (.build() method is called ).
you can use the following methods:
I think I saw this Let me zoom out and give this a try again .... Will post an update soon
I have updated a few things ( few optimisations still pending ) ; however I don't have second monitor with me for 2 weeks ( in my hometown ) - so could not test it thoroughly - Still, I will try to do some hack to test it and post an update soon.
To be honest, I don't remember why I added this dependency on core graphics at first place. Me and Pranav had some initial conversations quite some time back and we realised taking this dependency from core graphics and now I don't recall why we came to this conclusion ( that was the reason behind my other initial PR on scap to expose CG deduced properties )
Anyways, I changed it to just take everything from tauri::Monitor including the position, size, scale factor etc.. now But again I couldn't test it to work on multiple monitors as I don't currently have access to those :(
This PR contributes to https://github.com/helmerapp/micro/issues/59 with following changes: