LCL-QT5: Support -Sy.

This commit is contained in:
Juha 2023-07-16 11:00:48 +03:00
parent 0a0a7e5bb5
commit 02ddfe3ecd
3 changed files with 14 additions and 18 deletions

View File

@ -35,7 +35,7 @@ uses
// Bindings - qt5 must come first to avoid type redefinition problems
qt5,
// RTL
Classes, SysUtils, Math, Types,
Classes, SysUtils, Math, Types, ctypes,
// LCL
InterfaceBase, LCLPlatformDef, LCLProc, LCLType, LMessages,
LCLMessageGlue, LCLStrConsts, Controls, ExtCtrls, Forms,

View File

@ -5152,7 +5152,7 @@ begin
if (AnObject = nil) or (AQtClass = '') then
Result := False
else
Result := QObject_inherits(AnObject, @AQtClass);
Result := QObject_inherits(AnObject, PAnsiChar(@AQtClass)); // Suspicious typecast! (by Juha)
end;
constructor TQtObjectDump.Create(AnObject: QObjectH);

View File

@ -66,12 +66,10 @@ var
ScreenNum: Integer;
RootWin: TWindow;
WMAtom: TAtom;
typeReturned: TAtom;
formatReturned: Integer;
nitemsReturned: PtrInt;
unused: PtrInt;
WidgetIndex, DesktopIndex: Pointer;
nitemsReturned, unused: culong;
WidgetIndex, DesktopIndex: pcuchar;
WidgetWin: TWindow;
begin
Result := True;
@ -148,7 +146,7 @@ begin
XClient.data.l[2] := 0;
Result := XSendEvent(Display, RootWin, False,
SubstructureRedirectMask or SubstructureNotifyMask,
@XClient) <> Success;
PXEvent(@XClient)) <> Success; // Suspicious typecast! (by Juha)
end;
function X11GetActiveWindow: QWidgetH;
@ -159,8 +157,8 @@ var
WMAtom: TAtom;
ActualTypeReturn: TAtom;
ActualFormatReturn: LongInt;
NItemsReturn, BytesAfterReturn: Cardinal;
Ptr: Pointer;
NItemsReturn, BytesAfterReturn: culong;
Ptr: Pcuchar;
Valid: Boolean;
begin
Result := nil;
@ -207,9 +205,8 @@ var
typeReturned: TAtom;
formatReturned: Integer;
nitemsReturned: PtrInt;
unused: PtrInt;
data: Pointer;
nitemsReturned, unused: culong;
data: Pcuchar;
begin
Result := '';
@ -256,7 +253,7 @@ begin
@unused, @data) = Success then
begin
if (typeReturned = WMAtom) and (formatReturned = 8) then
Result := StrPas(Data);
Result := StrPas(PChar(Data));
if Data <> nil then
XFree(Data);
Data := nil;
@ -334,7 +331,7 @@ begin
Xclient.data.l[4] := 0;
XSendEvent (Display, RootWin, False,
SubstructureRedirectMask or SubstructureNotifyMask,
@Xclient);
PXEvent(@Xclient)); // Suspicious typecast! (by Juha)
end;
function GetAlwaysOnTopX11(Widget: QWidgetH): boolean;
@ -344,9 +341,8 @@ var
WMAtom: TAtom;
typeReturned: TAtom;
formatReturned: Integer;
nitemsReturned: PtrInt;
unused: PtrInt;
data: Pointer;
nitemsReturned, unused: culong;
data: pcuchar;
begin
Result := False;
if IsWayland then
@ -395,7 +391,7 @@ end;
function GetKeyLockState(const AKey: Byte): Boolean;
var
Display: PDisplay;
n: Cardinal;
n: Word;
begin
Result := False;
if IsWayland then