mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-27 09:53:51 +02:00
Qt: workaround for xfwm4 (xfce) buggy modal window handling. Fixes printer dialogs.
git-svn-id: trunk@40623 -
This commit is contained in:
parent
2dc5477b36
commit
b6079827c4
components/printers
@ -92,7 +92,7 @@ uses
|
||||
{$ENDIF}
|
||||
{$ELSE}
|
||||
{$IFDEF LCLQt}
|
||||
uses Controls, qtobjects, qt4, FileUtil;
|
||||
uses Controls, qtobjects, qt4, qtint, FileUtil;
|
||||
{$I qtprndialogs.inc}
|
||||
{$ELSE}
|
||||
uses Controls, udlgSelectPrinter, udlgPropertiesPrinter, udlgPageSetup, FileUtil;
|
||||
|
@ -6,6 +6,9 @@
|
||||
function TPageSetupDialog.Execute: Boolean;
|
||||
var
|
||||
PgDlg: QPageSetupDialogH;
|
||||
{$IFDEF HASX11}
|
||||
AWND: HWND;
|
||||
{$ENDIF}
|
||||
begin
|
||||
Result := False;
|
||||
if not Assigned(Printer) then Exit;
|
||||
@ -16,6 +19,14 @@ begin
|
||||
finally
|
||||
QPageSetupDialog_destroy(PgDlg);
|
||||
end;
|
||||
{$IFDEF HASX11}
|
||||
if (QtWidgetSet.WindowManagerName = 'xfwm4') and (QApplication_activeModalWidget() <> nil) then
|
||||
begin
|
||||
AWND := HwndFromWidgetH(QApplication_activeModalWidget());
|
||||
if (AWND <> 0) and (X11GetActivewindow <> TQtWidget(AWND).Widget) then
|
||||
X11Raise(QWidget_winID(TQtWidget(AWND).Widget));
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{ TPrinterSetupDialog }
|
||||
@ -23,6 +34,9 @@ end;
|
||||
function TPrinterSetupDialog.Execute: Boolean;
|
||||
var
|
||||
PgDlg: QPageSetupDialogH;
|
||||
{$IFDEF HASX11}
|
||||
AWND: HWND;
|
||||
{$ENDIF}
|
||||
begin
|
||||
Result := False;
|
||||
if not Assigned(Printer) then Exit;
|
||||
@ -35,6 +49,14 @@ begin
|
||||
finally
|
||||
QPageSetupDialog_destroy(PgDlg);
|
||||
end;
|
||||
{$IFDEF HASX11}
|
||||
if (QtWidgetSet.WindowManagerName = 'xfwm4') and (QApplication_activeModalWidget() <> nil) then
|
||||
begin
|
||||
AWND := HwndFromWidgetH(QApplication_activeModalWidget());
|
||||
if (AWND <> 0) and (X11GetActivewindow <> TQtWidget(AWND).Widget) then
|
||||
X11Raise(QWidget_winID(TQtWidget(AWND).Widget));
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{ TPrintDialog }
|
||||
@ -45,6 +67,9 @@ var
|
||||
PrnOptions: QAbstractPrintDialogPrintDialogOptions;
|
||||
Str: WideString;
|
||||
S: String;
|
||||
{$IFDEF HASX11}
|
||||
AWND: HWND;
|
||||
{$ENDIF}
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
@ -125,5 +150,14 @@ begin
|
||||
finally
|
||||
QPrintDialog_destroy(QtPrnDlg);
|
||||
end;
|
||||
|
||||
{$IFDEF HASX11}
|
||||
if (QtWidgetSet.WindowManagerName = 'xfwm4') and (QApplication_activeModalWidget() <> nil) then
|
||||
begin
|
||||
AWND := HwndFromWidgetH(QApplication_activeModalWidget());
|
||||
if (AWND <> 0) and (X11GetActivewindow <> TQtWidget(AWND).Widget) then
|
||||
X11Raise(QWidget_winID(TQtWidget(AWND).Widget));
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user