Skip to content

Commit

Permalink
use WM_WINDOWPOSCHANGED instead
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Sep 16, 2022
1 parent f6772ab commit 7b9a1de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/webview/webview2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ impl InnerWebView {
// background color
if !attributes.transparent {
if let Some(background_color) = attributes.background_color {
set_background_color(&controller, background_color)?;
set_background_color(controller, background_color)?;
}
}

// Transparent
if attributes.transparent && !is_windows_7() {
set_background_color(&controller, (0, 0, 0, 0))?;
set_background_color(controller, (0, 0, 0, 0))?;
}

// The EventRegistrationToken is an out-param from all of the event registration calls. We're
Expand Down Expand Up @@ -616,12 +616,12 @@ window.addEventListener('mousemove', (e) => window.chrome.webview.postMessage('_
});
}

win32wm::WM_ENTERSIZEMOVE | win32wm::WM_SETFOCUS => {
win32wm::WM_SETFOCUS | win32wm::WM_ENTERSIZEMOVE => {
let controller = dwrefdata as *mut ICoreWebView2Controller;
let _ = (*controller).MoveFocus(COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC);
}

win32wm::WM_EXITSIZEMOVE => {
win32wm::WM_WINDOWPOSCHANGED => {
let controller = dwrefdata as *mut ICoreWebView2Controller;
let _ = (*controller).NotifyParentWindowPositionChanged();
}
Expand Down

0 comments on commit 7b9a1de

Please sign in to comment.