Skip to content

Commit 9eca63f

Browse files
We had problems on windows 32bit systems using the reparenting feature.
Sometimes (timing issue) the JCEF native code in CefBrowser_N.cpp uses a wrong parent window handle. With this change the problem was gone, also see chromiumembedded#321. Reproduction: The problem can happen on physical machines too but happen much more often when connected to remote machines (e.g. Citrix sessions, Remote Desktop, VMWares,...). - Start detailed MainFrame - Menu -> Tests -> Reparent - Press the "Reparent </>" Button as fast as you can (Space bar helps) The bug then sometimes happens on the 5th try or you have to do this for a minute or so.
1 parent 8b4225a commit 9eca63f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

native/CefBrowser_N.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,8 +2122,10 @@ Java_org_cef_browser_CefBrowser_1N_N_1SetParent(JNIEnv* env,
21222122
std::move(callback));
21232123
#else
21242124
CefWindowHandle browserHandle = browser->GetHost()->GetWindowHandle();
2125-
CefWindowHandle parentHandle =
2126-
canvas ? util::GetWindowHandle(env, canvas) : kNullWindowHandle;
2125+
if (canvas != NULL)
2126+
parentHandle = util::GetWindowHandle(env, canvas);
2127+
else
2128+
parentHandle = TempWindow::GetWindowHandle();
21272129
if (CefCurrentlyOn(TID_UI)) {
21282130
util::SetParent(browserHandle, parentHandle, std::move(callback));
21292131
} else {

0 commit comments

Comments
 (0)