mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 15:40:40 +02:00
Qt6: add x11Display function, returns xlib.PDisplay.
This commit is contained in:
parent
ea07cc1407
commit
1751d3c2ed
@ -44,6 +44,7 @@ uses
|
|||||||
GraphType, LazStringUtils, LazUtilities, LazLoggerBase, LazUTF8, Maps,
|
GraphType, LazStringUtils, LazUtilities, LazLoggerBase, LazUTF8, Maps,
|
||||||
// WS
|
// WS
|
||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
|
XAtom, X, XLib, XKB, xkblib,
|
||||||
qtx11dummywidget,
|
qtx11dummywidget,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
qtproc;
|
qtproc;
|
||||||
@ -123,6 +124,7 @@ type
|
|||||||
FStockSystemFont: HFONT;
|
FStockSystemFont: HFONT;
|
||||||
FStockDefaultDC: HDC;
|
FStockDefaultDC: HDC;
|
||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
|
FX11Display: PDisplay;
|
||||||
FWSFrameRect: TRect;
|
FWSFrameRect: TRect;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
@ -154,6 +156,7 @@ type
|
|||||||
{$IFDEF HASX11}
|
{$IFDEF HASX11}
|
||||||
function CreateDummyWidgetFrame(const ALeft, ATop, AWidth, AHeight: integer): boolean;
|
function CreateDummyWidgetFrame(const ALeft, ATop, AWidth, AHeight: integer): boolean;
|
||||||
function GetDummyWidgetFrame: TRect;
|
function GetDummyWidgetFrame: TRect;
|
||||||
|
function x11Display: PDisplay;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
public
|
public
|
||||||
constructor Create; override;
|
constructor Create; override;
|
||||||
@ -352,9 +355,6 @@ uses
|
|||||||
// To get as little as possible circles,
|
// To get as little as possible circles,
|
||||||
// uncomment only those units with implementation
|
// uncomment only those units with implementation
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
{$IFDEF HASX11}
|
|
||||||
XAtom, X, XLib, XKB, xkblib,
|
|
||||||
{$ENDIF}
|
|
||||||
QtCaret,
|
QtCaret,
|
||||||
QtThemes,
|
QtThemes,
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ begin
|
|||||||
App := QApplicationH(QCoreApplication_instance())
|
App := QApplicationH(QCoreApplication_instance())
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
FX11Display := nil;
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
//add directory plugins to the Qt paths if Qt is distributed with application under mswindows.
|
//add directory plugins to the Qt paths if Qt is distributed with application under mswindows.
|
||||||
WStr := 'plugins';
|
WStr := 'plugins';
|
||||||
@ -533,6 +534,13 @@ function TQtWidgetSet.GetDummyWidgetFrame: TRect;
|
|||||||
begin
|
begin
|
||||||
Result := FWSFrameRect;
|
Result := FWSFrameRect;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtWidgetSet.x11Display: PDisplay;
|
||||||
|
begin
|
||||||
|
if FX11Display = nil then
|
||||||
|
FX11Display := XOpenDisplay(nil);
|
||||||
|
Result := FX11Display;
|
||||||
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TQtWidgetSet.SetOverrideCursor(const AValue: TObject);
|
procedure TQtWidgetSet.SetOverrideCursor(const AValue: TObject);
|
||||||
|
@ -9,15 +9,9 @@ begin
|
|||||||
Result := APlatform = 'xcb';
|
Result := APlatform = 'xcb';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
|
||||||
GlobDisplay: PDisplay = nil;
|
|
||||||
|
|
||||||
function X11Display: PDisplay;
|
function X11Display: PDisplay;
|
||||||
begin
|
begin
|
||||||
{$warning move X11Display to TQtWidgetSet to avoid global GlobDisplay variable}
|
Result := QtWidgetSet.x11Display
|
||||||
if GlobDisplay = nil then
|
|
||||||
GlobDisplay := XOpenDisplay(nil);
|
|
||||||
Result := GlobDisplay;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsCompositingManagerRunning: boolean;
|
function IsCompositingManagerRunning: boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user