Qt5,Qt6: fixed restoring secondary minimized window. issue #40243

This commit is contained in:
Željan Rikalo 2024-11-20 08:31:14 +01:00
parent 9846c0c8f4
commit 107d8dbeae
2 changed files with 8 additions and 6 deletions

View File

@ -2010,7 +2010,6 @@ begin
Result := SIMPLEREGION Result := SIMPLEREGION
else else
Result := COMPLEXREGION; Result := COMPLEXREGION;
finally finally
QRegion_destroy(ClipRegion); QRegion_destroy(ClipRegion);
QRegion_destroy(Region); QRegion_destroy(Region);
@ -5996,7 +5995,7 @@ begin
{$note this should return current system active window, not {$note this should return current system active window, not
application one, if our app isn''t active. application one, if our app isn''t active.
This is per MSDN and pretty win32 specific} This is per MSDN and pretty win32 specific}
if WindowManagerName = 'metacity' then if not IsWayland and (WindowManagerName = 'metacity') then
Result := HwndFromWidgetH(X11GetActivewindow) Result := HwndFromWidgetH(X11GetActivewindow)
else else
Result := GetActiveWindow; Result := GetActiveWindow;
@ -6011,7 +6010,9 @@ begin
if HWND <> 0 then if HWND <> 0 then
begin begin
Result := TQtWidget(HWND).IsActiveWindow; Result := TQtWidget(HWND).IsActiveWindow;
TQtWidget(HWnd).Activate; if (TQtWidget(Hwnd).getWindowState and QtWindowMinimized) = QtWindowMinimized then
TQtWidget(Hwnd).ShowNormal;
TQtWidget(HWnd).BringToFront;
end; end;
end; end;

View File

@ -2007,7 +2007,6 @@ begin
Result := SIMPLEREGION Result := SIMPLEREGION
else else
Result := COMPLEXREGION; Result := COMPLEXREGION;
finally finally
QRegion_destroy(ClipRegion); QRegion_destroy(ClipRegion);
QRegion_destroy(Region); QRegion_destroy(Region);
@ -6038,7 +6037,7 @@ begin
{$note this should return current system active window, not {$note this should return current system active window, not
application one, if our app isn''t active. application one, if our app isn''t active.
This is per MSDN and pretty win32 specific} This is per MSDN and pretty win32 specific}
if WindowManagerName = 'metacity' then if not IsWayland and (WindowManagerName = 'metacity') then
Result := HwndFromWidgetH(X11GetActivewindow) Result := HwndFromWidgetH(X11GetActivewindow)
else else
Result := GetActiveWindow; Result := GetActiveWindow;
@ -6053,7 +6052,9 @@ begin
if HWND <> 0 then if HWND <> 0 then
begin begin
Result := TQtWidget(HWND).IsActiveWindow; Result := TQtWidget(HWND).IsActiveWindow;
TQtWidget(HWnd).Activate; if (TQtWidget(Hwnd).getWindowState and QtWindowMinimized) = QtWindowMinimized then
TQtWidget(Hwnd).ShowNormal;
TQtWidget(HWnd).BringToFront;
end; end;
end; end;