Qt5: fixed bug with modal windows under gnome shell window manager.issue #35782

git-svn-id: trunk@61490 -
This commit is contained in:
zeljko 2019-06-30 09:29:05 +00:00
parent 7ffa3b81af
commit 8d5d46016b
2 changed files with 11 additions and 2 deletions

View File

@ -57,7 +57,7 @@ begin
FLastMinimizeEvent := 0;
FWindowManagerName := LowerCase(GetWindowManager);
// metacity wm forks. marco = mint mate wm, gnome shell = gnome 3 wm
if (FWindowManagerName = 'marco') or (FWindowManagerName = 'gnome shell') or
if (FWindowManagerName = 'marco') or // issue #35782 (FWindowManagerName = 'gnome shell') or
(UTF8Pos('mutter', FWindowManagerName) > 0) then
FWindowManagerName := 'metacity';
{$ENDIF}

View File

@ -423,6 +423,7 @@ var
W: QWidgetH;
{$ENDIF}
Flags: Cardinal;
AModalWindowFlag: QtWindowFlags;
function ShowNonModalOverModal: Boolean;
var
@ -528,7 +529,15 @@ begin
if (TCustomForm(AWinControl).BorderStyle in [bsSizeable, bsSizeToolWin]) then
Flags := Flags or QtWindowMaximizeButtonHint;
{$endif}
QWidget_setWindowFlags(Widget.Widget, QtDialog or
AModalWindowFlag := QtDialog;
{$IFDEF HASX11}
//do not translate those strings. issue #35782.
//if this fails for ubuntus < 18.04 then we must parse /etc/os-release
//for exact ubuntu version.
if (LowerCase(GetWindowManager) = 'gnome shell') then
AModalWindowFlag := QtWindow;
{$ENDIF}
QWidget_setWindowFlags(Widget.Widget, AModalWindowFlag or
{$ifdef darwin}Flags or {$endif}
GetQtBorderIcons(TCustomForm(AWinControl).BorderStyle,
TCustomForm(AWinControl).BorderIcons));