[AD] [5.1] Windows bug fix for al_get_window_position

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


Hello,

I believe that I have fixed the bug described in this bug report:

https://sourceforge.net/p/alleg/bugs/375/

It looks like the Windows code for al_get_window_position was trying to compensate for the lack of window decorations on a frameless window. However, it seems that doing so was unnecessary, because GetWindowRect appears to return the correct coordinates regardless of whether or not the Window is frameless. Thus, I removed all of the code that were, apparently, calculating the wrong position for the window and just replaced it with GetWindowRect.

It is possible that my fix is incorrect, as I don't actually know why the original developer added this adjustment code. I tested it on Windows 7 with and without Aero enabled, using both OpenGL and D3D, and using frameless and regular windows for each configuration and it worked fine.

I tested al_get_window_position on Linux, and it did not seem to have the same problems as on Windows.

Here is the patch that contains my changes:

http://pastebin.com/DjhHXbXL

And here is the test program that I used:

http://pastebin.com/if4g5aa0

I hope this is useful and correct.

-Michael Swiger


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