MainView intercepts MouseArea's cursorShape property

Bug #1598920 reported by Dubstar_04
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
High
Zoltan Balogh
qtubuntu (Ubuntu)
Invalid
Undecided
Unassigned
ubuntu-ui-toolkit (Ubuntu)
Fix Committed
Undecided
Cris Dywan
unity8 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The MouseArea CursorShape doesnt have any effect.

Docs Here: http://doc.qt.io/qt-5/qml-qtquick-mousearea.html

Expected Behavour:
Mouse image shows selected Qt cursor

Experienced Behavour:
The regular arrow is displayed.

Example Code:

import QtQuick 2.4
import Ubuntu.Components 1.3

MainView {
    objectName: "mainView"
    applicationName: "mouseTest"

    width: units.gu(100)
    height: units.gu(75)

    Rectangle{
        anchors.fill: parent
        color: UbuntuColors.coolGrey

        MouseArea{
            anchors.fill: parent
            cursorShape: Qt.CrossCursor
            hoverEnabled: true
            onClicked: console.log("In MouseArea")
        }
    }
}

Related branches

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Adding unity8 & qtubuntu as I think this is more in there, not uitk

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Some ubuntu-ui-toolkit component muse be eating or overriding that MouseArea's cursor.

If you have a qml file just with that inner Rectangle + MouseArea it works fine:

"""
import QtQuick 2.4
import Ubuntu.Components 1.3

MainView {
    objectName: "mainView"
    applicationName: "mouseTest"

    width: units.gu(100)
    height: units.gu(75)

    Page {
        header: PageHeader {
            id: pageHeader
            title: i18n.tr("Cursor Test")
        }

        Rectangle{
            anchors.fill: parent
            color: UbuntuColors.coolGrey

            MouseArea{
                anchors.fill: parent
                cursorShape: Qt.CrossCursor
                hoverEnabled: true
                onClicked: console.log("In MouseArea")

            }
        }
    }
}
"""

Changed in unity8 (Ubuntu):
status: New → Invalid
Changed in qtubuntu (Ubuntu):
status: New → Invalid
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

To be clear:
A QQuickItem::cursor() must trickle all the way to down QWindow::cursor() so that shell can see it.

Either Page or MainView is interfering in that process.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Ok. Thanks Daniel. Tracked it down to the MainView. Updating title and example code.

summary: - QML MouseArea CursorShape: not respected
+ MainView intercepts MouseArea's CursorShape property
description: updated
summary: - MainView intercepts MouseArea's CursorShape property
+ MainView intercepts MouseArea's cursorShape property
Changed in canonical-devices-system-image:
assignee: nobody → Zoltan Balogh (bzoltan)
importance: Undecided → High
status: New → Confirmed
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: nobody → Zsombor Egri (zsombi)
Revision history for this message
Dubstar_04 (dubstar-04) wrote :

I have removed the MP until I can find a proper solution.

Revision history for this message
Dubstar_04 (dubstar-04) wrote :

In summary the issue appears to the the mouse area [1] blocking the mouse events making it to mainview.

I haven't arrived at a sensible solution that maintains the current functionality yet. Suggestions welcome.

[1] http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/view/head:/src/Ubuntu/PerformanceMetrics/PerformanceOverlay.qml#L111

Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: Zsombor Egri (zsombi) → Dubstar_04 (dubstar-04)
status: New → In Progress
Revision history for this message
Kugi Eusebio (kugi-igi) wrote :

I experienced this as well. When I try to do it within a page, listview, etc. the cursor doesn't change but if I do it within dialogs, it does work. Haven't tried with other Popovers but possibly the work on those as well.

Revision history for this message
Dubstar_04 (dubstar-04) wrote :

I will try and have another look at this in the next couple of weeks.

Revision history for this message
Dubstar_04 (dubstar-04) wrote :

I have unassigned myself as I just don't know when I am going to get time to have a proper look at the issue and its too important to delay a fix.

Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: Dubstar_04 (dubstar-04) → nobody
Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: nobody → Dubstar_04 (dubstar-04)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Doesn't appear to be a problem anymore - I see the cross shaped mouse pointer running the example snippet with qmlscene or ubuntu-ui-toolkit-launcher, with staging/ Xenial/ Qt 5.6.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Committed
assignee: Dubstar_04 (dubstar-04) → Christian Dywan (kalikiana)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.