When clicking the header, the notes are not collapsed

Bug #1288876 reported by Leo Arias
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Critical
Zsombor Egri
notes-app
In Progress
High
Leo Arias
ubuntu-ui-toolkit (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

This is using the qt5.2 PPA as explained here https://launchpad.net/~canonical-qt5-edgers/+archive/qt5-beta2

When I have a note focused and expanded, if I click the header the note is not collapsed and unfocused.

To reproduce:
Open the notes app
Open the toolbar
Click the add button
Type something on the note
Click the header

If I use the devel-proposed image, as of r223, this collapses the note.
If I add the qt5.2 PPA, the note is not collapsed.

Related branches

Revision history for this message
Leo Arias (elopio) wrote :

<zsombi> elopio: this seems to be an InverseMouseArea issue... this needs deeper investigation
<elopio> zsombi: ok, I'll file a bug. You are free to go :)
<zsombi> elopio: did this just pop up now, or was it noticed earlier? wondering whether it was brought in by some intermediate Qtfix
<elopio> zsombi: this has been around since we started running the jenkins job on 5.2, so, since last week
<elopio> before that, I don't know.
<zsombi> elopio: ok, anyway, seems some Qt5.2 related... however if UITK IMA (InverseMouseArea) tests pass, then we have again sthing with the notes app :/
<zsombi> elopio: or the header... or both

Revision history for this message
Leo Arias (elopio) wrote :

Subscribing zsombi to the bug as he might now who to assign this to.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

setting it as critical as seems the behavior change will block 5.2

Changed in ubuntu-ui-toolkit:
importance: Undecided → Critical
Changed in notes-app:
importance: Undecided → Critical
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

ok, so based on the IRC conversation on #ubuntu-ci-eng, it seems that we can accept that behavior change and just need to update the test.

no longer affects: ubuntu-ui-toolkit
Changed in notes-app:
assignee: nobody → Leo Arias (elopio)
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Ugo mind taking a quick look at this

Changed in notes-app:
assignee: Leo Arias (elopio) → Ugo Riboni (uriboni)
Leo Arias (elopio)
Changed in notes-app:
status: New → Confirmed
Bill Filler (bfiller)
Changed in ubuntu-ui-toolkit:
assignee: nobody → Zsombor Egri (zsombi)
Revision history for this message
Bill Filler (bfiller) wrote :

I looked into this more. The problem is here:
http://bazaar.launchpad.net/~phablet-team/notes-app/trunk/view/head:/Components/NoteItem.qml#L143

The notes-app uses an InverseMouseArea to capture all clicks that are outside of a note in order to collapse the note. In Qt 5.0, the onClicked handler of InverseMouseArea would get invoked when clicking in the header. With Qt5.2 it does not get invoked when clicking in the header, but does when you click anywhere else.

The topmostItem: true property seems to be correctly set and this should cause events to be captured as this component is the top of the stacking order. Somthing must have changed in Qt5.2 with the stacking order that prevents this from working.

NOTE: this bug only seems to appear on the device. On the desktop I successfully get onClicked events when clicking in the header using Qt5.2

Changed in ubuntu-ui-toolkit:
importance: Undecided → High
Changed in notes-app:
importance: Critical → High
Revision history for this message
Zsombor Egri (zsombi) wrote :

There has been some promise to the touch event handling correction in 5.2, so looks like we are facing the results of that correction. I'll try to build up a minimal test to reproduce this failure.

Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit:
importance: High → Critical
Zsombor Egri (zsombi)
Changed in ubuntu-ui-toolkit:
status: New → In Progress
Revision history for this message
Tim Peeters (tpeeters) wrote :
Download full text (6.4 KiB)

I am getting failures in my MR: https://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3965/artifact/results/autopilot/results/test_ubuntuuitoolkit.xml :

<testcase classname="ubuntuuitoolkit.tests.test_emulators.QQuickListViewTestCase" name="test_click_element_outside_view_above" time="13.127"><failure type="testtools.testresult.real._StringException">_StringException: Empty attachments:
  process-stdout

process-return-code: {{{-15}}}
process-stderr: {{{
Testability driver loaded. Wire protocol version is "1.4".
unity::action::ActionManager::ActionManager(QObject*):
 Could not determine application identifier. HUD will not work properly.
 Provide your application identifier in $APP_ID environment variable.

** (qmlscene:8065): WARNING **: Unable to register app: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Invalid application ID
}}}

test-log: {{{
12:17:31.904 INFO globals:57 - ************************************************************
12:17:31.904 INFO globals:58 - Starting test ubuntuuitoolkit.tests.test_emulators.QQuickListViewTestCase.test_click_element_outside_view_above
12:17:31.905 DEBUG globals:156 - Starting: ['/usr/bin/recordmydesktop', '--no-sound', '--no-frame', '-o', '/var/local/autopilot//artifacts/ubuntuuitoolkit.tests.test_emulators.QQuickListViewTestCase.test_click_element_outside_view_above.ogv']
12:17:31.910 ERROR content:49 - Could not add content object 'None' due to IO Error: [Errno 13] Permission denied: '/var/log/syslog'
12:17:31.971 INFO _launcher:159 - Launching process: ['/usr/lib/x86_64-linux-gnu/qt5/bin/qmlscene', '-testability', '-I/usr/lib/modules', '/tmp/tmpol31ebyl.qml', '--desktop_file_hint=/home/ubuntu/.local/share/applications/tmppcxvythx.desktop']
12:17:33.069 DEBUG dbus:432 - Selecting objects of type MainView with attributes: {}
12:17:33.078 DEBUG dbus:432 - Selecting objects of type MainView with attributes: {}
12:17:33.081 DEBUG dbus:432 - Selecting objects of type QQuickListView with attributes: {'objectName': 'testListView'}
12:17:33.108 DEBUG dbus:432 - Selecting objects of type MainView with attributes: {}
12:17:33.112 DEBUG dbus:432 - Selecting objects of type Label with attributes: {'objectName': 'clickedLabel'}
12:17:33.147 INFO logging:45 - QQuickListView: Click an element from the list. Arguments ('testListElement9',). Keyword arguments: {}.
12:17:33.147 DEBUG dbus:432 - Selecting objects of any type with attributes: {'objectName': 'testListElement9'}
12:17:33.180 DEBUG dbus:432 - Selecting objects of any type with attributes: {'objectName': 'testListElement9'}
12:17:33.228 INFO logging:45 - QQuickListView: _show_more_elements_below. Arguments (). Keyword arguments: {}.
12:17:33.237 DEBUG _X11:350 - Moving mouse to position 257,207 with animation.
12:17:33.522 DEBUG _X11:305 - Pressing mouse button 1
12:17:33.523 DEBUG _X11:350 - Moving mouse to position 257,74 with animation.
12:17:33.892 DEBUG _X11:312 - Releasing mouse button 1
12:17:34.953 DEBUG dbus:432 - Selecting objects of any type with attributes: {'objectName': 'testListElement9'}
12:17:35.021 INFO logging:45 - QQuickListView: _show_more_elements_below. Arguments (). Keyword arguments: {}.
12:17:35.028 DEBUG _X11:350...

Read more...

Revision history for this message
Tim Peeters (tpeeters) wrote :

The contents clipper in the MainView also clips events?

comment out this line in contentsClipper in MainView:
            clip: headerItem.bottomY > 0 && activePage && activePage.flickable

And clicking on the header works.

Revision history for this message
Tim Peeters (tpeeters) wrote :
Revision history for this message
Tim Peeters (tpeeters) wrote :

A component that clips its contents also clips the IMA events. See attached bug.qml

Revision history for this message
Tim Peeters (tpeeters) wrote :

I'm suspecting this may be a problem in qquickmousearea.cpp:

bool QQuickMouseAreaPrivate::propagateHelper(QQuickMouseEvent *ev, QQuickItem *item,const QPointF &sp, PropagateType sig)
{
    //Based off of QQuickWindow::deliverInitialMousePressEvent
    //But specific to MouseArea, so doesn't belong in window
    Q_Q(const QQuickMouseArea);
    QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);

    if (itemPrivate->flags & QQuickItem::ItemClipsChildrenToShape) {
        QPointF p = item->mapFromScene(sp);
        if (!item->contains(p))
            return false;
    }

but if I'm looking correctly on https://qt.gitorious.org/qt/qtdeclarative/blame/ae59cb90ce61f2989431b4fd6739fb49bca950ed:src/quick/items/qquickmousearea.cpp then that code hasn't been changed since April 2012.

Revision history for this message
Zsombor Egri (zsombi) wrote :

The problem i snot there - that piece of code hasn't been changed since 5.0.2. InverseMouseArea is not even executing that code when topmostItem is set. When that property is set, the component installs a filter and grabs all the topmost events and handles them. Clipping however seemes it brought changes in event handling, so the filter registration had to happen in a completely different way. Beside, there was a bug in the event consumption, so when topmost events were set, mouse events occurred in the inactive area (the whole) were eaten, and not propagated at all. These were all caused by the event handling changes/fixes in Qt5.2.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-ui-toolkit - 0.1.46+14.04.20140321.1-0ubuntu1

---------------
ubuntu-ui-toolkit (0.1.46+14.04.20140321.1-0ubuntu1) trusty; urgency=low

  [ Bartosz Kosiorek ]
  * Fix selection and coping text from TextFields (LP: 1130369) (LP:
    #1130369)
  * "Cut" operation do not shows for "ReadOnly's" TextField and TextArea
    (LP: 1293149) (LP: #1293149, #1267821)

  [ Zsombor Egri ]
  * InverseMouseArea not getting mouse events converted from touch when
    set as topmost item. (LP: #1288876)

  [ Michael Zanetti ]
  * drop BottomBarVisiblityCommunicator as it has gone from unity8 - no
    more HUD from the lower edge

  [ Christian Dywan ]
  * Introduce UbuntuTestCase API for C++ (LP: #1261396)
 -- Ubuntu daily release <email address hidden> Fri, 21 Mar 2014 11:29:53 +0000

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Released
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Hmm, weirdly the lp:~zsombi/ubuntu-ui-toolkit/ima-bug1288876 was not marked as being merged, even though it's clearly there:
http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk/revision/977

Marking manually as merged.

Changed in ubuntu-ui-toolkit:
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Leo Arias (elopio) wrote :

Great, so I'll remove the skip.

Changed in notes-app:
status: Confirmed → In Progress
assignee: Ugo Riboni (uriboni) → Leo Arias (elopio)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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