Bug 112830 - RTL: Toolbar tooltips flicker heavily as mouse thinks its in the opposite location (Gtk2)
Summary: RTL: Toolbar tooltips flicker heavily as mouse thinks its in the opposite loc...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.1.6.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.0.0 target:5.4.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: RTL-CTL GTK2 Toolbars-Tooltips
  Show dependency treegraph
 
Reported: 2017-10-02 14:11 UTC by Yousuf Philips (jay)
Modified: 2017-10-25 15:33 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
screencast (1.70 MB, video/webm)
2017-10-02 14:11 UTC, Yousuf Philips (jay)
Details
screencast for slightly broken state (1.67 MB, video/webm)
2017-10-15 18:38 UTC, Yousuf Philips (jay)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) 2017-10-02 14:11:49 UTC
Created attachment 136693 [details]
screencast

steps:
1. open writer in Arabic UI
2. move mouse over the bold button
3. tooltip will appear
4. move your mouse in a circular motion in around the button
5. notice that another button is in the focus state and the tooltip for that button gets shown

only happens on gtk2 backend.

Version: 6.0.0.0.alpha0+
Build ID: a2a3e06a29077d4274dc15eea28a01afe22e3658
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 1 Xisco Faulí 2017-10-02 22:19:20 UTC
Confirmed in

Version: 6.0.0.0.alpha0+
Build ID: fe301bbbfce1d11ab992c4ec2a3cb866629e5c04
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

Actually, there seems to be a delay when hoovering

Could you please check in previous versions ?
Comment 2 Yousuf Philips (jay) 2017-10-04 20:09:08 UTC
It doesnt happen in 4.4, so it must have been introduced in 5.1 or 5.2.
Comment 3 Yousuf Philips (jay) 2017-10-15 18:23:36 UTC
So the regression happened during the 5.1 cycle which completely broke it, but it has been slightly broken since 3.3.

Raal, Xisco, Aron: Can either of you guys bibisect this.

الإصدارة: 5.1.6.2
معرّف البناء: 07ac168c60a517dba0f0d7bc7540f5afa45f0909
CPU Threads: 2; OS Version: Linux 4.4; UI Render: default; 
المحليّة: en-US (en_US.UTF-8); Calc: group
Comment 4 Yousuf Philips (jay) 2017-10-15 18:38:52 UTC
Created attachment 136998 [details]
screencast for slightly broken state

So from 3.3 to 5.0, the tooltips were slightly broken where if a tooltip appears and the mouse touches it and it has to appear further below it, it will initially think its on the opposite side of the screen and hit another button and show its tooltip for a split second before correcting itself.

In the screencast, you can see that i move my mouse over the export pdf button on the right and its tooltip appears and then the find next down arrow button on the left will get hit and its tooltip appears for a split second at ~00:24.
Comment 5 Maxim Monastirsky 2017-10-15 18:45:06 UTC
Some observations:

1) The toolbar gets lots of "mouse leaves the window" and "mouse enters the window" events while moving the pointer over it. It probably shouldn't happen, and indeed doesn't happen in a non-RTL UI.

2) The related code in the gtk3 backend got a RTL fix in Bug 106163. Applying the same fix to the gtk2 backend eliminates the "mouse thinks its in the opposite location" part of the bug, but the toolbar still heavily flickers (after all it still gets excessive enter/leave events, as above). (BTW it isn't clear why Bug 106163 was flagged as gtk3 related, as I can reproduce the same with gtk2, so the fix is needed there too.)

3) Disabling toolbar tooltips completely, doesn't show the bug anymore, with or without 2). There are no more excessive enter/leave events.

4) Disabling the mouse enter/leave handling completely in the gtk2 backend, doesn't show the bug as well, but shows that the tooltips are clearly misplaced.

