This commit is contained in:
Your Name
2024-05-10 02:24:14 -05:00
parent ff6c539478
commit 0c94874344

View File

@@ -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<wl_surface*>(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<wl_surface*>(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();