mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 11:30:28 +02:00
win32 interface: prevent recursion when redirecting a WM_MOUSEWHEEL message
git-svn-id: trunk@10845 -
This commit is contained in:
parent
a0cd202e73
commit
50948b0577
@ -1587,13 +1587,15 @@ begin
|
||||
// check if the window is an edit control of a combobox, if so,
|
||||
// redirect it to the combobox, not the edit control
|
||||
if GetWindowInfo(TargetWindow)^.isComboEdit then
|
||||
begin
|
||||
TargetWindow := Windows.GetParent(TargetWindow);
|
||||
if (TargetWindow <> Window) then
|
||||
begin
|
||||
Result := SendMessage(TargetWindow, WM_MOUSEWHEEL, WParam, LParam);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// check InMouseWheelRedirection to prevent recursion
|
||||
if not InMouseWheelRedirection and (TargetWindow <> Window) then
|
||||
begin
|
||||
InMouseWheelRedirection := true;
|
||||
Result := SendMessage(TargetWindow, WM_MOUSEWHEEL, WParam, LParam);
|
||||
InMouseWheelRedirection := false;
|
||||
exit;
|
||||
end;
|
||||
|
||||
// the mousewheel message is for us
|
||||
|
@ -302,6 +302,8 @@ var
|
||||
MouseDownFocusStatus: TMouseDownFocusStatus = mfNone;
|
||||
ComboBoxHandleSizeWindow: HWND = 0;
|
||||
IgnoreNextCharWindow: HWND = 0; // ignore next WM_(SYS)CHAR message
|
||||
// set to true, if we are redirecting a WM_MOUSEWHEEL message, to prevent recursion
|
||||
InMouseWheelRedirection: boolean = false;
|
||||
OnClipBoardRequest: TClipboardRequestEvent;
|
||||
{$ifdef MSG_DEBUG}
|
||||
MessageStackDepth: string = '';
|
||||
|
Loading…
Reference in New Issue
Block a user