electron/patches/common/chromium/disable-redraw-lock.patch
Jeremy Apthorp 76c5f5cc8a
build: move libcc patches to electron repo (#14104)
In the GN build, libchromiumcontent is no longer a distinct library, but
merely a container for a set of scripts and patches. Maintaining those
patches in a separate repository is tedious and error-prone, so merge
them into the main repo.

Once this is merged and GN is the default way to build Electron, the
libchromiumcontent repository can be archived.
2018-09-13 22:02:16 -07:00

60 lines
2.4 KiB
Diff

diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index c8fb7eecb9c8..3d995aa331b1 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -251,6 +251,10 @@ const int kSynthesizedMouseMessagesTimeDifference = 500;
} // namespace
+bool HWNDMessageHandlerDelegate::HasNativeFrame() const {
+ return false;
+}
+
// A scoping class that prevents a window from being able to redraw in response
// to invalidations that may occur within it for the lifetime of the object.
//
@@ -302,6 +306,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
cancel_unlock_(false),
should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() &&
::IsWindow(hwnd_) &&
+ !owner_->HasNativeFrame() &&
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
!ui::win::IsAeroGlassEnabled())) {
if (should_lock_)
@@ -903,6 +908,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() {
hwnd());
}
+bool HWNDMessageHandler::HasNativeFrame() {
+ return delegate_->HasNativeFrame();
+}
+
////////////////////////////////////////////////////////////////////////////////
// HWNDMessageHandler, gfx::WindowImpl overrides:
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 5d5765c1928e..d77991cfa737 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -227,6 +227,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
typedef std::set<DWORD> TouchIDs;
enum class DwmFrameState { OFF, ON };
+ bool HasNativeFrame();
+
// Overridden from WindowImpl:
HICON GetDefaultWindowIcon() const override;
HICON GetSmallWindowIcon() const override;
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
index d13f807e4a75..877189d63616 100644
--- a/ui/views/win/hwnd_message_handler_delegate.h
+++ b/ui/views/win/hwnd_message_handler_delegate.h
@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
// True if the widget associated with this window has a non-client view.
virtual bool HasNonClientView() const = 0;
+ virtual bool HasNativeFrame() const;
+
// Returns who we want to be drawing the frame. Either the system (Windows)
// will handle it or Chrome will custom draw it.
virtual FrameMode GetFrameMode() const = 0;