mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-09 10:59:41 +02:00
Gtk2: do not trigger OnClick() on mouseover for menu subitems parents. fixes #7215
git-svn-id: trunk@25485 -
This commit is contained in:
parent
4c7e033ef2
commit
e46700c2e1
@ -99,7 +99,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function Gtk2MenuItemActivate(widget: PGtkWidget; data: gPointer) : GBoolean; cdecl;
|
||||
function Gtk2MenuItemActivate(widget: PGtkMenuItem; data: gPointer) : GBoolean; cdecl;
|
||||
var
|
||||
Mess: TLMActivate;
|
||||
LCLMenuItem: TMenuItem;
|
||||
@ -109,6 +109,9 @@ begin
|
||||
EventTrace('activate', data);
|
||||
{$ENDIF}
|
||||
|
||||
if not ((Widget^.flag0 = GDK_BUTTON_RELEASE) and (Widget^.timer = 0)) and (Widget^.submenu <> nil) then
|
||||
exit(False);
|
||||
|
||||
ResetDefaultIMContext;
|
||||
|
||||
if LockOnChange(PgtkObject(Widget),0) > 0 then Exit;
|
||||
@ -118,7 +121,7 @@ begin
|
||||
// the gtk fires activate for radio buttons when unchecking them
|
||||
// the LCL expects only uncheck
|
||||
if LCLMenuItem.RadioItem
|
||||
and GtkWidgetIsA(Widget, GTK_TYPE_CHECK_MENU_ITEM)
|
||||
and GtkWidgetIsA(PGtkWidget(Widget), GTK_TYPE_CHECK_MENU_ITEM)
|
||||
and (not gtk_check_menu_item_get_active(PGTKCheckMenuItem(Widget))) then Exit;
|
||||
|
||||
FillChar(Mess,SizeOf(Mess),#0);
|
||||
@ -177,9 +180,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function Gtk2MenuItemSelect(item: Pointer; AMenuItem: TMenuItem): GBoolean; cdecl;
|
||||
function Gtk2MenuItemSelect(item: PGtkMenuItem; AMenuItem: gPointer): GBoolean; cdecl;
|
||||
begin
|
||||
AMenuItem.IntfDoSelect;
|
||||
TMenuItem(AMenuItem).IntfDoSelect;
|
||||
Result := CallBackDefaultReturn;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user