Resize problem, web content not updated during resize

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Resize problem, web content not updated during resize

Postby smayoral » Tue Jul 22, 2025 8:27 am

Hi,
we have a Windows application using 132.0.6834.161 and we have updated to 138.0.7204.101.

After updating we see that if the window holding chromium is being resized the content inside is not automatically updated.
If the windows gets bigger the new content is black and when the mouse is released then the content is adjusted to the new window size.
In the 132 version the content was updated even if the mouse was not released.

I checked all versions down to 132 and found out that this was a change between versions 132 and 133.

Any idea if we can do something here?
I can try to trigger a redraw of the window if I detect that the size is being changed.

Best regards,
Sergio
smayoral
Mentor
 
Posts: 71
Joined: Wed Jan 10, 2018 8:58 am

Re: Resize problem, web content not updated during resize

Postby magreenblatt » Tue Jul 22, 2025 8:54 am

What Windows version? Are you using Chrome or Alloy style browsers? How are you embedding the browser (Views, WinAPI, etc?) Does the issue reproduce with CEF sample apps?
magreenblatt
Site Admin
 
Posts: 13217
Joined: Fri May 29, 2009 6:57 pm

Re: Resize problem, web content not updated during resize

Postby smayoral » Tue Jul 22, 2025 8:57 am

we are using Win11

and following initialization:

windowInfo.SetAsChild(hwnd, rect);
windowInfo.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
bool browserOk = CefBrowserHost::CreateBrowser(windowInfo, browserHandler, wcUrl, browserSettings, nullptr, nullptr);

cefsimple with ALLOY does work but if I use same initialization in my app does not...

CefWindowInfo window_info;
window_info.SetAsPopup(nullptr, "cefsimple");
window_info.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
CefBrowserSettings browser_settings;
CefBrowserHost::CreateBrowser(window_info, browserHandler, wcUrl, browser_settings, nullptr, nullptr);

I will try to find out where the difference is...
smayoral
Mentor
 
Posts: 71
Joined: Wed Jan 10, 2018 8:58 am

Re: Resize problem, web content not updated during resize

Postby smayoral » Fri Jan 23, 2026 10:30 am

I finally had time for this problem and after checking the cefclient example I saw this code in the WndProc method for the WM_SYSCOMMAND message:

case WM_SYSCOMMAND:
// Only necessary when running on the UI thread.
if (CefCurrentlyOn(TID_UI)) {
// Windows uses the 4 lower order bits of |wParam| for type-specific
// information so we must exclude this when comparing.
static constexpr int sc_mask = 0xFFF0;
if ((wParam & sc_mask) == SC_MOVE || (wParam & sc_mask) == SC_SIZE) {
// Allow application tasks to run in the drag-induced nested message
// loop that will be triggered here. Otherwise, redraw (and other
// notifications) will be blocked until the nested loop exits. This
// should be reentrancy safe because no other C++ symbols are on the
// stack.
CefScopedSetNestableTasksAllowed allowed;
return DefWindowProc(hWnd, WM_SYSCOMMAND, wParam, lParam);
}

}
break;

I was not handling the SC_SIZE case. After adding this code to my application repainting is done during resize as it was with Versions previous to Chromium 133.
smayoral
Mentor
 
Posts: 71
Joined: Wed Jan 10, 2018 8:58 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 99 guests