Skip to content

Commit

Permalink
Fix build with Qt 5
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Sep 27, 2023
1 parent 90dc3f5 commit 25d3e65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions webview/platform/linux/webview_linux_compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ Compositor::Compositor()
const auto output = new Output(this, xdgSurface);

output->chrome().surfaceCompleted() | rpl::start_with_next([=] {
const auto parent = qvariant_cast<Output*>(
popup->parentXdgSurface()->property("output"))->window();
const auto parent = (*static_cast<Output * const *>(
popup->parentXdgSurface()->property("output").constData()
))->window();
if (_private->widget
&& parent == _private->widget->quickWindow()) {
output->window()->setTransientParent(
Expand Down
13 changes: 9 additions & 4 deletions webview/platform/linux/webview_linux_webkitgtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ constexpr auto kObjectPath = "/org/desktop_app/GtkIntegration/Webview";
constexpr auto kMasterObjectPath = "/org/desktop_app/GtkIntegration/Webview/Master";
constexpr auto kHelperObjectPath = "/org/desktop_app/GtkIntegration/Webview/Helper";

void (* const SetGraphicsApi)(QSGRendererInterface::GraphicsApi) =
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QQuickWindow::setGraphicsApi;
#else // Qt >= 6.0.0
QQuickWindow::setSceneGraphBackend;
#endif // Qt < 6.0.0

std::string SocketPath;

inline std::string SocketPathToDBusAddress(const std::string &socketPath) {
Expand Down Expand Up @@ -116,12 +123,10 @@ Instance::Instance(bool remoting)
Ui::GL::CheckCapabilities(nullptr));
switch (backend) {
case Ui::GL::Backend::Raster:
QQuickWindow::setGraphicsApi(
QSGRendererInterface::Software);
SetGraphicsApi(QSGRendererInterface::Software);
break;
case Ui::GL::Backend::OpenGL:
QQuickWindow::setGraphicsApi(
QSGRendererInterface::OpenGL);
SetGraphicsApi(QSGRendererInterface::OpenGL);
break;
}
return true;
Expand Down

0 comments on commit 25d3e65

Please sign in to comment.