Download it now!
Bug 66762 - Other: com.sun.star.awt.DisplayAccess removed without alternative
Summary: Other: com.sun.star.awt.DisplayAccess removed without alternative
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.0.1.2 release
Hardware: Other All
: high critical
Assignee: Not Assigned
URL:
Whiteboard: BSA target:4.2.0 target:4.1.1
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-07-10 10:07 UTC by Fernand
Modified: 2013-07-18 11:23 UTC (History)
6 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 Fernand 2013-07-10 10:07:03 UTC
as found out after ailing with Noel Gradin

the com.sun.star.awt.DisplayAccess was removed by Noel

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dde234b6955a421d51d2b37e4fc3972c660146f0

but since there is no alternative to find oud the screen size of the machine where LO is runnning

the proposed solution:

otoolkit = createUnoService("com.sun.star.awt.Toolkit")
aWorkRect = otoolkit.getWorkArea()

is not working because empty values in the WorkArea

so please make
oDisplayAccess= createUnoService("com.sun.star.awt.DisplayAccess")
    
    oDisplayInfo = oDisplayAccess.getByIndex(0)
    aScreenArea = oDisplayInfo.ScreenArea
    iScreenW =    aScreenArea.Width
    iScreenH =    aScreenArea.Height
working again
Operating System: All
Version: 4.0.1.2 release
Last worked in: 4.0.4.2 release
Comment 1 vilpan 2013-07-10 10:33:11 UTC
The version info looks strange: you're reporting the issue against 4.0.1.2 and saying it works in 4.0.4.2. It doesn't make much sense if the issue has already been fixed in a subsequent release.
Comment 2 Fernand 2013-07-10 15:50:47 UTC
sorry was removed for 4.1
Comment 3 Cor Nouws 2013-07-10 17:36:30 UTC
I can confirm the report
Thanks for the info, Fernard.
Comment 4 Petr Mladek 2013-07-11 14:37:15 UTC
Noel's, Stephan, Michael, do you have any idea how to get out of this trap, please?
Comment 5 Noel Grandin 2013-07-11 14:56:56 UTC
I removed this in
http://cgit.freedesktop.org/libreoffice/core/commit/?id=dde234b6955a421d51d2b37e4fc3972c660146f0
because I thought it was a purely internal API.

The piece of internal machinery it is exposing is this:
     sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
     Rectangle aWorkRect = Application::GetWorkAreaPosSizePixel( nDisplay );

I see three choices:

(a) restore the old API, by reverting that part of the commit
(b) Make the following OOBasic code work properly:
            XToolkit toolkit = createUnoService("com.sun.star.awt.Toolkit")
            Rectangle aWorkRect = toolkit->getWorkArea()
      This API currently exists, but unconditionally returns an empty 
rectangle.
(c) design a new API

The code for option (b) in VCLXToolkit::getWorkArea() currently has the 
comment:
      // 07/00: AppWindow doesn't exist anymore...
And it's so old, it belongs to the initial import, so I can't figure out 
any more about it.

I'm happy to do any of the above.
Comment 6 Stephan Bergmann 2013-07-11 15:33:04 UTC
(In reply to comment #5)

Using

> The piece of internal machinery it is exposing is this:
>      sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
>      Rectangle aWorkRect = Application::GetWorkAreaPosSizePixel( nDisplay );

to make

> (b) Make the following OOBasic code work properly:
>             XToolkit toolkit = createUnoService("com.sun.star.awt.Toolkit")
>             Rectangle aWorkRect = toolkit->getWorkArea()
>       This API currently exists, but unconditionally returns an empty 
> rectangle.

work sounds like a good approach to me.
Comment 7 Michael Meeks 2013-07-11 16:41:35 UTC
Looks like something we should restore IMHO. The "WorkArea" concept is however rather problematic. I believe the backends try to expose this as "the area of screen not covered by a panel at the bottom / top / side" etc. I would really prefer this to be (as the user suggests) exposing the screen size.

Otherwise I guess it should go back ?
Comment 8 Fernand 2013-07-12 06:35:09 UTC
Lionel
A: After googling you will see that there is not so match code around whou uses com.sun.star.awt.DisplayAccess.
+ it was undocumented stuff

B: nice if the Toolkit does what it promise, giving us the dimensions of a work area

C: Super when you can bring in also the stuff to detect the behaviour of multi screening.

Maybe you do B: now and C later ?

Thanks for the intersest
Comment 9 Petr Mladek 2013-07-17 08:23:17 UTC
Guys, please continue to sort this out. I will just slightly lower the severity. It does not look as a core functionality used by most users. We could solve this in the bugfix releases => it should not block the release.
Comment 10 Commit Notification 2013-07-18 09:04:16 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=99d8ce56ecfc4af77cf9b2dc1120d821cba20bee

fdo#66762 - Other: com.sun.star.awt.DisplayAccess removed



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2013-07-18 11:15:44 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=48d7af8ad317b1919e83e7925c5809e8a96d5303&h=libreoffice-4-1

fdo#66762 - Other: com.sun.star.awt.DisplayAccess removed


It will be available in LibreOffice 4.1.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.