Bug 104944 - gtk3: Some mouse events go to the wrong window after focus grab
Summary: gtk3: Some mouse events go to the wrong window after focus grab
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0 target:5.3.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-27 17:47 UTC by Maxim Monastirsky
Modified: 2017-01-09 16:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Monastirsky 2016-12-27 17:47:19 UTC
Steps to reproduce:

1. Customize the second docked toolbar from the top (e.g. Formatting toolbar in Writer), and add the "Insert Table" dropdown button as the *first* item there.

2. Click on the button. The popup will show but close immediately.

The problem isn't specific to the "Insert Table" popup, it's just an easy reproducer. What seems to happen is that after the popup gets the focus, it receives mouse move and mouse up events, that were supposed to go to the parent, with the coordinates of the parent - so it treats it as if clicking inside the popup in the same coordinates.

What seems to eliminate this behavior is either:

1. Reorder the callbacks in GtkSalFrame::signalButton. So SalEvent::MouseButtonUp goes first, and SalEvent::Move afterwards.

2. Comment all mouse grabs in GtkSalFrame::Show.

But I doubt any of those is the right fix...
Comment 1 Maxim Monastirsky 2016-12-27 23:11:18 UTC
Hopefully that's the right solution:

https://gerrit.libreoffice.org/32465/
Comment 2 Commit Notification 2017-01-04 22:11:23 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=23a13694a5a70098b5ecd58b99d99618111f3ea5

tdf#104944 gtk3: Ignore mouse up event if the wrong frame

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Caolán McNamara 2017-01-09 16:37:03 UTC
seems a reasonable fix to me
Comment 4 Commit Notification 2017-01-09 16:41:50 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f1b786bdd2576f584c62bfa797d3849eb5330c2c&h=libreoffice-5-3

tdf#104944 gtk3: Ignore mouse up event if the wrong frame

It will be available in 5.3.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.