mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-03 05:39:37 +02:00
Qt: added GetX11WindowGeometry() helper function.
git-svn-id: trunk@51887 -
This commit is contained in:
parent
821414b0ce
commit
0536648325
@ -273,6 +273,7 @@ type
|
||||
{Ask for _NET_FRAME_EXTENTS,_KDE_NET_WM_SHADOW,_GTK_NET_FRAME_EXTENTS}
|
||||
function GetX11RectForAtom(AWinID: LongWord; const AAtomName: string; out ARect: TRect): boolean;
|
||||
function GetX11WindowPos(AWinID: LongWord; out ALeft, ATop: integer): boolean;
|
||||
function GetX11WindowGeometry(AWinID: LongWord; out ARect: TRect): boolean;
|
||||
{check if wm supports request for frame extents}
|
||||
function AskX11_NET_REQUEST_FRAME_EXTENTS(AWinID: LongWord; out AMargins: TRect): boolean;
|
||||
{$ENDIF}
|
||||
|
@ -510,6 +510,34 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetX11WindowGeometry(AWinID: LongWord; out ARect: TRect): boolean;
|
||||
var
|
||||
d: PDisplay;
|
||||
ARootWin, X11Window: TWindow;
|
||||
ABorder, ADepth: integer;
|
||||
begin
|
||||
Result := False;
|
||||
d := QX11Info_display();
|
||||
with ARect do
|
||||
begin
|
||||
Left := 0;
|
||||
Top := 0;
|
||||
Right := 0;
|
||||
Bottom := 0;
|
||||
end;
|
||||
if d = nil then
|
||||
exit;
|
||||
|
||||
if AWinID = 0 then
|
||||
begin
|
||||
X11Window := XRootWindow(d, QX11Info_appScreen);
|
||||
end else
|
||||
X11Window := TWindow(AWinID);
|
||||
if X11Window = 0 then
|
||||
exit;
|
||||
Result := XGetGeometry(d, X11Window, @ARootWin, @ARect.Left, @ARect.Top, @ARect.Right, @ARect.Bottom, @ABorder, @ADepth) = 1;
|
||||
end;
|
||||
|
||||
function GetX11RectForAtom(AWinID: LongWord; const AAtomName: string; out ARect: TRect): boolean;
|
||||
var
|
||||
d: PDisplay;
|
||||
|
Loading…
Reference in New Issue
Block a user