-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editing the Kanban board doesn't work on wayland #617
Comments
Why? |
No idea. Doubleclicking the text selects it but typing doesn't edit it. The checkboxes work fine. |
Any error? Just editing the text doesn't work or anything else? Everything shows up normally tho (could you share a screenshot)? |
No errors in the terminal. Here's a video: 2023-07-29.11-14-13.mp4 |
That's odd! Do you think you can run a simeple QML test with just TextArea {} and TextField {} Qt Quick componenets to see if it's an upstream issue with Qt and Wayland? |
Revisiting this, and it's still reproducible with Qt 6.6.1 on Wayland (KDE Plasma 5.27).
Is this a good example? // test.qml
import QtQuick 2.12
import QtQuick.Controls 2.12
Rectangle {
width: 300
height: 100
Text {
id: taskTextNonEditable
width: 300
text: "Double click here to edit me!"
font.pointSize: 15
textFormat: TextEdit.MarkdownText
wrapMode: Text.Wrap
MouseArea {
anchors.fill: parent
onDoubleClicked: {
taskTextNonEditable.visible = false;
taskTextEdit.visible = true;
taskTextEdit.cursorPosition = taskTextEdit.length;
taskTextEdit.forceActiveFocus();
taskTextEdit.focus = true;
}
}
}
TextArea {
id: taskTextEdit
width: 300
text: taskTextNonEditable.text
font.pointSize: 15
textFormat: TextEdit.PlainText
wrapMode: Text.Wrap
visible: false
background: Rectangle {
radius: 5
color: "#efefef"
}
}
} If I run that with qml-test-wayland.mp4 |
Yes, that should do. Can you try importing this as well?
|
Same result: Editing the text works. |
What about: |
That one made things a bit more weird while editing the text, but it still works (in the video below I first edit without the import, and then after that I edit with the import): qml-test-wayland-2.mp4 |
Hmm. still works. Very odd! This is the code of CustomTextArea (https://github.com/nuttyartist/notes/blob/master/src/qml/CustomTextArea.qml) in one file for convenience. Can you try it: EDIT: Changed import versions. import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Universal 2.12
Window {
id: rootWindow
visible: true
width: 640
height: 480
title: qsTr("Test")
TextArea {
id: root
textFormat: TextEdit.PlainText
wrapMode: Text.Wrap
background: Rectangle {
radius: 5
color: root.themeData.theme === "Dark" ? "#313131" : "#efefef"
}
width: parent.width
height: parent.height
property var themeData
property string accentColor
property bool cursorAnimationRunning: true
signal anyKeyPressed
signal cursorHidden
signal cursorShowed
signal returnPressed
property bool isHoldingShift: false
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Shift) {
isHoldingShift = true;
}
root.anyKeyPressed();
root.cursorAnimationRunning = false;
}
Keys.onReleased: (event) => {
if (event.key === Qt.Key_Shift) {
isHoldingShift = false;
}
root.cursorAnimationRunning = true;
}
onPressed: {
root.cursorShowed();
}
Keys.onReturnPressed: {
returnPressed();
}
cursorDelegate: Rectangle {
id: cursorDelegateObject
visible: true
color: root.accentColor
width: 2
Connections {
target: root
function onAnyKeyPressed () {
cursorDelegateObject.visible = true;
}
function onCursorHidden () {
cursorDelegateObject.visible = false;
}
function onCursorShowed () {
cursorDelegateObject.visible = true;
}
}
SequentialAnimation {
loops: Animation.Infinite
running: root.cursorAnimationRunning
PropertyAction {
target: cursorDelegateObject
property: 'visible'
value: true
}
PauseAnimation {
duration: 500
}
PropertyAction {
target: cursorDelegateObject
property: 'visible'
value: false
}
PauseAnimation {
duration: 500
}
}
}
}
} |
Typing still works: qml-test-wayland-3.mp4 |
Then, it's not immediately clear why on Wayland editing doesn't work in the Kanban. Needs deeper inspection. |
Revisiting as of Qt 6.7.1, and the issue is still present only on Wayland, unfortunately. |
That's very annoying. What distro has built-in Wayland that I can spin up to test this? EDIT: Or can i just use my current PopOS machine? (Don't know much about Wayland) |
The latest version of Fedora is a probably a good choice, I think. @nuttyartist Though you can probably use Wayland with Pop!_OS too: Logout from the current session and choose "GNOME" (and not "GNOME (Legacy)" or "GNOME (X11)" or whatever they call it) from the login manager screen. |
I believe this has something to do with the use of QWindowContainer (i.e. spawning a QML app inside a QWidget application). I just noticed that Daino Notes doesn't work in Wayland (unless used with the flag @zjeffer mentioned). But I checked a minimal example with a QML inside QWidget via QWindowContainer and a regular QML app and the regular worked without issues. I'll try to file a bug report. |
If you do, please share the link to the bug report with us too. :) |
But it does work with XWayland (running notes with
--platform xcb
)The text was updated successfully, but these errors were encountered: