Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Pixel lines dropped when showing display_menu #860

Closed
utz82 opened this issue Nov 23, 2017 · 5 comments
Closed

Windows: Pixel lines dropped when showing display_menu #860

utz82 opened this issue Nov 23, 2017 · 5 comments

Comments

@utz82
Copy link

utz82 commented Nov 23, 2017

When an ALLEGRO_MENU attached to the display, some arbitrary pixel lines (but always the same ones) will be partially skipped when drawing to the display, and mouse coordinates will go out of sync.

pixbug_win_menuless
pixbug_win_with_menu

It seems at least Win 7 up to Win 10 is affected. Linux and OS X are unaffected.
To reproduce, get the program shown above at https://github.com/utz82/bintracker.
The relevant code to disable the menu is in gui/gui.cpp:110.

As far as I can tell, this is the same issue as mentioned here: https://www.allegro.cc/forums/thread/617007

SiegeLord pushed a commit to SiegeLord/allegro5 that referenced this issue Nov 26, 2017
Prior to this, when the menu was shown this would shrink the drawable
area while keeping the window size the same. Now, the window size will
change while keeping the drawable area the same. The value returned by
al_get_display_height is unnaffected by this change.

Tested this with window constraints and things appear to work fine. A
remaining issue is the user changing the windows theme (thus changing
the menu height), which might cause issues. This should be a rare
occurence.

ex_menu had a workaround for this issue, and my testing has shown that
even if kept around, it still appears to work fine with this change in
place, suggesting that this change is backwards compatible.

Fixes liballeg#860.
@SiegeLord
Copy link
Member

I made a change to try to fix this, see #861.

The gist is that on Windows, menu is drawn on the same area as you typically draw on, which meant that the drawable area got shrunk (either cut off, or nearest-neighbour scaling which results in thiose missing lines). The change does the resize for you, so hopefully it's not something you should need to worry about now.

@utz82
Copy link
Author

utz82 commented Nov 28, 2017

Unfortunately the fix doesn't work for me, it's still squashing the same pixels.
I tried setting the ALLEGRO_RESIZABLE display flag just to be sure, but it didn't help either.

@SiegeLord
Copy link
Member

There was a subtle race condition that I've now fixed. Could you try again? I also tried bintracker locally, and it appeared to fix the issue for me.

SiegeLord pushed a commit that referenced this issue Dec 16, 2017
Prior to this, when the menu was shown this would shrink the drawable
area while keeping the window size the same. Now, the window size will
change while keeping the drawable area the same. The value returned by
al_get_display_height is unnaffected by this change.

Tested this with window constraints and things appear to work fine. A
remaining issue is the user changing the windows theme (thus changing
the menu height), which might cause issues. This should be a rare
occurence.

ex_menu had a workaround for this issue, and my testing has shown that
even if kept around, it still appears to work fine with this change in
place, suggesting that this change is backwards compatible.

Fixes #860.
@utz82
Copy link
Author

utz82 commented Jan 15, 2018

I can confirm that this fixes the issue. Sorry again for the delay.

@SiegeLord
Copy link
Member

Nice, thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants