mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 03:59:56 +02:00
LCL, gtk, fix problem on closing popupmenu, issue #10884
git-svn-id: trunk@14266 -
This commit is contained in:
parent
b19cbee0b9
commit
54208be697
@ -409,7 +409,9 @@ type
|
||||
|
||||
|
||||
TWidgetInfoFlag = (
|
||||
wwiNotOnParentsClientArea
|
||||
wwiNotOnParentsClientArea,
|
||||
wwiValidQueuedEvent // Mark this widgetinfo as valid queued proc
|
||||
// see gtkwsmenus.pp: gtkWSPopupMenuDeactivate
|
||||
);
|
||||
TWidgetInfoFlags = set of TWidgetInfoFlag;
|
||||
tGtkStateEnumRange = 0..31;
|
||||
|
@ -371,14 +371,22 @@ begin
|
||||
Y^ := Point^.Y;
|
||||
end;
|
||||
|
||||
function gtkWSPopupDelayedClose(WidgetInfo: Pointer): gboolean; cdecl;
|
||||
function gtkWSPopupDelayedClose(Data: Pointer): gboolean; cdecl;
|
||||
var
|
||||
WidgetInfo: PWidgetInfo absolute Data;
|
||||
begin
|
||||
TPopupMenu(PWidgetInfo(WidgetInfo)^.LCLObject).Close;
|
||||
Result := False;
|
||||
if (WidgetInfo<>nil) and (wwiValidQueuedEvent in WidgetInfo^.Flags) then
|
||||
begin
|
||||
if WidgetInfo^.LCLObject is TPopupMenu then
|
||||
TPopupMenu(WidgetInfo^.LCLObject).Close;
|
||||
end
|
||||
//else DebugLn('No valid popupDelayedClose event');
|
||||
end;
|
||||
|
||||
function gtkWSPopupMenuDeactivate(widget: PGtkWidget; data: gPointer): GBoolean; cdecl;
|
||||
begin
|
||||
Include(PWidgetInfo(Data)^.Flags, wwiValidQueuedEvent);
|
||||
g_idle_add(@gtkWSPopupDelayedClose, data);
|
||||
Result := CallBackDefaultReturn;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user