mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 16:31:40 +02:00
LCL-GTK2: Filter the messages in function PeekMessage. Issue #41407, patch by Artem Izmaylov.
This commit is contained in:
parent
efe7efbc39
commit
4a8f31afdb
@ -6844,10 +6844,18 @@ function TGtk2WidgetSet.PeekMessage(var lpMsg: TMsg; Handle : HWND;
|
||||
var
|
||||
vlItem : TGtkMessageQueueItem;
|
||||
begin
|
||||
//TODO Filtering
|
||||
fMessageQueue.Lock;
|
||||
try
|
||||
vlItem := fMessageQueue.FirstMessageItem;
|
||||
|
||||
// filtering
|
||||
while (vlItem <> nil) and (
|
||||
((Handle <> 0) and (vlItem.Msg^.hwnd <> Handle)) or // filter by handle
|
||||
((wMsgFilterMin <> 0) and (wMsgFilterMax <> 0) and // filter by message-range
|
||||
not InRange(vlItem.Msg^.message, wMsgFilterMin, wMsgFilterMax)))
|
||||
do
|
||||
vlItem := TGtkMessageQueueItem(vlItem.Next);
|
||||
|
||||
Result := vlItem <> nil;
|
||||
if Result then begin
|
||||
lpMsg := vlItem.Msg^;
|
||||
|
Loading…
Reference in New Issue
Block a user