Ungrab mouse on menu close
AbandonedPublic

Authored by anthonyfieroni on Feb 21 2017, 7:05 PM.

Details

Reviewers
mart
broulik
davidedmundson
Group Reviewers
Plasma
Summary

Qt 5.8 has a bit changed and ungrabbing at show does not work.

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Lint Skipped
Unit
Unit Tests Skipped
anthonyfieroni created this revision.Feb 21 2017, 7:05 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptFeb 21 2017, 7:05 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
mart edited edge metadata.Feb 22 2017, 4:40 PM

do you know exactly what/where changed?

In D4711#88621, @mart wrote:

do you know exactly what/where changed?

sorry if this is irrelevant...
I dont know if the above code works but in my code tree in latte dock I can not do anything to ungrabMouse in Qt 5.8 in case the user closes the menu by deactivating it with a click at the outside area (that is not the window area or the menu one)...

I have filed a bug at: https://bugreports.qt.io/browse/QTBUG-59044

I thought that this might be relevant to my qt bug report...

I'm not pretty sure, but
https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp.html#374
on click at other window we have enter && mouseGrabber

You can observe the faulty behavior even with Qt's "Menu's Example".

  1. Open any menu you want either with right click or from the menu
  2. Close it by clicking in any outside area you want, that is (not inside the menu example window and not in the menu)
  3. Observe that you can not even hover at the menus on top. For the window to work as expected someone must click first in the example window.

at (3) the menu example window should work as normal...

I just noticed...
you dont have to go too far...
any qt application using 5.8 has this problem...
even qtcreator...

showing a menu and then deactivating it from outside areas then the window needs a click from the user
in order for this window to react properly

mart added a comment.Feb 24 2017, 10:53 AM

this on released Qt 5.8? on 5.8 branch?
i can't reproduce with my 5.8 build here.
anyways, that beahvior change would be a Qt bug (one of the many the terrible 5.8 release had) and should be fixed upstream
the indicated if (!enter || !QWidget::mouseGrabber()) { code was added in 2012, so can't be the responsible of the change

In D4711#89334, @mart wrote:

this on released Qt 5.8? on 5.8 branch?
i can't reproduce with my 5.8 build here.
anyways, that beahvior change would be a Qt bug (one of the many the terrible 5.8 release had) and should be fixed upstream
the indicated if (!enter || !QWidget::mouseGrabber()) { code was added in 2012, so can't be the responsible of the change

I am using Qt 5.8 from http://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_Leap_42.2/
I think this is the released version...

in my system I am doing the folowing:

  1. open a qtcreator
  2. notice the hovering works at the menu bar
  3. activate any menu from the top menu bar
  4. deactivate this menu by clicking on the desktop
  5. going the mouse above the qt creator's menu bar then hovering is not working, the user must click into the qtcreator in order for hovering to work again

Yep, same faulty beharior present in all Qt apps, Qupzilla, QtCreator, etc.

anthonyfieroni abandoned this revision.May 14 2017, 2:51 AM