ivi-shell: call shell_surface_send_configure() directly
For some reason, it seems that ivi-layout.c has tried hard to avoid
calling directly into ivi-shell.c. This means there is a jump through
hoops just to get the configure event sent to the clients. Ivi-shell
registers a listener for a ivi-layout signal for sending the event.
Instead, let ivi-layout.c call directly into ivi-shell.c, and expose a
function to send out the configure events. This reduces some confusion
on who calls what.
The main idea though is that this makes ivi-shell.c not depend on struct
ivi_layout_surface fields directly anymore. In following patches,
ivi_layout_surface can be made opaque for ivi-shell.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 77578d4..f1ea9bd 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -61,6 +61,7 @@
#include <assert.h>
#include "compositor.h"
+#include "ivi-shell.h"
#include "ivi-layout-export.h"
#include "ivi-layout-private.h"
@@ -776,8 +777,12 @@
ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
- if (configured && !is_surface_transition(ivisurf))
+ if (configured && !is_surface_transition(ivisurf)) {
wl_signal_emit(&ivisurf->configured, ivisurf);
+ shell_surface_send_configure(ivisurf->surface,
+ ivisurf->prop.dest_width,
+ ivisurf->prop.dest_height);
+ }
} else {
configured = 0;
if (ivisurf->prop.dest_width != ivisurf->pending.prop.dest_width ||
@@ -789,8 +794,12 @@
ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
- if (configured && !is_surface_transition(ivisurf))
+ if (configured && !is_surface_transition(ivisurf)) {
wl_signal_emit(&ivisurf->configured, ivisurf);
+ shell_surface_send_configure(ivisurf->surface,
+ ivisurf->prop.dest_width,
+ ivisurf->prop.dest_height);
+ }
}
}
}