diff --git a/src/dialog.c b/src/dialog.c index 53df44c..35dcf43 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -83,6 +83,8 @@ int wMessageDialog(WScreen *scr, const char *title, const char *message, const c parent = (WNativeWindow)wm_backend->fake_leader_create(scr); wm_backend->window_resize((WNativeWindow)parent, pwidth, pheight); + /* Realize so WMWidgetXID is valid before reparent */ + WMRealizeWidget(panel->win); wm_backend->client_reparent((WNativeWindow)WMWidgetXID(panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight); @@ -142,6 +144,8 @@ int wExitDialog(WScreen *scr, const char *title, const char *message, const char parent = (WNativeWindow)wm_backend->fake_leader_create(scr); wm_backend->window_resize((WNativeWindow)parent, pwidth, pheight); + /* Realize so WMWidgetXID is valid before reparent */ + WMRealizeWidget(panel->win); wm_backend->client_reparent((WNativeWindow)WMWidgetXID(panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight); @@ -510,6 +514,8 @@ int wInputDialog(WScreen *scr, const char *title, const char *message, char **te wm_backend->window_resize((WNativeWindow)parent, pwidth, pheight); wm_backend->window_select_events((WNativeWindow)parent, WM_EVMASK_KEY_PRESS | WM_EVMASK_KEY_RELEASE); + /* Realize so WMWidgetXID is valid before reparent */ + WMRealizeWidget(panel->win); wm_backend->client_reparent((WNativeWindow)WMWidgetXID(panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight);