Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Some inconsistencies with display events

This thread is locked; no one can reply to it. rss feed Print
Some inconsistencies with display events
simast
Member #12,668
March 2011

Did a simple test today with display events and noticed two things:

- If you minimize a window (using the minimize button) and then restore from the taskbar: two ALLEGRO_EVENT_DISPLAY_SWITCH_IN events will fire. Is this supposed to happen or it's a bug? I would expect a single event here.

- Minimizing a window (using the same button) will fire a ALLEGRO_EVENT_DISPLAY_RESIZE event with event.display.width = 0 and event.display.height = 0. A bug or by design?

Platform: Windows 7
Allegro: 5.0.5

J-Gamer
Member #12,491
January 2011
avatar

I can't say anything about the first one, but I think the second one is logical.

" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo
"If your body was a business, thought would be like micro-management and emotions would be like macro-management. If you primarily live your life with emotions, then you are prone to error on the details. If you over-think things all the time you tend to lose scope of priorities." - Mark Oates

jmasterx
Member #11,410
October 2009

I've mentioned those exact things several times (the width and height == 0 one at least). I hope someone eventually does something about them. In all my games I have to check if width and height are zero and ignore the event if so.

In addition, when returning from fullscreen window to windowed you do not get a resize event so I have to hack around that and emit one myself.

simast
Member #12,668
March 2011

J-Gamer said:

I can't say anything about the first one, but I think the second one is logical.

Not really? I mean minimizing does not change display size to 0, thus it shouldn't fire at all. The only events that should fire on minimize are:

1. ALLEGRO_EVENT_DISPLAY_SWITCH_OUT
2. ALLEGRO_EVENT_DISPLAY_LOST (if running with no preserve texture flag)

jmasterx
Member #11,410
October 2009

At the very least, since Allegro gives a 0,0 event, it should absolutely give a width, height event when you restore, which is the biggest issue.

Elias
Member #358
May 2000

In Linux minimizing only creates a single SWITCH_OUT and nothing else. Restoring creates a single SWITCH_IN. There are no resize events and I don't think there should be. Anyone knows DirectX/win32 (I don't) and wants to fix it? Else we have to wait for Trent again :)

--
"Either help out or stop whining" - Evert

Go to: