[client] displayserver: add new earlyInit to the interface

Some platforms such as Wayland need to set environment vairables before
SDL is initialized, as such this change detects the display server
before SDL has started and calls the new `earlyInit` method providing
the implementation an opportunity to set things up.
This commit is contained in:
Geoffrey McRae
2021-01-16 20:29:54 +11:00
parent ef678bab1d
commit bad25c409c
3 changed files with 51 additions and 43 deletions

View File

@@ -49,7 +49,10 @@ struct LG_DisplayServerOps
{
const SDL_SYSWM_TYPE subsystem;
/* early initialization */
/* called before SDL has been initialized */
bool (*earlyInit)(void);
/* called after SDL has been initialized */
void (*init)(SDL_SysWMinfo * info);
/* called at startup after window creation, renderer and/or SPICE is ready */