mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 13:39:24 +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 = (
|
TWidgetInfoFlag = (
|
||||||
wwiNotOnParentsClientArea
|
wwiNotOnParentsClientArea,
|
||||||
|
wwiValidQueuedEvent // Mark this widgetinfo as valid queued proc
|
||||||
|
// see gtkwsmenus.pp: gtkWSPopupMenuDeactivate
|
||||||
);
|
);
|
||||||
TWidgetInfoFlags = set of TWidgetInfoFlag;
|
TWidgetInfoFlags = set of TWidgetInfoFlag;
|
||||||
tGtkStateEnumRange = 0..31;
|
tGtkStateEnumRange = 0..31;
|
||||||
|
@ -371,14 +371,22 @@ begin
|
|||||||
Y^ := Point^.Y;
|
Y^ := Point^.Y;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function gtkWSPopupDelayedClose(WidgetInfo: Pointer): gboolean; cdecl;
|
function gtkWSPopupDelayedClose(Data: Pointer): gboolean; cdecl;
|
||||||
|
var
|
||||||
|
WidgetInfo: PWidgetInfo absolute Data;
|
||||||
begin
|
begin
|
||||||
TPopupMenu(PWidgetInfo(WidgetInfo)^.LCLObject).Close;
|
|
||||||
Result := False;
|
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;
|
end;
|
||||||
|
|
||||||
function gtkWSPopupMenuDeactivate(widget: PGtkWidget; data: gPointer): GBoolean; cdecl;
|
function gtkWSPopupMenuDeactivate(widget: PGtkWidget; data: gPointer): GBoolean; cdecl;
|
||||||
begin
|
begin
|
||||||
|
Include(PWidgetInfo(Data)^.Flags, wwiValidQueuedEvent);
|
||||||
g_idle_add(@gtkWSPopupDelayedClose, data);
|
g_idle_add(@gtkWSPopupDelayedClose, data);
|
||||||
Result := CallBackDefaultReturn;
|
Result := CallBackDefaultReturn;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user