gtk ShowInTaskbar patch attached
Index: lcl/interfaces/gtk/gtkobject.inc
===================================================================
--- lcl/interfaces/gtk/gtkobject.inc (Revision 8080)
+++ lcl/interfaces/gtk/gtkobject.inc (Arbeitskopie)
@@ -4688,6 +4551,9 @@
if ASetupProps then
{ TODO: call this in CreateHandle when converted: SetProperties(ALCLObject) };
+ if ALCLObject is TCustomForm then
+ TGtkWSCustomForm.SetShowInTaskbar(ALCLObject as TCustomForm, (ALCLObject as TCustomForm).ShowInTaskbar);
+
if AGTKObject <> nil then begin
{$IFNDEF NoStyle}
if (ALCLObject is TCustomForm) and (TCustomForm(ALCLObject).Parent=nil) then
Index: lcl/interfaces/gtk/gtkwsforms.pp
===================================================================
--- lcl/interfaces/gtk/gtkwsforms.pp (Revision 8080)
+++ lcl/interfaces/gtk/gtkwsforms.pp (Arbeitskopie)
@@ -88,7 +88,7 @@
class procedure SetFormBorderStyle(const AForm: TCustomForm;
const AFormBorderStyle: TFormBorderStyle); override;
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
- class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: Boolean); override;
+ class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: TShowInTaskbar); override;
class procedure ShowModal(const ACustomForm: TCustomForm); override;
class procedure SetBorderIcons(const AForm: TCustomForm;
const ABorderIcons: TBorderIcons); override;
@@ -210,20 +210,36 @@
end;
procedure TGtkWSCustomForm.SetShowInTaskbar(const AForm: TCustomForm;
- const AValue: Boolean);
+ const AValue: TShowInTaskbar);
+var
{$IFDEF GTK1}
-var
AWindow: PGdkWindowPrivate;
{$ENDIF}
+ enable: Boolean;
+ v: Integer;
begin
- if (AForm.Parent<>nil) or not (AForm.HandleAllocated) then exit;
+ if (AForm.Parent<>nil) or not (AForm.HandleAllocated) then begin
+ Writeln('BROKEN BROKEN BROKEN');
+ if not AForm.HandleAllocated then begin
+ Writeln('no handle');
+ //DumpBacktrace;
+ DumpStack;
+ end;
+ exit;
+ end;
+ enable := AValue <> stNever;
+
+ if (Application.MainForm <> nil) and (Application.MainForm <> AForm) and (AValue = stDefault) then begin
+ enable := False;
+ end;
+
{$IFDEF GTK1}
AWindow := PGdkWindowPrivate(PGtkWidget(AForm.Handle)^.window);
- GDK_WINDOW_SHOW_IN_TASKBAR(AWindow,AValue);
+ GDK_WINDOW_SHOW_IN_TASKBAR(AWindow, enable);
{$ELSE}
- DebugLn('TGtkWSCustomForm.SetShowInTaskbar ',dbgsName(AForm),' ',dbgs(AValue));
- gtk_window_set_skip_taskbar_hint(PGtkWindow(AForm.Handle), not AValue);
+ DebugLn('TGtkWSCustomForm.SetShowInTaskbar ',dbgsName(AForm),' ',dbgs(enable));
+ gtk_window_set_skip_taskbar_hint(PGtkWindow(AForm.Handle), not enable);
{$ENDIF}
end;
Index: lcl/interfaces/gtk2/gtk2int.pas
===================================================================
--- lcl/interfaces/gtk2/gtk2int.pas (Revision 8080)
+++ lcl/interfaces/gtk2/gtk2int.pas (Arbeitskopie)
@@ -67,6 +67,15 @@
MultiSelect, ExtendedSelect: boolean); override;
//function SetTopIndex(Sender: TObject; NewTopIndex: integer): integer; override;
procedure UpdateDCTextMetric(DC: TDeviceContext); override;
+
+ procedure InitializeFileDialog(FileDialog: TFileDialog;
+ var SelWidget: PGtkWidget; Title: PChar); override;
+ function CreateOpenDialogFilter(OpenDialog: TOpenDialog;
+ SelWidget: PGtkWidget): string; override;
+ procedure InitializeOpenDialog(OpenDialog: TOpenDialog;
+ SelWidget: PGtkWidget); override;
+ procedure CreatePreviewDialogControl(
+ PreviewDialog: TPreviewFileDialog; SelWidget: PGtkWidget); override;
public
{$I gtk2winapih.inc}
{$I gtk2lclintfh.inc}