mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 14:09:16 +02:00
Qt,Qt5: fixed LCLIntf.GetActiveWindow for modal & popup windows
git-svn-id: trunk@57492 -
This commit is contained in:
parent
9306b45921
commit
76ca6e71a8
@ -622,7 +622,7 @@ end;
|
||||
function TQtWidgetSet.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
|
||||
var
|
||||
AObject: TQtObject;
|
||||
W: TQtMainWindow;
|
||||
W: TQtWidget;
|
||||
LCLEvent: QLCLMessageEventH;
|
||||
ASequence: QKeySequenceH;
|
||||
AKey: WideString;
|
||||
@ -809,8 +809,9 @@ begin
|
||||
// eat next appdeactivate & appactivate since we are changing form
|
||||
// flags !
|
||||
if (StayOnTopList <> nil) then
|
||||
W := TQtMainWindow(HWNDFromWidgetH(QApplication_activeWindow()))
|
||||
else
|
||||
begin
|
||||
W := TQtWidget(GetActiveWindow);
|
||||
end else
|
||||
W := nil;
|
||||
Application.IntfAppActivate;
|
||||
QtRestoreStayOnTop;
|
||||
|
@ -2498,12 +2498,17 @@ var
|
||||
begin
|
||||
Result := 0;
|
||||
Widget := QApplication_activeWindow;
|
||||
if Widget <> nil then
|
||||
{return modal if activeWindow is nil issue #33409}
|
||||
if Widget = nil then
|
||||
Widget := QApplication_activeModalWidget;
|
||||
if Widget = nil then
|
||||
Widget := QApplication_activePopupWidget;
|
||||
if Assigned(Widget) then
|
||||
begin
|
||||
W := QtObjectFromWidgetH(Widget);
|
||||
if W <> nil then
|
||||
if Assigned(W) and IsValidHandle(HWND(W)) then
|
||||
begin
|
||||
if TQtMainWindow(W).MDIAreaHandle <> nil then
|
||||
if (TQtWidget(W) is TQtMainWindow) and (TQtMainWindow(W).MDIAreaHandle <> nil) then
|
||||
begin
|
||||
Area := QMdiAreaH(TQtMainWindow(W).MDIAreaHandle.Widget);
|
||||
SubW := QtObjectFromWidgetH(QMdiArea_activeSubWindow(Area));
|
||||
|
@ -574,7 +574,7 @@ end;
|
||||
function TQtWidgetSet.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
|
||||
var
|
||||
AObject: TQtObject;
|
||||
W: TQtMainWindow;
|
||||
W: TQtWidget;
|
||||
LCLEvent: QLCLMessageEventH;
|
||||
ASequence: QKeySequenceH;
|
||||
AKey: WideString;
|
||||
@ -764,7 +764,7 @@ begin
|
||||
// eat next appdeactivate & appactivate since we are changing form
|
||||
// flags !
|
||||
if (StayOnTopList <> nil) then
|
||||
W := TQtMainWindow(HWNDFromWidgetH(QApplication_activeWindow()))
|
||||
W := TQtWidget(GetActiveWindow)
|
||||
else
|
||||
W := nil;
|
||||
Application.IntfAppActivate;
|
||||
|
@ -2445,12 +2445,17 @@ var
|
||||
begin
|
||||
Result := 0;
|
||||
Widget := QApplication_activeWindow;
|
||||
{return modal if activeWindow is nil issue #33409}
|
||||
if Widget = nil then
|
||||
Widget := QApplication_activeModalWidget;
|
||||
if Widget = nil then
|
||||
Widget := QApplication_activePopupWidget;
|
||||
if Widget <> nil then
|
||||
begin
|
||||
W := QtObjectFromWidgetH(Widget);
|
||||
if W <> nil then
|
||||
if Assigned(W) and IsValidHandle(HWND(W)) then
|
||||
begin
|
||||
if TQtMainWindow(W).MDIAreaHandle <> nil then
|
||||
if (TQtWidget(W) is TQtMainWindow) and Assigned(TQtMainWindow(W).MDIAreaHandle) then
|
||||
begin
|
||||
Area := QMdiAreaH(TQtMainWindow(W).MDIAreaHandle.Widget);
|
||||
SubW := QtObjectFromWidgetH(QMdiArea_activeSubWindow(Area));
|
||||
@ -6007,6 +6012,8 @@ var
|
||||
W: QWidgetH;
|
||||
begin
|
||||
{$IFDEF HASX11}
|
||||
{$note this should return current system active window, not
|
||||
application one, if our app isn''t active.}
|
||||
if WindowManagerName = 'metacity' then
|
||||
W := X11GetActivewindow
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user