Hello!
Here's another problem with Modal window on OS X I get.
When I show form with ShowModal, and it tries to show PopupMenu, it get's under the form itself, so you don't see the menu, and all visible controls get locked. You can see the PopupMenu on a different desktop if you switch OS X desktop with three finger swipe.
If I show the form with Show, PopupMenu appears without any problem.
Here's the test app (just add two buttons to the form and paste the source):
unit unit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
Menus;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var PopupMenu1 : TPopupMenu;
begin
PopupMenu1:=TPopupMenu.Create(Self);
PopupMenu1.Items.Add(TMenuItem.Create(PopupMenu));
PopupMenu1.Items[0].Caption:='Test 1';
PopupMenu1.PopUp;
end;
procedure TForm1.Button2Click(Sender: TObject);
var F : TForm;
begin
F:=TForm.CreateNew(Self);
F.InsertControl(TButton.Create(F));
TButton(F.Controls[0]).Caption:='Test popup';
TButton(F.Controls[0]).OnClick:=@Button1Click;
F.ShowModal;
end;
end.
Any ideas how to fix that? Is it a bug?