mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 20:19:14 +02:00
Qt: do not restore lcl app if we are minimized & restored via pager actions (switching virtual desktops).
git-svn-id: trunk@31298 -
This commit is contained in:
parent
2c28620def
commit
e6ada195c2
@ -173,6 +173,7 @@ type
|
||||
public
|
||||
{$IFDEF HASX11}
|
||||
FLastMinimizeEvent: DWord; // track mainform minimize events -> TQtMainWindow.EventFilter
|
||||
FMinimizedByPager: Boolean; // track if app is minimized via desktop pager or by us.
|
||||
{$ENDIF}
|
||||
function CreateDefaultFont: HFONT; virtual;
|
||||
function GetDefaultAppFontName: WideString;
|
||||
|
@ -96,6 +96,7 @@ begin
|
||||
StayOnTopList := nil;
|
||||
FEatNextDeactivate := False;
|
||||
{$IFDEF HASX11}
|
||||
FMinimizedByPager := False;
|
||||
FLastMinimizeEvent := 0;
|
||||
if ((QtVersionMajor = 4) and (QtVersionMinor < 6)) or IsOldKDEInstallation then
|
||||
QtX11InitializePalettes;
|
||||
|
@ -5063,7 +5063,10 @@ begin
|
||||
AState := getWindowState;
|
||||
IsMinimizeEvent := AState and QtWindowMinimized <> 0;
|
||||
if IsMinimizeEvent then
|
||||
begin
|
||||
CanSendEvent := IsCurrentDesktop(Widget);
|
||||
QtWidgetSet.FMinimizedByPager := not CanSendEvent;
|
||||
end;
|
||||
{$ENDIF}
|
||||
if IsMainForm and CanSendEvent then
|
||||
begin
|
||||
@ -5078,7 +5081,16 @@ begin
|
||||
if (AOldState and QtWindowMinimized <> 0) or
|
||||
(AOldState and QtWindowMaximized <> 0) or
|
||||
(AOldState and QtWindowFullScreen <> 0) then
|
||||
Application.IntfAppRestore;
|
||||
begin
|
||||
{$IFDEF HASX11}
|
||||
// do not activate lazarus app if it wasn't active during
|
||||
// pager switch !
|
||||
if (AOldState and QtWindowMinimized <> 0) and QtWidgetSet.FMinimizedByPager then
|
||||
QtWidgetSet.FMinimizedByPager := False
|
||||
else
|
||||
{$ENDIF}
|
||||
Application.IntfAppRestore;
|
||||
end;
|
||||
end;
|
||||
if CanSendEvent then
|
||||
SlotWindowStateChange;
|
||||
|
Loading…
Reference in New Issue
Block a user