fix: fix hover state not clear bug when BrowserWindow is not resizable (#611) (#29799)

Co-authored-by: sssooonnnggg <sssooonnnggg111@gmail.com>
This commit is contained in:
trop[bot]
2021-06-21 13:59:14 +09:00
committed by GitHub
parent f275211555
commit c90f41d0c4

View File

@@ -38,6 +38,13 @@ int FramelessView::ResizingBorderHitTest(const gfx::Point& point) {
bool can_ever_resize = frame_->widget_delegate()
? frame_->widget_delegate()->CanResize()
: false;
// https://github.com/electron/electron/issues/611
// If window isn't resizable, we should always return HTCLIENT, otherwise the
// hover state of DOM will not be cleared probably.
if (!can_ever_resize)
return HTCLIENT;
// Don't allow overlapping resize handles when the window is maximized or
// fullscreen, as it can't be resized in those states.
int resize_border = frame_->IsMaximized() || frame_->IsFullscreen()