Reparenting the window handle

Godot Version

4.3

Question

I have C++ (not godot) app and I want to use godot as GUI for it. I’ve tried playing around while handling it as 2 separate app, but came across so flickering when changing focus between them and other windows

The app is pure Windows OS oriented so I decided to (brutally) take the window handle from godot and give it to the cpp app.
(the godot app is a server and cpp is a client communicating via TCP)
it works well, I am able to reparent the window and do whatever I want with it.

My only problem is the godot window is now invisible. I can interact with it (click on invisible buttons), but I see my cpp app below it.
I tried to manipulate it as much as I can but still cannot render it.
I debugged it with spy++ and so far these are my findings

  • windows rect are aligned, it’s not a clipping issue
  • The windows are child(godot) ↔ parent (cpp)
  • The style makes sense:
    WS_CHILDWINDOW
    WS_VISIBLE
    WS_CLIPSIBLINGS
    WS_CLIPCHILDREN
    WS_EX_LEFT