Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 8461 Details for
Bug 33659
Display.getClientArea() includes toolbar on Linux
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
_NET_WORKAREA patch
workarea3.diff (text/plain), 2.52 KB, created by
Billy Biggs
on 2004-03-10 10:54:48 EST
(
hide
)
Description:
_NET_WORKAREA patch
Filename:
MIME Type:
Creator:
Billy Biggs
Created:
2004-03-10 10:54:48 EST
Size:
2.52 KB
patch
obsolete
>Index: Display.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java,v >retrieving revision 1.112 >diff -u -r1.112 Display.java >--- Display.java 2 Mar 2004 22:53:16 -0000 1.112 >+++ Display.java 10 Mar 2004 15:43:34 -0000 >@@ -318,6 +318,10 @@ > String [] keys; > Object [] values; > >+ /* Work area */ >+ Rectangle workArea; >+ long workAreaLastUpdated = 0; >+ > /* Initial Guesses for Shell Trimmings. */ > int borderTrimWidth = 4, borderTrimHeight = 4; > int resizeTrimWidth = 6, resizeTrimHeight = 6; >@@ -773,6 +777,39 @@ > } > > /** >+ * Returns the work area, an EWMH property to store the size >+ * and position of the screen not covered by dock and panel >+ * windows. >+ * >+ * http://freedesktop.org/Standards/wm-spec/ >+ */ >+static Rectangle getWorkArea() { >+ /* TODO: We will need more atoms like this for other EWMH features. >+ * We should list them all and do one large XInternAtoms() call on >+ * startup to avoid extra round trips like this one. */ >+ byte[] name = Converter.wcsToMbcs(null, "_NET_WORKAREA", true); >+ int /*long*/ atom = OS.gdk_atom_intern(name, true); >+ if (atom == OS.GDK_NONE) return null; >+ int /*long*/[] actualType = new int /*long*/[1]; >+ int[] actualFormat = new int[1]; >+ int[] actualLength = new int[1]; >+ int /*long*/[] data = new int /*long*/[1]; >+ int values[] = new int[4]; >+ if (!OS.gdk_property_get(OS.GDK_ROOT_PARENT(), atom, OS.GDK_NONE, >+ 0, 16, 0, actualType, actualFormat, actualLength, data)) return null; >+ >+ if (data[0] == 0) return null; >+ if (actualLength[0] < 16) { >+ OS.g_free(data[0]); >+ return null; >+ } >+ >+ OS.memmove (values, data[0], 16); >+ OS.g_free(data[0]); >+ return new Rectangle(values[0],values[1],values[2],values[3]); >+} >+ >+/** > * Returns a rectangle describing the receiver's size and location. > * > * @return the bounding rectangle >@@ -784,6 +821,20 @@ > */ > public Rectangle getBounds () { > checkDevice (); >+ >+ /* Querying the work area is a round trip to the X server. It's also >+ * something that updates at runtime. Cache the value, but remember >+ * to update often. Every 8 seconds seems reasonable. >+ */ >+ long curtime = System.currentTimeMillis(); >+ if (workAreaLastUpdated == 0 || curtime > workAreaLastUpdated + 8000) { >+ workAreaLastUpdated = curtime; >+ workArea = getWorkArea(); >+ } >+ >+ if (workArea != null) { >+ return new Rectangle(workArea.x,workArea.y,workArea.width,workArea.height); >+ } > return new Rectangle (0, 0, OS.gdk_screen_width (), OS.gdk_screen_height ()); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33659
: 8461