mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 15:48:05 +02:00
window: Add API to check for subcompositor, use in subsurface example
This way we can fail with a nice error message.
This commit is contained in:
parent
c85a9178c7
commit
b20b00923a
3 changed files with 20 additions and 0 deletions
|
|
@ -781,6 +781,12 @@ main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!display_has_subcompositor(display)) {
|
||||
fprintf(stderr, "compositor does not support "
|
||||
"the subcompositor extension\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
app = demoapp_create(display);
|
||||
|
||||
display_run(display);
|
||||
|
|
|
|||
|
|
@ -5367,6 +5367,17 @@ display_get_display(struct display *display)
|
|||
return display->display;
|
||||
}
|
||||
|
||||
int
|
||||
display_has_subcompositor(struct display *display)
|
||||
{
|
||||
if (display->subcompositor)
|
||||
return 1;
|
||||
|
||||
wl_display_roundtrip(display->display);
|
||||
|
||||
return display->subcompositor != NULL;
|
||||
}
|
||||
|
||||
cairo_device_t *
|
||||
display_get_cairo_device(struct display *display)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@ display_get_user_data(struct display *display);
|
|||
struct wl_display *
|
||||
display_get_display(struct display *display);
|
||||
|
||||
int
|
||||
display_has_subcompositor(struct display *display);
|
||||
|
||||
cairo_device_t *
|
||||
display_get_cairo_device(struct display *display);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue