Bug 117828 - Positioning window to the left of the screen using setPosSize() leaves 7 px space.
Summary: Positioning window to the left of the screen using setPosSize() leaves 7 px s...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-26 20:25 UTC by Balint Fodor
Modified: 2023-02-25 06:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sets window position and size on startup (3.99 KB, application/vnd.sun.xml.base)
2018-05-26 20:27 UTC, Balint Fodor
Details
Shadow left and right of the window (26.11 KB, image/png)
2021-08-10 17:56 UTC, Andreas Heinisch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Balint Fodor 2018-05-26 20:25:58 UTC
Description:
I am using LibreOffice Version 6.0.4.2 Base on Windows 10.
Using the command ThisComponent.CurrentController.Frame.ContainerWindow.setPosSize(0,0,500,500,15)
will leave 7 px space from the left side of the screen.
There is no problem with setting the y coordinate. X coordinates - if less than 8 - will be interpreted as 8.
I posted the issue on LibreOffice forum, and someone reported, they didn't experience the issue on Mint 18.3. So it may be a Windows-specific issue.

Steps to Reproduce:
1. Run this macro on the form's When loading or the document's Open Document event:
ThisComponent.CurrentController.Frame.ContainerWindow.setPosSize(0,0,500,500,15)


Actual Results:  
Window is not positioned to the left of the screen, there is 7 px space.

Expected Results:
Position the window to the left top corner of the screen.


Reproducible: Always


User Profile Reset: Yes



Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134
Comment 1 Balint Fodor 2018-05-26 20:27:26 UTC
Created attachment 142300 [details]
Sets window position and size on startup
Comment 2 Buovjaga 2018-06-20 15:49:32 UTC
Repro.

Tested by assigning in Macro organizer, Assign, Event to Open document.

Already in 3.3.0 (Win 10)

Version: 6.2.0.0.alpha0+ (x64)
Build ID: 2c85607101e2e04e870e3b87362f39f9a9148e6c
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-06-16_00:12:37
Locale: fi-FI (fi_FI); Calc: group threaded
Comment 3 Balint Fodor 2019-06-11 16:08:10 UTC
The bug is still present in Version: 6.2.3.2 (x64)
Comment 4 QA Administrators 2021-06-11 03:48:51 UTC Comment hidden (obsolete)
Comment 5 Andreas Heinisch 2021-08-10 17:54:48 UTC
The width of the window is calculated including its shadow at the left and right hand side. Hence this positioning. Idk if we should fis this or not.

Code pointer:
https://opengrok.libreoffice.org/xref/core/vcl/win/window/salframe.cxx?r=ce9e6972#1320
https://opengrok.libreoffice.org/xref/core/vcl/win/window/salframe.cxx?r=ce9e6972#1413
Comment 6 Andreas Heinisch 2021-08-10 17:56:28 UTC
Created attachment 174191 [details]
Shadow left and right of the window
Comment 7 Andreas Heinisch 2023-02-25 06:35:45 UTC
IMO, not a bug since the width/height of the window is calculated using its decoration. Feel free to reopen it, if there are any concerns.