Skip to content

Commit

Permalink
Win32: ignore WM_MOUSEWHEEL events that are forwarded to other window.
Browse files Browse the repository at this point in the history
Before this commit, scrolling the property browser positioned on top
of a face in the main window would highlight the face.
  • Loading branch information
whitequark committed May 20, 2019
1 parent 5dbe090 commit 7f75148
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platform/guiwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ class WindowImplWin32 final : public Window {
event.shiftDown = (wParam & MK_SHIFT) != 0;
event.controlDown = (wParam & MK_CONTROL) != 0;

bool consumed = false;
switch(msg) {
case WM_LBUTTONDOWN:
event.button = MouseEvent::Button::LEFT;
Expand Down Expand Up @@ -872,6 +873,7 @@ class WindowImplWin32 final : public Window {
sscheck(hWindowUnderMouse = WindowFromPoint(pt));
if(hWindowUnderMouse && hWindowUnderMouse != h) {
SendMessageW(hWindowUnderMouse, msg, wParam, lParam);
consumed = true;
break;
}

Expand Down Expand Up @@ -903,7 +905,7 @@ class WindowImplWin32 final : public Window {
}
}

if(window->onMouseEvent) {
if(!consumed && window->onMouseEvent) {
window->onMouseEvent(event);
}
break;
Expand Down

0 comments on commit 7f75148

Please sign in to comment.