feat(opengl): переход на LazOpenGLContextEx — GL-рендер в нативном Wayland

Пакет LazOpenGLContext заменён на LazOpenGLContextEx (форк в
../lazOpengl): Qt6-бэкенд работает поверх настоящего QOpenGLWidget
(своя C++-либа libqlclglwidget) вместо GLX-контекста на winId(),
поэтому --opengl теперь работает в нативной Wayland-сессии, а под
ws=qt6 открывается путь на Windows/macOS.

- uses OpenGLContext -> OpenGLContextEx (класс TOpenGLControl тот же)
- удалена заглушка QtPlatformAllowsOpenGLControls с советом про
  XWayland: больше не нужна
- рантайм-зависимость: libqlclglwidget.so рядом с бинарником
  (сборка: make -C ../lazOpengl/csrc install-app APPDIR=bin/x86_64-linux)

Проверено на живом эфире (QO-100): спектр/водопад через GL под
Wayland и xcb, прозрачность FBO-альфы починена в обёртке (forceOpaque).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 14:56:46 +03:00
co-authored by Claude Fable 5
parent 01d78d148f
commit 4733ddab58
7 changed files with 8 additions and 45 deletions
+3 -17
View File
@@ -25,7 +25,7 @@ uses
Classes, SysUtils, StrUtils, FreqDisplay, DeviceForm, VfoOverlay, SampleRateOverlay, BandPlanOverlay, Classes, SysUtils, StrUtils, FreqDisplay, DeviceForm, VfoOverlay, SampleRateOverlay, BandPlanOverlay,
FlatButton, FlatSlider, FlatDropDown, AppTheme, Forms, Controls, Graphics, Dialogs, FlatButton, FlatSlider, FlatDropDown, AppTheme, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, Buttons, Menus, Math, Types, StdCtrls, ExtCtrls, Buttons, Menus, Math, Types,
OpenGLContext, OpenGLContextEx,
LCLIntf, LCLType, GraphType, LCLIntf, LCLType, GraphType,
HPSDRProtocol, HPSDRNetwork, HPSDRProtocol, HPSDRNetwork,
WDSP, WDSPEngine, AudioOutput, AudioInput, WDSP, WDSPEngine, AudioOutput, AudioInput,
@@ -1005,23 +1005,9 @@ begin
FSplitterRatio := 0.40; FSplitterRatio := 0.40;
FSplitterDrag := False; FSplitterDrag := False;
// OpenGLContextEx (QOpenGLWidget-бэкенд) работает и в нативном Wayland,
// старая X11-заглушка больше не нужна
FUseOpenGLSpectrum := HasOpenGLSpectrumSwitch; FUseOpenGLSpectrum := HasOpenGLSpectrumSwitch;
if FUseOpenGLSpectrum and (not QtPlatformAllowsOpenGLControls) then
begin
MessageDlg('OpenGL rendering disabled',
'OpenGL rendering is not available in the current Qt Wayland mode.' + LineEnding +
LineEnding +
'The Lazarus/LCL Qt6 OpenGL control used by EWSDR requires an X11 display handle, ' +
'but the native Wayland backend does not provide one. Using it here can cause an access violation during startup.' +
LineEnding +
LineEnding +
'To run EWSDR with OpenGL rendering, start it through XWayland:' + LineEnding +
'QT_QPA_PLATFORM=xcb ./ewsdr --opengl' + LineEnding +
LineEnding +
'OpenGL rendering will be disabled for this session.',
mtWarning, [mbOK], 0);
FUseOpenGLSpectrum := False;
end;
if FUseOpenGLSpectrum then if FUseOpenGLSpectrum then
FWaterfallFrameInterval := 1; FWaterfallFrameInterval := 1;
if FUseOpenGLSpectrum then if FUseOpenGLSpectrum then
-23
View File
@@ -10,7 +10,6 @@ unit PlatformUtils;
interface interface
function QtPlatformAllowsOpenGLControls: Boolean;
function HasOpenGLSpectrumSwitch: Boolean; function HasOpenGLSpectrumSwitch: Boolean;
function CurrentScreenDPI: Integer; function CurrentScreenDPI: Integer;
// Возвращает каталог для хранения конфигурации (с завершающим разделителем). // Возвращает каталог для хранения конфигурации (с завершающим разделителем).
@@ -24,28 +23,6 @@ implementation
uses uses
SysUtils {$IFNDEF HEADLESS}, Forms{$ENDIF}; SysUtils {$IFNDEF HEADLESS}, Forms{$ENDIF};
function QtPlatformAllowsOpenGLControls: Boolean;
var
Qpa, FirstQpa, SessionType: string;
Sep: Integer;
begin
Result := True;
Qpa := LowerCase(Trim(GetEnvironmentVariable('QT_QPA_PLATFORM')));
SessionType := LowerCase(Trim(GetEnvironmentVariable('XDG_SESSION_TYPE')));
if Qpa <> '' then
begin
FirstQpa := Qpa;
Sep := Pos(';', FirstQpa);
if Sep > 0 then
FirstQpa := Copy(FirstQpa, 1, Sep - 1);
Result := FirstQpa <> 'wayland';
Exit;
end;
Result := SessionType <> 'wayland';
end;
function HasOpenGLSpectrumSwitch: Boolean; function HasOpenGLSpectrumSwitch: Boolean;
var var
I: Integer; I: Integer;
+1 -1
View File
@@ -16,7 +16,7 @@ interface
uses uses
Classes, SysUtils, Graphics, Controls, Math, Types, Classes, SysUtils, Graphics, Controls, Math, Types,
OpenGLContext, GL, OpenGLContextEx, GL,
AppTheme, SpectrumView, VfoOverlay, BandPlanOverlay, WaterfallViewOpengl; AppTheme, SpectrumView, VfoOverlay, BandPlanOverlay, WaterfallViewOpengl;
type type
+1 -1
View File
@@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, Graphics, Controls, Math, Classes, SysUtils, Graphics, Controls, Math,
OpenGLContext, GL, OpenGLContextEx, GL,
AppTheme, WaterfallView; AppTheme, WaterfallView;
type type
+1 -1
View File
@@ -18,7 +18,7 @@ interface
uses uses
Classes, SysUtils, Math, Graphics, Controls, ExtCtrls, Classes, SysUtils, Math, Graphics, Controls, ExtCtrls,
OpenGLContext, GL, AppTheme, WDSP; OpenGLContextEx, GL, AppTheme, WDSP;
type type
TWidebandView = class TWidebandView = class
+1 -1
View File
@@ -130,7 +130,7 @@
</RunParams> </RunParams>
<RequiredPackages> <RequiredPackages>
<Item> <Item>
<PackageName Value="LazOpenGLContext"/> <PackageName Value="LazOpenGLContextEx"/>
</Item> </Item>
<Item> <Item>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
+1 -1
View File
@@ -15,7 +15,7 @@ uses
{$ENDIF} {$ENDIF}
Interfaces, // LCL platform Interfaces, // LCL platform
WindowsDPI, WindowsDPI,
Forms, LazOpenGLContext, Forms, LazOpenGLContextEx,
MainForm, AudioOutput, DeviceForm, FlatButton, FreqDisplay, VfoOverlay, MainForm, AudioOutput, DeviceForm, FlatButton, FreqDisplay, VfoOverlay,
WDSP, WDSPEngine, WebPageHtml, WebServer, WebUtils, WinFirewall, WsClient, WDSP, WDSPEngine, WebPageHtml, WebServer, WebUtils, WinFirewall, WsClient,
Settings, RadioController; Settings, RadioController;