Bug 153885 - UI : LibreOffice VCL GTK Backend on Linux has popovers cutoff
Summary: UI : LibreOffice VCL GTK Backend on Linux has popovers cutoff
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.6.0 target:7.5.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: GTK3 Sidebar-Properties
  Show dependency treegraph
 
Reported: 2023-02-28 13:23 UTC by rushing27alien
Modified: 2024-01-08 20:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Menu that extends down to the edge of the screen (156.51 KB, image/png)
2023-02-28 13:27 UTC, rushing27alien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rushing27alien 2023-02-28 13:23:38 UTC
Description:
Hello, on LibreOffice's sidebar, there are a bunch of components that spawn a submenu, these submenus always go down from the menu button, even if the button is at the very bottom of the screen.

Steps to Reproduce:
1.Create a table in writer
2.Go to table
3.Open sidbar
4.Go to bottom most button that spawns a menu
5. see as you cannnot see menu as it goes down beyond the edge of the screen

Actual Results:
Menu cannot be seen nor interracted with due to unclickable items

Expected Results:
For bottom-most button's menu to go up


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: id-ID (id_ID.UTF-8); UI: id-ID
Flatpak
Calc: threaded
Comment 1 rushing27alien 2023-02-28 13:27:22 UTC
Created attachment 185643 [details]
Menu that extends down to the edge of the screen
Comment 2 Stéphane Guillou (stragu) 2023-03-01 22:19:24 UTC
Thank you for the report.
I can see this happening in 7.3 already:

Version: 7.3.7.2 / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

But not in 7.2:

Version: 7.2.7.2 / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

I think we can call that a regression.

This can also be seen in e.g. Draw when all sections of the Properties sidebar deck are expanded with a shape object selected.

kf5 and gen VCLs open the dropdowns above the button as expected if there isn't enough space below.
Comment 3 Stéphane Guillou (stragu) 2023-03-01 22:27:59 UTC
Bibisected with linux-64-7.3 repo to first bad commit faadc0a884c7440df415751320afe5d918a025a3 which points to core commit:

commit fae7fd3d193393e4e75ed426b9198925490dc3e4
author	Caolán McNamara <caolanm@redhat.com>	Fri Nov 19 09:32:55 2021 +0000
committer	Caolán McNamara <caolanm@redhat.com>	Fri Nov 19 14:57:46 2021 +0100
tree 333516c5e93d2e59ba261b7066a0272f8bcd7231
parent 2337bd5f0d9977a0ecd110abdebea7f331d360df
gtk3: default to an explicit constrain-to for Popovers
with the intent to do the same replacement with GtkWindow under X11 for
gtk3 that we do in MenuButtons for the popover with direct popovers when
the constraint is GTK_POPOVER_CONSTRAINT_NONE
Change-Id: I629c30b44a9e362ba0d924bb229930b5f0dc7ed3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125540

Caolán, can you please have a look? This makes some functions in the sidebar unavailable, the workaround being using the toolbar or resizing the window.
Comment 4 Caolán McNamara 2023-03-01 23:17:34 UTC
is it wayland, is it x11?
Comment 5 rushing27alien 2023-03-02 00:40:34 UTC
It's Wayland.
Comment 6 Caolán McNamara 2023-03-02 09:39:21 UTC
This is one of those blasted wayland+gtk things where its very hard to win. Set no constraints so a popover can leave the window, then the bounds of the monitor are not taken into account like in this case. Set constraints so it cannot leave the window, then in smaller dialogs the popover will be distorted bizarrely to fit into the dialog
Comment 7 Caolán McNamara 2023-03-02 09:56:53 UTC
format watermark as an example where constraining to be inside the dialog would be sub-optimal.

Best I can think of is to detect the toplevel window at popover launch time and constrain inside the parent window for the case that the parent is the application window.
Comment 8 Commit Notification 2023-03-02 11:34:14 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/11a5ddbb17ddb06c12464f9e961aa9eb42cbf9f9

Resolves: tdf#153885 keep popovers with application window parent inside that

It will be available in 7.6.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 9 Caolán McNamara 2023-03-02 11:35:12 UTC
seems a reasonable compromise to me, done in trunk, backport to 7-5 in gerrit
Comment 10 Commit Notification 2023-03-09 12:42:01 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/76d95da3d253dca847f78037275c1a29b5516885

Resolves: tdf#153885 keep popovers with application window parent inside that

It will be available in 7.5.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 11 Stéphane Guillou (stragu) 2023-03-10 14:03:49 UTC
Fix verified in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 082d009b6a156faa74c9966b0dffc5fa6ce22287
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Tested the sidebar and a few toolbars, with a variety of window sizes. It behaves nicely now. Thank you!