Bug 154447 - Clicking a dropdown tool button shouldn't place the context menu on top of the button (kf5)
Summary: Clicking a dropdown tool button shouldn't place the context menu on top of th...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Rafael Lima
URL:
Whiteboard: target:24.2.0 target:7.6.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: KDE, KF5
  Show dependency treegraph
 
Reported: 2023-03-29 13:50 UTC by Rafael Lima
Modified: 2023-07-26 11:45 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot in gtk3 (expected behavior) (15.88 KB, image/png)
2023-03-29 13:50 UTC, Rafael Lima
Details
Screenshot in kf5 (bad) (14.88 KB, image/png)
2023-03-29 13:51 UTC, Rafael Lima
Details
Screenshot in the standard toolbar (11.56 KB, image/png)
2023-03-30 17:44 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2023-03-29 13:50:10 UTC
Created attachment 186287 [details]
Screenshot in gtk3 (expected behavior)

Using the gtk3 backend, when you click a tool button that opens a context menu (f.i. in Calc "Conditional" command, the context menu is placed right beneath the tool button (which is the expected behavior). See first attached image for an example.

However, in kf5, doing the same thing will position the context menu over the tool button, which is very odd. See second screenshot for more details.

I believe kf5 should behave as gtk3 in this case.
Comment 1 Rafael Lima 2023-03-29 13:51:28 UTC
Created attachment 186288 [details]
Screenshot in kf5 (bad)

This screenshot was taken using the same "Conditional" command in Calc using kf5. Notice that the context menu is placed over the tool button, completely hiding it.
Comment 2 Michael Weghorn 2023-03-30 15:15:21 UTC
Note that this requires switching to the "Tabbed" user interface first ("View" -> "User interface", then select "Tabbed").

Reproducible with 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8e97ef854fb225dac37185c1911894b7d206fa8d
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

Note that

commit f51b220b953ec71fb742f799fbe645a93cf3d944
Author: Michael Weghorn
Date:   Fri Mar 24 08:06:56 2023 +0100

    tdf#149805 tdf#151677 tdf#152217 tdf#154043 tdf#153458 tdf#153800 Revert "VCL expect

is unrelated, behavior is unchanged before and after that commit.
Comment 3 Rafael Lima 2023-03-30 17:44:35 UTC
Created attachment 186331 [details]
Screenshot in the standard toolbar

(In reply to Michael Weghorn from comment #2)
> Note that this requires switching to the "Tabbed" user interface first
> ("View" -> "User interface", then select "Tabbed").

Actually, it also happens in the standard toolbar UI. It seems the issue occurs when the control shows a "context menu".

For instance, in this new screenshot I clicked the "Freeze Panes" dropdown and the context menu appears over the tool button.

> Note that
> tdf#149805 tdf#151677 tdf#152217 tdf#154043 tdf#153458 tdf#153800 Revert
> "VCL expect
> 
> is unrelated, behavior is unchanged before and after that commit.

Indeed, I tested the bug before and after this revert, and it is present either way.
Comment 4 Gabor Kelemen (allotropia) 2023-07-21 13:00:03 UTC
This seems to have started in 7.3.6 with

https://git.libreoffice.org/core/+/3f8c6e73bc23d3295ea97f204745cf1869272c66

author	Michael Weghorn <m.weghorn@posteo.de>	Fri Jun 24 10:27:04 2022 +0200
committer	Michael Stahl <michael.stahl@allotropia.de>	Fri Jul 08 11:33:26 2022 +0200

tdf#149680 qt: Open native popup menu at given position

Also happens with the Standard UI, with the New/Open/Save split buttons: their submenu starts under the top of the window instead of below the buttons.
Comment 5 Rafael Lima 2023-07-23 13:04:35 UTC
(In reply to Gabor Kelemen (allotropia) from comment #4)
> This seems to have started in 7.3.6 with
> tdf#149680 qt: Open native popup menu at given position

Thanks for the bibisect. Here's a patch that fixes this:
https://gerrit.libreoffice.org/c/core/+/154771
Comment 6 Commit Notification 2023-07-24 15:27:19 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7b060d1c2acf03378c87abb7215f9c0a957b549c

tdf#154447 Fix menu position in kf5

It will be available in 24.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2023-07-24 15:28:21 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/447b91964daf3ffed5bfd59382ba5724e9992fe8

tdf#154447 qt: Take menu bar into account for popup pos

It will be available in 24.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Michael Weghorn 2023-07-24 15:30:18 UTC
Works now in Gabor's, Rafael's and my tests, s. comments in the Gerrit changes:
https://gerrit.libreoffice.org/c/core/+/154839
https://gerrit.libreoffice.org/c/core/+/154771

-> setting to VERIFIED FIXED
Comment 9 Commit Notification 2023-07-26 06:03:56 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/6c24157ea91190f02716f41d18260e9e53772765

tdf#154447 Fix menu position in kf5

It will be available in 7.6.0.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2023-07-26 11:45:58 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/f30267599565c6f3cb405d3becd9ef955bf3a568

tdf#154447 qt: Take menu bar into account for popup pos

It will be available in 7.6.0.2.

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

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