bardao
bardao

Reputation: 954

QML Window FramelessWindowHint on Linux still resizable

I have the below example:

import QtQuick 2.12
import QtQuick.Window 2.12

Window {
    visible: true
    width: 500
    height: 500
    title: qsTr("Hello World")

    flags: Qt.FramelessWindowHint | Qt.X11BypassWindowManagerHint

    TextEdit {
        id: name
        text: qsTr("text")
        readOnly: false
        width: 100
        height: 100
        anchors.centerIn: parent
    }

}

What I'm trying to achieve is a frameless window that cannot be resized as the documentation suggests, but in Linux the x11 manager takes over. One way to solve the resizing issue is to specify X11BypassWindowManagerHint as a second flag. The issue is when using the latter, one cannot type in the TextField anymore. How can I solve that on Linux?

Upvotes: 1

Views: 440

Answers (1)

talamaki
talamaki

Reputation: 5482

Call Window method requestActivate to receive keyboard focus.

Window {
    ...
    Component.onCompleted: requestActivate()
}

Upvotes: 2

Related Questions