Bug 164396 - Menu height is too large, making part of the menu off-screen
Summary: Menu height is too large, making part of the menu off-screen
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: Main-Menu
  Show dependency treegraph
 
Reported: 2024-12-20 15:23 UTC by Mike Kaganski
Modified: 2024-12-20 16:50 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A screencast of the problem (4.52 MB, image/gif)
2024-12-20 15:23 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-12-20 15:23:38 UTC
Created attachment 198188 [details]
A screencast of the problem

Opening a drop-down menu may put part of it outside of the screen vertically, using a screen height well fitting the minimal requirements; the problem happens, when the menu is opened with its origin somewhere in the middle of the screen (so that it should pop up downwards, or upwards, where there's more space).

In debug build, the following text is also often shown:

> warn:vcl:25768:36300:vcl/source/window/menu.cxx:3007: Available height misdetected as 709px. Setting to 768px instead.

The problem was introduced in commit 643a1492bd648fbd803ca86aca600cc2bdaf5819 (Add some fallback minimum size when screen size detection goes wrong, 2020-03-11). It talks about misdetection of height 0, but checks only if the available height is less than minimum screen size - which is obviously wrong, because the available height may be as small as half screen, when the origin is close to the screen vertical center.
Comment 1 Mike Kaganski 2024-12-20 16:04:13 UTC
https://gerrit.libreoffice.org/c/core/+/178940
Comment 2 Commit Notification 2024-12-20 16:50:40 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#164396: Fix the minimum size for menu

It will be available in 25.8.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.