Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.6
- import QtQuick.Window 2.2
- import QtQuick.Scene3D 2.12
- import QtWayland.Compositor 1.3
- WaylandCompositor {
- // The output defines the screen.
- WaylandOutput {
- sizeFollowsWindow: true
- scaleFactor: 1
- window: Window {
- width: 1600
- height: 900
- visible: true
- Scene3D {
- anchors.fill: parent
- entity: sceneRoot
- cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
- }
- MainScene {
- id: sceneRoot
- }
- }
- }
- WlShell {
- onWlShellSurfaceCreated:
- shellSurfaceCreated(shellSurface, "wl");
- }
- XdgShellV6 {
- onToplevelCreated:
- shellSurfaceCreated(xdgSurface, "xdgv6");
- }
- XdgShell {
- onToplevelCreated:
- shellSurfaceCreated(xdgSurface, "xdg");
- }
- function shellSurfaceCreated (shellSurf, shellSurfType) {
- console.log("Creating surface...");
- var panelComponent = Qt.createComponent("Panel.qml");
- var panelInstance = panelComponent.createObject(sceneRoot, {
- "shellSurf": shellSurf,
- "shellSurfType": shellSurfType
- });
- console.log(shellSurfType + " surface Created");
- }
- function resizeShellSurface(shellSurf, shellSurfType, size) {
- switch(shellSurfType) {
- case "wl":
- shellSurf.sendConfigure(size, 0);
- break;
- case "xdg":
- case "xdgv6":
- shellSurf.sendFullscreen(size);
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement