Some inconsistencies with display events
simast

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

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

jmasterx

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
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

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

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 :)

Thread #609271. Printed from Allegro.cc