Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » display.getClientArea is incorrect (gtk)
display.getClientArea is incorrect (gtk) [message #483212] Mon, 31 August 2009 15:22 Go to next message
Olivier Cailloux is currently offline Olivier CaillouxFriend
Messages: 6
Registered: July 2009
Junior Member
Dear list,

Please consider the following snippet.

---
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;

public class GtkClientArea {
public static void main(final String[] args) {
final Display display = new Display();
final Rectangle clientArea = display.getClientArea();
System.out.println("Client area: " + clientArea.toString());
display.dispose();
}
}
---

On my system (debian lenny, gtk), it gives: "Client area: Rectangle {0,
0, 1280, 1024}". My screen is indeed 1280*1024, but I have (as is usual
in Linux) a top bar and a bottom task bar, meaning that this is not the
area which can be used by applications.

If in my app I try to create a shell and set its size to 1280*1024, when
opening it, I see it is automatically resized after opening to (about)
1280*974, I guess, by the windows manager.

So the method getClientArea does not seem to return the area my
application can use to display itself. Is it a bug?

Thank you.
Olivier
Re: display.getClientArea is incorrect (gtk) [message #483490 is a reply to message #483212] Tue, 01 September 2009 18:01 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
This is logged as https://bugs.eclipse.org/bugs/show_bug.cgi?id=33659 .

Grant


"Olivier Cailloux" <mlsmg@ulb.ac.be> wrote in message
news:h7gprc$nlr$1@build.eclipse.org...
> Dear list,
>
> Please consider the following snippet.
>
> ---
> import org.eclipse.swt.graphics.Rectangle;
> import org.eclipse.swt.widgets.Display;
>
> public class GtkClientArea {
> public static void main(final String[] args) {
> final Display display = new Display();
> final Rectangle clientArea = display.getClientArea();
> System.out.println("Client area: " + clientArea.toString());
> display.dispose();
> }
> }
> ---
>
> On my system (debian lenny, gtk), it gives: "Client area: Rectangle {0,
> 0, 1280, 1024}". My screen is indeed 1280*1024, but I have (as is usual
> in Linux) a top bar and a bottom task bar, meaning that this is not the
> area which can be used by applications.
>
> If in my app I try to create a shell and set its size to 1280*1024, when
> opening it, I see it is automatically resized after opening to (about)
> 1280*974, I guess, by the windows manager.
>
> So the method getClientArea does not seem to return the area my
> application can use to display itself. Is it a bug?
>
> Thank you.
> Olivier
Re: display.getClientArea is incorrect (gtk) [message #483660 is a reply to message #483490] Wed, 02 September 2009 13:54 Go to previous message
Olivier Cailloux is currently offline Olivier CaillouxFriend
Messages: 6
Registered: July 2009
Junior Member
Grant Gayed a écrit :
> This is logged as https://bugs.eclipse.org/bugs/show_bug.cgi?id=33659 .
Ooops. Being new at SWT, I didn't thought I would have found a real bug
but rather something I was not understanding correctly, so I did not
even bother to check there... My fault!

Thank you for your time.
Olivier

>
> Grant
>
>
> "Olivier Cailloux" <mlsmg@ulb.ac.be> wrote in message
> news:h7gprc$nlr$1@build.eclipse.org...
>> Dear list,
>>
>> Please consider the following snippet.
>>
>> ---
>> import org.eclipse.swt.graphics.Rectangle;
>> import org.eclipse.swt.widgets.Display;
>>
>> public class GtkClientArea {
>> public static void main(final String[] args) {
>> final Display display = new Display();
>> final Rectangle clientArea = display.getClientArea();
>> System.out.println("Client area: " + clientArea.toString());
>> display.dispose();
>> }
>> }
>> ---
>>
>> On my system (debian lenny, gtk), it gives: "Client area: Rectangle {0,
>> 0, 1280, 1024}". My screen is indeed 1280*1024, but I have (as is usual
>> in Linux) a top bar and a bottom task bar, meaning that this is not the
>> area which can be used by applications.
>>
>> If in my app I try to create a shell and set its size to 1280*1024, when
>> opening it, I see it is automatically resized after opening to (about)
>> 1280*974, I guess, by the windows manager.
>>
>> So the method getClientArea does not seem to return the area my
>> application can use to display itself. Is it a bug?
>>
>> Thank you.
>> Olivier
>
>
Previous Topic:setting margin for the nested composite.
Next Topic:Create an DragSourceEvent
Goto Forum:
  


Current Time: Fri Aug 23 02:09:41 GMT 2019

Powered by FUDForum. Page generated in 0.02097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top