Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. no popups when Virtual Keyboard is included on RPI4

no popups when Virtual Keyboard is included on RPI4

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 515 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    ulmstefan
    wrote on last edited by
    #1

    Hi,
    I'm developing a Qt Wayland Compositor to launch applications on Raspberry Pi 4 with its official display, and I also need support for Virtual Keyboard (compositor-side). The back-end is eglfs.

    I'm starting with the server-side-decoration example, which is close to my needs, mixing it with pure-qml to add Virtual Keyboard support.

    The virtual keyboard works as expected (QT_IM_MODULE=qtvirtualkeyboard is set for the compositor), but the popups (e.g. the entries of a dropdown menu) stop working. Or better: just a small 1x1 box is show at the top-left corner of the application. If I disable the loading of the virtual keyboard, they work fine again.

    In the logs I get:

    virtual void QWaylandXdgPopupPrivate::xdg_popup_grab(QtWaylandServer::xdg_popup::Resource*, wl_resource*, uint32_t) Not implemented
    virtual void QWaylandXdgPopupPrivate::xdg_popup_destroy(QtWaylandServer::xdg_popup::Resource*) Not implemented
    

    In the code I've included the virtual keyboard in the CMakeLists.txt file (find_package, target_link_libraries and resources) and then I have added this keyboard.qml file:

    import QtQuick
    import QtQuick.VirtualKeyboard
    
    InputPanel {
        visible: active
        y: active ? parent.height - height : parent.height
        anchors.left: parent.left
        anchors.right: parent.right
    }
    

    The main.qml is quite simple; the path to the keyboard loader is WaylandCompositor -> WaylandOutput.window=Window -> WaylandMouseTracker -> Loader.

    The complete code:

    import QtQuick
    import QtQuick.Window
    import QtQuick.Layouts
    import QtWayland.Compositor
    import QtWayland.Compositor.XdgShell
    
    WaylandCompositor {
        id: compositor
        WaylandOutput {
            id: output
            property bool isNestedCompositor: Qt.platform.pluginName.startsWith("wayland") || Qt.platform.pluginName === "xcb"
            sizeFollowsWindow: output.isNestedCompositor
            window: Window {
                id: win
                width: 800
                height: 480
                visible: true
    
                WaylandMouseTracker {
                    id: mouseTracker
                    anchors.fill: parent
                    windowSystemCursorEnabled: output.isNestedCompositor
    
                    Rectangle {
                        id: background
                        anchors.fill: parent
                        gradient: "MorpheusDen"
                    }
    
                    Repeater {
                        model: shellSurfaces
                        // ![decoration]
                        Column {
                            id: chrome
                            width: shellSurfaceItem.implicitWidth
                            Rectangle {
                                visible: modelData.toplevel.decorationMode === XdgToplevel.ServerSideDecoration
                                width: parent.width
                                height: 30
                                gradient: "HeavyRain";
                                Text {
                                    text: modelData.toplevel.title
                                    anchors.centerIn: parent
                                }
                                Item {
                                    anchors.right: parent.right
                                    width: 30
                                    height: 30
                                    Text { text: "X"; anchors.centerIn: parent }
                                    TapHandler {
                                        onTapped: modelData.toplevel.sendClose()
                                    }
                                }
                                DragHandler {
                                    target: chrome
                                }
                            }
                            ShellSurfaceItem {
                                id: shellSurfaceItem
                                moveItem: parent
                                shellSurface: modelData
                                onSurfaceDestroyed: shellSurfaces.remove(index)
                            }
                        }
                        // ![decoration]
                    }
    
                    // Virtual Keyboard
                    // ![keyboard]
                    Loader {
                        anchors.fill: parent
                        source: "keyboard.qml"
                    }
                    // ![keyboard]
                }
            }
        }
    
        // ![XdgShell]
        XdgShell {
            onToplevelCreated: (toplevel, xdgSurface) => shellSurfaces.append({shellSurface: xdgSurface});
        }
        XdgDecorationManagerV1 {
            preferredMode: XdgToplevel.ServerSideDecoration
        }
        // ![XdgShell]
        ListModel { id: shellSurfaces }
    
        TextInputManager {}
        QtTextInputMethodManager {}
    }
    

    When I click a dropdown menu, the result is this (notice the pixels at the top-left corner of the application window); the virtual keyboard was correctly closed:

    popup-with-keyboard.jpg

    Any idea about what I'm doing wrong?

    Thanks in advance!

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Ralf_G
      wrote on last edited by
      #2

      Hello,
      I ran into the same log error messages, when handling a ComboBox in a Qt program running on a custom Compositor. @ulmstefan any outcome to this?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved