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

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


On 19 Jun 2012, at 23:54 , Trent Gamblin wrote:
> How does this look?

Ok at first glance (but see below).

> I didn't really understand the code that was there. Anyway this addresses two minor issues. First, the new display adapter is thread local, so we store it in the main thread like new_display_pos_x/y.

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?

> The I changed the condition of the user not passing a window position. It's supposed to center the window on the screen you've chosen with al_set_new_display_adapter(), but before it was always centering on the main screen. Evert?

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.

Evert



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