mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: fullscreen restoration on Windows (#49892)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -197,6 +197,14 @@ void ElectronDesktopWindowTreeHostWin::SetAllowScreenshots(bool allow) {
|
||||
UpdateAllowScreenshots();
|
||||
}
|
||||
|
||||
// Refs https://chromium-review.googlesource.com/c/chromium/src/+/7095963
|
||||
// Chromium's fullscreen handler conflicts with ours and results in incorrect
|
||||
// restoration.
|
||||
void ElectronDesktopWindowTreeHostWin::Restore() {
|
||||
::SendMessage(GetAcceleratedWidget(), WM_SYSCOMMAND,
|
||||
static_cast<WPARAM>(SC_RESTORE), 0);
|
||||
}
|
||||
|
||||
void ElectronDesktopWindowTreeHostWin::UpdateAllowScreenshots() {
|
||||
bool allowed = views::DesktopWindowTreeHostWin::AreScreenshotsAllowed();
|
||||
if (allowed == allow_screenshots_)
|
||||
|
||||
@@ -50,6 +50,7 @@ class ElectronDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin,
|
||||
LRESULT* result) override;
|
||||
void HandleVisibilityChanged(bool visible) override;
|
||||
void SetAllowScreenshots(bool allow) override;
|
||||
void Restore() override;
|
||||
|
||||
// ui::NativeThemeObserver:
|
||||
void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
|
||||
|
||||
Reference in New Issue
Block a user