Bug 164337 - Full screen floating toolbar moves offscreen after a few cycles in full screen mode
Summary: Full screen floating toolbar moves offscreen after a few cycles in full scree...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: ARM macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-15 21:20 UTC by Patrick (volunteer)
Modified: 2025-01-18 07:33 UTC (History)
1 user (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 Patrick (volunteer) 2024-12-15 21:20:11 UTC
Description:
Open a new Writer or Calc document and select the View > Full Screen menu. The document will go into LibreOffice's full screen mode where, on macOS, the menubar and Dock are both hidden. To escape out of full screen mode, there should be a floating "Full Screen" toolbar should appear over the top left corner of the document window.

Steps to Reproduce:
The bug is that after escaping out of full screen mode, the next time I reenter full screen mode the floating "Full Screen" toolbar is shifted leftward and rightward by the document window's X and Y non-full screen position. After a few cycles into and out of full screen mode, floating toolbar is position offscreen.

Actual Results:
Since the menubar is not hidden but also disabled, the only way to escape out of full screen mode is by entering the Escape key.

Expected Results:
The floating full screen toolbar should not be shifted.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Can anyone reproduce this on Windows or Linux?

My first is that this is a macOS-only bug but I want to confirm whether I should fix this in macOS or cross-platform code.
Comment 1 Patrick (volunteer) 2024-12-15 21:49:14 UTC
So here is what I have found so far: SystemWindow::UpdatePositionData() gets called for the floating toolbar immediately after escaping full screen mode. When this is called, the document window has already been moved and resized to its non-full screen size.

I can stop the bug from occurring by commenting out Window::ImplCallMove() using the debug patch below. It appears that Window::ImplCallMove() expects all child windows to automatically be pinned to their parent window so when the parent window moves, all of its children move too.

Not if this is a problem on Windows or Linux, but on macOS I found that in Window::ImplCallMove() although the parent window had already been moved and resized but the floating toolbar has not.

My next step depends on whether or not this bug occurs on Windows or Linux:


diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 196f2126cf5b..9ba90632f627 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -960,7 +960,7 @@ bool SystemWindow::UpdatePositionData()
     if (pWin)
     {
         // Simulate Move, so the relative position of the floating window will be recalculated
-        pWin->ImplCallMove();
+        // pWin->ImplCallMove();
         return true;
     }
Comment 2 Patrick (volunteer) 2024-12-30 16:24:36 UTC
(In reply to Patrick (volunteer) from comment #1)
> My next step depends on whether or not this bug occurs on Windows or Linux:

So can anyone confirm if this bug occur on Windows or Linux? Or is this a macOS-only bug?
Comment 3 Saburo 2025-01-18 07:33:28 UTC
On Windows, the toolbar would move to the top left corner, but it never went off the screen.
---
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c9ae567c791bcffdc3fff9e3fb11b46275a13d2b
CPU threads: 12; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded

On ubuntu(virtualbox) the toolbar disappeared from the second time, I think this is another bug.
---
Version: 24.8.4.2 (X86_64) / LibreOffice Community
Build ID: bb3cfa12c7b1bf994ecc5649a80400d06cd71002
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded

On kubuntu(virtualbox) the toolbar moved downwards but never disappeared off the screen.
---
Version: 24.8.4.2 (X86_64) / LibreOffice Community
Build ID: bb3cfa12c7b1bf994ecc5649a80400d06cd71002
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded

On xubuntu(Virtualbox) the toolbar moved downwards but never disappeared off the screen.
---
Version: 24.8.4.2 (X86_64) / LibreOffice Community
Build ID: bb3cfa12c7b1bf994ecc5649a80400d06cd71002
CPU threads: 2; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded

On OpenSUSE(VirtualBox) the toolbar hardly moved.
---
Version: 24.8.3.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 4; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded