mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 22:09:21 +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
|
public
|
||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
FLastMinimizeEvent: DWord; // track mainform minimize events -> TQtMainWindow.EventFilter
|
FLastMinimizeEvent: DWord; // track mainform minimize events -> TQtMainWindow.EventFilter
|
||||||
|
FMinimizedByPager: Boolean; // track if app is minimized via desktop pager or by us.
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
function CreateDefaultFont: HFONT; virtual;
|
function CreateDefaultFont: HFONT; virtual;
|
||||||
function GetDefaultAppFontName: WideString;
|
function GetDefaultAppFontName: WideString;
|
||||||
|
@ -96,6 +96,7 @@ begin
|
|||||||
StayOnTopList := nil;
|
StayOnTopList := nil;
|
||||||
FEatNextDeactivate := False;
|
FEatNextDeactivate := False;
|
||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
|
FMinimizedByPager := False;
|
||||||
FLastMinimizeEvent := 0;
|
FLastMinimizeEvent := 0;
|
||||||
if ((QtVersionMajor = 4) and (QtVersionMinor < 6)) or IsOldKDEInstallation then
|
if ((QtVersionMajor = 4) and (QtVersionMinor < 6)) or IsOldKDEInstallation then
|
||||||
QtX11InitializePalettes;
|
QtX11InitializePalettes;
|
||||||
|
@ -5063,7 +5063,10 @@ begin
|
|||||||
AState := getWindowState;
|
AState := getWindowState;
|
||||||
IsMinimizeEvent := AState and QtWindowMinimized <> 0;
|
IsMinimizeEvent := AState and QtWindowMinimized <> 0;
|
||||||
if IsMinimizeEvent then
|
if IsMinimizeEvent then
|
||||||
|
begin
|
||||||
CanSendEvent := IsCurrentDesktop(Widget);
|
CanSendEvent := IsCurrentDesktop(Widget);
|
||||||
|
QtWidgetSet.FMinimizedByPager := not CanSendEvent;
|
||||||
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if IsMainForm and CanSendEvent then
|
if IsMainForm and CanSendEvent then
|
||||||
begin
|
begin
|
||||||
@ -5078,8 +5081,17 @@ begin
|
|||||||
if (AOldState and QtWindowMinimized <> 0) or
|
if (AOldState and QtWindowMinimized <> 0) or
|
||||||
(AOldState and QtWindowMaximized <> 0) or
|
(AOldState and QtWindowMaximized <> 0) or
|
||||||
(AOldState and QtWindowFullScreen <> 0) then
|
(AOldState and QtWindowFullScreen <> 0) then
|
||||||
|
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;
|
Application.IntfAppRestore;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
if CanSendEvent then
|
if CanSendEvent then
|
||||||
SlotWindowStateChange;
|
SlotWindowStateChange;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user