diff options
author | Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> | 2014-04-04 10:04:18 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-06 22:37:45 -0700 |
commit | cd186fbfaf88003175346644d077efa7e70627a2 (patch) | |
tree | 702368a666ccee7da888bc7e7f32bca010c63dcf | |
parent | 27efc0653026383f880dd101ed67163e1868fe6a (diff) |
toytoolkit: match parent surface type when adding a subsurface
When adding a subsurface (to display a tooltip) in toytoolkit,
we now get the parent window surface type (SHM or EGL) and
define the new surface type as the same.
This fixes crashes with tooltips in cases like having
Cairo-EGL available but running the X11 compositor.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r-- | clients/window.c | 7 | ||||
-rw-r--r-- | clients/window.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/clients/window.c b/clients/window.c index 83934249..c510f506 100644 --- a/clients/window.c +++ b/clients/window.c @@ -4610,6 +4610,12 @@ window_set_buffer_type(struct window *window, enum window_buffer_type type) window->main_surface->buffer_type = type; } +enum window_buffer_type +window_get_buffer_type(struct window *window) +{ + return window->main_surface->buffer_type; +} + void window_set_preferred_format(struct window *window, enum preferred_format format) @@ -4627,6 +4633,7 @@ window_add_subsurface(struct window *window, void *data, struct wl_subcompositor *subcompo = window->display->subcompositor; surface = surface_create(window); + surface->buffer_type = window_get_buffer_type(window); widget = widget_create(window, surface, data); wl_list_init(&widget->link); surface->widget = widget; diff --git a/clients/window.h b/clients/window.h index 0a113fcc..ae3af404 100644 --- a/clients/window.h +++ b/clients/window.h @@ -364,6 +364,9 @@ display_surface_damage(struct display *display, cairo_surface_t *cairo_surface, void window_set_buffer_type(struct window *window, enum window_buffer_type type); +enum window_buffer_type +window_get_buffer_type(struct window *window); + int window_is_fullscreen(struct window *window); |