I am using Ubuntu 24.04 LTS and I want to embed SDL2 window inside panel. I found this code example
GtkWidget := PGtkWidget(panel1.handle);
Handle := Pointer(GDK_WINDOW_XWINDOW(GtkWidget^.window));
SDLWindow := SDL_CreateWindowFrom(Handle);
But when I run code I get this error:
The program 'application1' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 192 error_code 3 request_code 20 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)