Gtk2: fixed asserts from gtk2 lib when using gtk_window_set_keep_above() but our form is reparented to some other control (eg. TPanel).

git-svn-id: trunk@27288 -
This commit is contained in:
zeljko 2010-09-10 09:50:05 +00:00
parent cf350c8d33
commit 1a283e877f

View File

@ -493,8 +493,9 @@ begin
exit;
if (csDesigning in AForm.ComponentState) then
exit;
gtk_window_set_keep_above(PGtkWindow(AForm.Handle),
GBoolean(AFormStyle in fsAllStayOnTop));
if GTK_IS_WINDOW(PGtkWindow(AForm.Handle)) then
gtk_window_set_keep_above(PGtkWindow(AForm.Handle),
GBoolean(AFormStyle in fsAllStayOnTop));
end;
{class function TGtk2WSCustomForm.GetDefaultClientRect(
@ -545,9 +546,10 @@ begin
AForm := TCustomForm(AWinControl);
if not (csDesigning in AForm.ComponentState) then
begin
if AForm.HandleObjectShouldBeVisible then
gtk_window_set_keep_above(PGtkWindow(AForm.Handle),
GBoolean(AForm.FormStyle in fsAllStayOnTop))
if AForm.HandleObjectShouldBeVisible and
GTK_IS_WINDOW(PGtkWindow(AForm.Handle)) then
gtk_window_set_keep_above(PGtkWindow(AForm.Handle),
GBoolean(AForm.FormStyle in fsAllStayOnTop))
else
if (AForm.FormStyle in fsAllStayOnTop) and
not (csDestroying in AWinControl.ComponentState) then