Bug 161623 - macOS: Calc: Split Screen Issue: If a split screen is initialized from another application, window dimensions are incorrectly offset in the y-axis
Summary: macOS: Calc: Split Screen Issue: If a split screen is initialized from anothe...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.2.2 release
Hardware: ARM macOS (All)
: medium normal
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:25.8.0 target:25.2.0.0.beta2 t...
Keywords:
Depends on:
Blocks: Full-Screen-Mode
  Show dependency treegraph
 
Reported: 2024-06-17 19:33 UTC by Ibis Malko
Modified: 2025-01-04 12:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ibis Malko 2024-06-17 19:33:51 UTC
Description:
If a split screen is initialized from another application, window dimensions are incorrectly offset in the y-axis. In this edge case, Mac users cannot precisely use the mouse to select features/cells within the split-view window. This bug is causing users to vertically offset their mouse pointer to interact with the correct objects in the split-view frame.

Steps to Reproduce:
1. On macOS, open a Calc Spreadsheet.
2. Open another arbitrary application other than LibreOffice.
3. In the second application, Hover over the "Full-Screen" button, a green button in the upper left, and you will see options to "Enter Full Screen," "Tile Window to Left of Screen," or "Tile Window to Right of Screen."
4. Select "Tile Window to Left of Screen" or "Tile Window to Right of Screen." 
5. MacOS's Mission Contol will give you options for other open applications to fill the opposite side of the screen. Choose the window of Spreadsheet in Calc.  
6. Select any arbitrary cell or feature in the Spreadsheet in Calc with your mouse. 


Actual Results:
1. The Dimensions of the Window don't fill the entire y-axis of the screen.
2. Users cannot precisely select a particular cell in Calc. - I try to edit the C5 cell, but C3 is selected for editing. This offset continues across the entire application window e.g. User needs to press G16 to access G14. 

Expected Results:
The window for the Calc frame needs to fully scale in the y-axis while in split-view process initiated by another application. 


Reproducible: Always


User Profile Reset: Yes

Additional Info:
The edge case where a Mac User enters split-view from the Calc application works fine.
Comment 1 praveen jutur 2024-07-02 20:29:14 UTC
Thank you for reporting the bug. I can confirm that the bug is present in Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 4; OS: macOS 13.6.3; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 2 Patrick (volunteer) 2024-12-14 00:12:02 UTC
I can also reproduce this bug. My first guess is that LibreOffice is not detecting that the height of the window's titlebar has changed to zero. I see an empty band at the bottom of the window that looks about the same height as the (now hidden) titlebar. Essentially, the selected LibreOffice window gets forced into "full screen mode" (i.e. no titlebar and both menubar and Dock are hidden) but LibreOffice doesn't seem to handle that at all.

When I get some time, I'll see if I can force the content area within the window to resize when this happens:

Version: 25.8.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: 3bc1608758e37cba4eac8ca201e4464cd081fd07
CPU threads: 8; OS: macOS 15.1.1; UI render: Skia/Metal; VCL: osx
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded
Comment 3 Patrick (volunteer) 2024-12-14 00:50:05 UTC
So I applied the following patch (it adds support for native full screen mode but is unstable) and the bug no longer occurs:

https://gerrit.libreoffice.org/c/core/+/170452

So that confirms my suspicious that the LibreOffice window is forced into full screen mode.

I don't think that the above patch is anywhere near ready for inclusion in LibreOffice. But maybe I can limit the patch to only cases where macOS forces a window into full screen mode.
Comment 4 Patrick (volunteer) 2024-12-16 17:16:59 UTC
I have submitted the following "work in progress" patch:

https://gerrit.libreoffice.org/c/core/+/178497

I gave up on the patch linked in comment #3 and started from scratch.

There are still several TODOs that I need to implement but so far the only issues I am running into is some unexpected bahavior in the menubar when a window is in LibreOffice full screen mode while simultaneously in native full screen mode.

LibreOffice full screen mode is unrelated to native full screen mode so you should be able to enter or exit LibreOffice full screen mode while in native full screen mode. The only problem is that both LibreOffice and native full screen modes each modify independently which sometimes leaves the menubar in an unexpected state.
Comment 5 Commit Notification 2024-12-17 19:26:01 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/13bdc2ba0cec0cb1c9e8077eb2217f69822a805f

tdf#161623 Handle windows that macOS forces to native full screen mode

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.
Comment 6 Patrick (volunteer) 2024-12-17 19:31:27 UTC
I have committed a fix for this bug. The fix will be in tomorrow's (18 December 2024) nightly master builds:

https://dev-builds.libreoffice.org/daily/master/current.html

Note for macOS testers: the nightly master build installer does not overwrite any LibreOffice official versions. Instead, it will be installed as a separate application called "LibreOfficeDev" in the /Applications folder.

Because this is a "test" build, you will need to do the following steps before you launch the LibreOfficeDev application:

1. Go to the Finder and navigate to the /Applications/Utilities folder
2. Launch the "Terminal" application
3. Paste the following command in the Terminal application window and press the Return key to execute the command:

   xattr -d com.apple.quarantine /Applications/LibreOfficeDev.app
Comment 7 Patrick (volunteer) 2024-12-17 20:15:13 UTC
Some testing info: I tested the following scenarios. It may seem odd that I have lots of scenarios with "LibreOffice full screen mode" since this bug is a native full screen mode bug. But since others have encountered problems with LibreOffice full screen mode in past attempts to implement native full screen mode, I went ahead and included some additional fixes so that you should be able to enable or disable LibreOffice full screen mode in a native full screen window.

To test LibreOffice full screen mode, select the View > Full Screen menu item. That mode really just hides all of the toolbars in a document for a more "distraction free" experience:

Minor problems
--------------
- Regular to LibreOffice full screen: tdf#164337 occurs
- LibreOffice full screen to regular: tdf#164337 occurs

No problems
-----------
- Regular to native regular full screen
- Native regular full screen to regular
- Command-` from regular to LibreOffice full screen
- Command-` from LibreOffice full screen to full screen
- Command-` from regular to LibreOffice full screen (both with floating toolbars)
- Command-` from LibreOffice full screen to full screen (both with floating toolbars)
- LibreOffice full screen to native+LibreOffice full screen
- Native+LibreOffice full screen to LibreOffice full screen
- Native+LibreOffice full screen to native full screen
- Native full screen to native+LibreOffice full screen
Comment 8 Commit Notification 2024-12-18 23:59:07 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2120acaa261aaa1adaafc051582ac7f7dd4de372

tdf#161623 Fine tune menubar visibility when in LibreOffice full screen mode

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.
Comment 9 Commit Notification 2024-12-19 22:19:36 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/1d524110b1863d448254529bd8911e061dac2eb0

tdf#161623 Handle windows that macOS forces to native full screen mode

It will be available in 25.2.0.0.beta2.

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 Patrick (volunteer) 2024-12-20 12:57:08 UTC
Update: a nightly master build that includes my fix is finally available. To test my fix, use the steps in comment #6.
Comment 11 Commit Notification 2025-01-01 07:08:12 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#161623 Handle windows that macOS forces to native full screen mode

It will be available in 24.8.5.

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.