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:
Marshall Greenblatt
2022-11-07 15:21:44 -05:00
parent 882bc19fdd
commit e2a9236106
13 changed files with 310 additions and 94 deletions

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=6eed21d200bad5e898dfbe2701ad327cc1e4cc5c$
// $hash=912c23bc842c87aeca79780746c31e3fe848013a$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
@@ -154,6 +154,20 @@ cef_display_convert_screen_point_to_pixels(const cef_point_t* point);
CEF_EXPORT cef_point_t
cef_display_convert_screen_point_from_pixels(const cef_point_t* point);
///
/// Convert |rect| from DIP screen coordinates to pixel screen coordinates. This
/// function is only used on Windows.
///
CEF_EXPORT cef_rect_t
cef_display_convert_screen_rect_to_pixels(const cef_rect_t* rect);
///
/// Convert |rect| from pixel screen coordinates to DIP screen coordinates. This
/// function is only used on Windows.
///
CEF_EXPORT cef_rect_t
cef_display_convert_screen_rect_from_pixels(const cef_rect_t* rect);
#ifdef __cplusplus
}
#endif

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "46cd296ee58a28371e4f82c52cf447c516a4dc4b"
#define CEF_API_HASH_UNIVERSAL "e92cde673e73851d8841e2f3c4f38bcd0f6ed2bb"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "92c7ff6ca220e1c55081d020fd2b1d96d102a8fa"
#define CEF_API_HASH_PLATFORM "162bfdae56cbfd7f76fd4178be019f0dba512c40"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "7d01ca5ec82dbefa6f3f84fa4883a0059d96ccb5"
#define CEF_API_HASH_PLATFORM "31c5680dbc8d80fffc14214dd1ce4126a08e38d3"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "f0334f17e0823c7cf7ee15bb53960efb21d31468"
#define CEF_API_HASH_PLATFORM "9682b2251f9973ee9eee0940eb9c773e522c2975"
#endif
#ifdef __cplusplus

View File

@@ -105,6 +105,20 @@ class CefDisplay : public CefBaseRefCounted {
/*--cef()--*/
static CefPoint ConvertScreenPointFromPixels(const CefPoint& point);
///
/// Convert |rect| from DIP screen coordinates to pixel screen coordinates.
/// This method is only used on Windows.
///
/*--cef()--*/
static CefRect ConvertScreenRectToPixels(const CefRect& rect);
///
/// Convert |rect| from pixel screen coordinates to DIP screen coordinates.
/// This method is only used on Windows.
///
/*--cef()--*/
static CefRect ConvertScreenRectFromPixels(const CefRect& rect);
///
/// Returns the unique identifier for this Display.
///