Skip to content

Commit 924e79f

Browse files
michaelolbrichfooishbar
authored andcommitted
ivi-shell: emit created notification earlier for desktop surfaces
Without this, the earliest signal the ivi controller receives for a new surface is configure_desktop_changed signal. And this is not emitted until the surface has the first buffer attached. By emitting the signal during surface creation, the controller is able to set the initial width and height for the first configure. Signed-off-by: Michael Olbrich <[email protected]>
1 parent cd7801a commit 924e79f

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

ivi-shell/ivi-layout-shell.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
4444
int32_t width, int32_t height);
4545

4646
struct ivi_layout_surface*
47-
ivi_layout_desktop_surface_create(struct weston_surface *wl_surface);
47+
ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
48+
struct weston_desktop_surface *surface);
4849

4950
void
5051
ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,

ivi-shell/ivi-layout.c

+13-3
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,6 @@ ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf,
18821882

18831883
ivisurf->id_surface = id_surface;
18841884

1885-
wl_signal_emit(&layout->surface_notification.created, ivisurf);
18861885
wl_signal_emit(&layout->surface_notification.configure_changed,
18871886
ivisurf);
18881887

@@ -1979,9 +1978,20 @@ ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
19791978
}
19801979

19811980
struct ivi_layout_surface*
1982-
ivi_layout_desktop_surface_create(struct weston_surface *wl_surface)
1981+
ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
1982+
struct weston_desktop_surface *surface)
19831983
{
1984-
return surface_create(wl_surface, IVI_INVALID_ID);
1984+
struct ivi_layout *layout = get_instance();
1985+
struct ivi_layout_surface *ivisurf;
1986+
1987+
ivisurf = surface_create(wl_surface, IVI_INVALID_ID);
1988+
1989+
if (ivisurf) {
1990+
ivisurf->weston_desktop_surface = surface;
1991+
wl_signal_emit(&layout->surface_notification.created, ivisurf);
1992+
}
1993+
1994+
return ivisurf;
19851995
}
19861996

19871997
void

ivi-shell/ivi-shell.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,11 @@ desktop_surface_added(struct weston_desktop_surface *surface,
489489
struct weston_surface *weston_surf =
490490
weston_desktop_surface_get_surface(surface);
491491

492-
layout_surface = ivi_layout_desktop_surface_create(weston_surf);
492+
layout_surface = ivi_layout_desktop_surface_create(weston_surf, surface);
493493
if (!layout_surface) {
494494
return;
495495
}
496496

497-
layout_surface->weston_desktop_surface = surface;
498-
499497
ivisurf = zalloc(sizeof *ivisurf);
500498
if (!ivisurf) {
501499
return;

0 commit comments

Comments
 (0)