Parent Child Windows and Modal Windows SDL_SetWindowModalFor

Not a real lot in the manual!

How do Unset it (pass a NULL?).

Can a Model window itself be a Parent Window for another Model Window?

What are the .parent and .children of the SDL_Window structure used for? Are these fields programmer maintainable or are they internal to SDL?

Basically AGAR (GUI) needs to maintain parent child relationships for windows. I’m not entirely sure why but I need to provide code for a AGAR driver AG_ReparentWindow(win, parentwin) function.

/* Configure stacking order and parenting */
int (*raiseWindow)(struct ag_window *);
int (*lowerWindow)(struct ag_window *);
int (*reparentWindow)(struct ag_window *, struct ag_window *, int, int);

My code for raise looks like

static int
SDL2_RaiseWindow(AG_Window *win)
{
  AG_DriverSDL2 *sdl = (AG_DriverSDL2 *)WIDGET(win)->drv;
  AG_Driver *drv = WIDGET(win)->drv;

  if (sdl->w != NULL)
  {
    SDL_RaiseWindow(sdl->w);
  }
}

But I’m not sure what I can use for lower or the reparenting!