So I think the trouble begins when the pointer reaches the tooltip (which normally shouldn't happen), and that what makes the main window get the "mouse leave the window" event.
Comment 6 Lior Kaplan 2017-10-15 19:25:07 UTC
(In reply to Maxim Monastirsky from comment #5)
> 2) The related code in the gtk3 backend got a RTL fix in Bug 106163.
> Applying the same fix to the gtk2 backend eliminates the "mouse thinks its
> in the opposite location" part of the bug, but the toolbar still heavily
> flickers (after all it still gets excessive enter/leave events, as above).
> (BTW it isn't clear why Bug 106163 was flagged as gtk3 related, as I can
> reproduce the same with gtk2, so the fix is needed there too.)

Cloud you sent the patch to gerrit ?
Comment 7 Maxim Monastirsky 2017-10-15 21:10:48 UTC
wrt the tooltip misplacement problem, which causes the heavy flickering, this is the first bad commit (verified by reverting):

commit e527edf06f8befb45b76ee8ebabe62e6dc885e45
Author: rpmbuild <rpmbuild@fedoraproject.org>
Date:   Mon Aug 15 15:17:11 2016 +0100

    Resolves: tdf#91533 (rhbz#1364335) Tooltips are truncated
    
    Change-Id: Id9ec91ed9652f491e4e2a0556eeed27bf6517002

Adding Cc: to Caolán McNamara
Comment 8 Caolán McNamara 2017-10-18 11:46:18 UTC
I can't quite reproduce the original problem the ApplySettings was trying to address. But presumably https://gerrit.libreoffice.org/#/c/43498/ should still fix that and remove the placement problem
Comment 9 Commit Notification 2017-10-19 11:19:33 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=660b12e47d3aedb8fcf2ed2c50f8175d351a51aa

tdf#112830 measure test with ApplySettings applied

It will be available in 6.0.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 10 Caolán McNamara 2017-10-19 11:20:11 UTC
does that make a difference ?
Comment 11 Yousuf Philips (jay) 2017-10-19 11:47:15 UTC
(In reply to Caolán McNamara from comment #10)
> does that make a difference ?

the heavily flickering is gone, but the slightly broken state in comment 4 is still there.
Comment 12 Caolán McNamara 2017-10-19 13:04:47 UTC
the initial positioning of the tooltip a little higher than would seem sensible might be due to the gtk2 version of the initial decoration height value removed from gtk3 with 19a7c81d3ce2a8a7b9a6ed305e474a80fd286ddf possibly worth someone trying that to see it makes a difference
Comment 13 Maxim Monastirsky 2017-10-19 13:19:02 UTC
(In reply to Yousuf Philips (jay) from comment #11)
> the heavily flickering is gone, but the slightly broken state in comment 4
> is still there.
As I said already in comment 5, applying the same fix as in Bug 106163 (in GtkSalFrame::signalCrossing) is what seems to fix that part for me.
Comment 14 Maxim Monastirsky 2017-10-19 16:58:18 UTC
(In reply to Lior Kaplan from comment #6)
> Cloud you sent the patch to gerrit ?

Done: https://gerrit.libreoffice.org/43570
Comment 15 Commit Notification 2017-10-19 19:31:06 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2c41e9924120ec2e399de9b4d8248f25712ae400

tdf#106163 tdf#112830 Mirror mouse enter/leave for gtk2

It will be available in 6.0.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 16 Yousuf Philips (jay) 2017-10-21 14:15:20 UTC
Confirmed fixed. Backported the 2 patches to 5.4.

إصدارة: 6.0.0.0.alpha1+
معرّف البناء: 8ba60ca42d4d1873b8cd85c5d3b5ed2f0e19df60
خيوط المعالج: 2; نظام التَّشغيل: Linux 4.4; مصيّر الواجهة: المبدئيّ; VCL: gtk2; 
المحليّة: en-US (en_US.UTF-8); Calc: group
Comment 17 Commit Notification 2017-10-25 15:33:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9a6966c913e5301101456a3df8b8cd96a8e5588c&h=libreoffice-5-4

tdf#112830 measure test with ApplySettings applied

It will be available in 5.4.4.

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.