mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient: win: Support window state restore (see issue #3359)
The cefclient sample app on Windows will persist window state across application restart if run with cache_path and persist_user_references enabled. To test: 1. Run `cefclient --cache-path=/path/to/cache --persist-user-preferences` 2. Move or resize the window, maximize, minimize, etc. 3. Exit cefclient. 4. Run cefclient again with the same arguments. The previous window state will be restored.
This commit is contained in:
@@ -75,6 +75,32 @@ CefPoint CefDisplay::ConvertScreenPointFromPixels(const CefPoint& point) {
|
||||
#endif
|
||||
}
|
||||
|
||||
// static
|
||||
CefRect CefDisplay::ConvertScreenRectToPixels(const CefRect& rect) {
|
||||
CEF_REQUIRE_UIT_RETURN(CefRect());
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const gfx::Rect pix_rect = view_util::ConvertRectToPixels(
|
||||
gfx::Rect(rect.x, rect.y, rect.width, rect.height));
|
||||
return CefRect(pix_rect.x(), pix_rect.y(), pix_rect.width(),
|
||||
pix_rect.height());
|
||||
#else
|
||||
return rect;
|
||||
#endif
|
||||
}
|
||||
|
||||
// static
|
||||
CefRect CefDisplay::ConvertScreenRectFromPixels(const CefRect& rect) {
|
||||
CEF_REQUIRE_UIT_RETURN(CefRect());
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const gfx::Rect dip_rect = view_util::ConvertRectFromPixels(
|
||||
gfx::Rect(rect.x, rect.y, rect.width, rect.height));
|
||||
return CefRect(dip_rect.x(), dip_rect.y(), dip_rect.width(),
|
||||
dip_rect.height());
|
||||
#else
|
||||
return rect;
|
||||
#endif
|
||||
}
|
||||
|
||||
CefDisplayImpl::CefDisplayImpl(const display::Display& display)
|
||||
: display_(display) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
Reference in New Issue
Block a user