Re: [AD] Center window on correct screen (MacOS X patch)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2012-06-20, at 6:23 AM, Evert Glebbeek wrote:
> I don't really understand what you mean here: it looks like you replaced the (local) variable adapter with a global (static) variable new_display_adapter. Why is that needed and how does it connect to what you said?

al_get_new_display_adapter() always returns zero from a new thread, so it has to be gotten from the main thread where the user sets it. Exactly the same reason for new_display_pos_* static globals.

> It's not exactly supposed to centre it on the screen: it's supposed to centre it on the screen if there is no prior window present and it's supposed to "cascade from top" of the last window if there is one. I think this is what you want, because otherwise the windows will just stack in the same location which looks weird (or did to me when I made it do that; note that the cascade-from-top behaviour was there from the beginning). I do think it's cleaner to use [win center]; (as in the original) rather than duplicating that functionality ourselves (in the new code).
> As to not selecting the correct screen, I think I wrote that code when I had an iBook that could only mirror the screen to an external display and only tested it briefly when I was home for christmas three years ago (didn't have access to an external screen otherwise). It's quite possible that it didn't work reliably or has been subtly broken since then.

Ok, cascading is good but the [win center] part is broken. It always centers on the main screen. I can try and make it do both.

Trent



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/