From 0c94874344db51e7f510eeb7714b3d2da9b247a6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 May 2024 02:24:14 -0500 Subject: [PATCH] wip --- system/clearpilot/tools/qt_webview.cc | 35 ++++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/system/clearpilot/tools/qt_webview.cc b/system/clearpilot/tools/qt_webview.cc index 3f2dcdf..4437f4f 100644 --- a/system/clearpilot/tools/qt_webview.cc +++ b/system/clearpilot/tools/qt_webview.cc @@ -37,30 +37,31 @@ int main(int argc, char *argv[]) { // Common init QWidget window; - window.setWindowTitle("Webview"); + window.setWindowTitle("Generic Window"); window.setStyleSheet("background-color: black;"); + window.showFullScreen(); - // auto windowHandle = window.windowHandle(); - // if (!windowHandle) { - // fprintf(stderr, "Error: Unable to obtain window handle.\n"); - // return 1; - // } + auto windowHandle = window.windowHandle(); + if (!windowHandle) { + fprintf(stderr, "Error: Unable to obtain window handle.\n"); + return 1; + } - // QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); - // auto *s = static_cast(native->nativeResourceForWindow("surface", windowHandle)); - // if (!s) { - // fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n"); - // return 1; - // } + QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); + auto *s = static_cast(native->nativeResourceForWindow("surface", windowHandle)); + if (!s) { + fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n"); + return 1; + } - // wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); - // wl_surface_commit(s); + wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); + wl_surface_commit(s); - // window.setFixedSize(2160, 1080); + window.setFixedSize(2160, 1080); QVBoxLayout *layout = new QVBoxLayout(&window); - // layout->setSpacing(0); - // layout->setContentsMargins(0, 0, 0, 0); + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); // QString url = args.first(); QWebEngineView *web_view = new QWebEngineView();