window: don't call output configure uninitialised
authorPekka Paalanen <ppaalanen@gmail.com>
Mon, 15 Oct 2012 09:06:53 +0000 (12:06 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 16 Oct 2012 00:54:43 +0000 (20:54 -0400)
commitb2f957a9f192fa37286d3cc0bd89e6a34142aa51
treee8ef194f285b8f13cccb514af9360dd9df2a3b97
parentfeb3c1d33b87dc8dff320b10a628bbc1abb74a37
window: don't call output configure uninitialised

Callbacks registered via display_set_output_configure_handler() are
promised to be called when we know the current mode for the output. If
the following order of events happens:
1. toytoolkit binds to a wl_output global
2. application registers an output configure handler
3. the wl_output.mode events are received

Then in step 2 we would call the callback with uninitialised output
informations, giving it a 0x0 size.

To avoid such race, do not call the callback from
display_set_output_configure_handler() if the output has 0x0 size.

The wl_output.mode event will be received later, and that will trigger
the right call to the callback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
clients/window.c