snowcone-ltd/libmatoya

MTY_WindowDesc - specify display index

chadmortimer opened this issue · 7 comments

It would be helpful to be able to specify which display to open a window on. At the moment there doesn't seem to be a way to do this? i.e if I want to open two windows and have window 1 on display 1 and window 2 on display 2 (Or even just open window 1 on display 2 instead of display 1).

In addition to this it would also be helpful to retrieve the current Display configuration i.e what displays are connected, size, scaling, bounds (positioning).

Yes this is something I have planned. While I tried to avoid too exposing much around monitors and display modes, I think you need the ability to create and then programmatically set the window on different displays. For sure MTY_WindowSetPosition is imminent, perhaps either taking virtual coordinates or a display number outright.

That would be great - how imminent is it though?

Obviously in order to position using virtual co-ordinates or specify the display number one would need to know what displays are actually available and their relative positions. i.e so that the user can select from a list which display to use for example OR the application can auto select it - but then it would need to know whether there is in fact more than 1 display available (and if there is - where that display is positioned so that virtual co-ords can be determined)

And ideally MTY_WindowGetPosition should then also include the display number so that it is consistent with MTY_WindowSetPosition

If I had to guess within 6 weeks, but don't hold me to it :)

Yeah there has to be some kind of getter for the displays and potentially their virtual coordinates that can then be used during window creation or with MTY_WindowSetPosition.

Ok great, thank you. I will be waiting with great anticipation :)

Any progress / update on this one?

I have started looking into this myself (in windows API to start with) and seemingly it is quite tedious to get right.

My approach so far is to use EnumDisplayMonitors to enumerate all displays to get a handle on the required display(s) and then GetMonitorInfo to get the bounds etc. which I can then use to ascertain the correct virtual x / y coordinates to create the window based on the user's selection.

Is your implementation imminent? I am just trying to gauge whether it would be worth spending more time to incorporate this ourselves into our own fork but I am hesitant to do so if your solution is coming soon and concerned about creating conflicts with newer releases from your side.

Changes to window initialization and the MTY_Frame system introduced should address this.