193 // which the peer may not be ready to do yet.
194 }
195
196 alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
197
198 GraphicsConfiguration gc = getGraphicsConfiguration();
199 ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
200 }
201
202 protected String getWMName() {
203 String name = target.getName();
204 if (name == null || name.trim().equals("")) {
205 name = " ";
206 }
207 return name;
208 }
209
210 private static native String getLocalHostname();
211 private static native int getJvmPID();
212
213 void postInit(XCreateWindowParams params) {
214 super.postInit(params);
215
216 // Init WM_PROTOCOLS atom
217 initWMProtocols();
218
219 // Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
220 XAtom.get("WM_CLIENT_MACHINE").setProperty(getWindow(), getLocalHostname());
221 XAtom.get("_NET_WM_PID").setCard32Property(getWindow(), getJvmPID());
222
223 // Set WM_TRANSIENT_FOR and group_leader
224 Window t_window = (Window)target;
225 Window owner = t_window.getOwner();
226 if (owner != null) {
227 ownerPeer = (XWindowPeer)owner.getPeer();
228 if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
229 focusLog.finer("Owner is " + owner);
230 focusLog.finer("Owner peer is " + ownerPeer);
231 focusLog.finer("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
232 focusLog.finer("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
383 if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) {
384 iconLog.finest(">>> Length_ of buffer of icons data: " + totalLength +
385 ", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON);
386 }
387
388 return result;
389 }
390
391 /*
392 * Dumps each icon from the list
393 */
394 static void dumpIcons(java.util.List<IconInfo> icons) {
395 if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) {
396 iconLog.finest(">>> Sizes of icon images:");
397 for (Iterator<IconInfo> i = icons.iterator(); i.hasNext(); ) {
398 iconLog.finest(" {0}", i.next());
399 }
400 }
401 }
402
403 public void recursivelySetIcon(java.util.List<IconInfo> icons) {
404 dumpIcons(winAttr.icons);
405 setIconHints(icons);
406 Window target = (Window)this.target;
407 Window[] children = target.getOwnedWindows();
408 int cnt = children.length;
409 for (int i = 0; i < cnt; i++) {
410 ComponentPeer childPeer = children[i].getPeer();
411 if (childPeer != null && childPeer instanceof XWindowPeer) {
412 if (((XWindowPeer)childPeer).winAttr.iconsInherited) {
413 ((XWindowPeer)childPeer).winAttr.icons = icons;
414 ((XWindowPeer)childPeer).recursivelySetIcon(icons);
415 }
416 }
417 }
418 }
419
420 java.util.List<IconInfo> getIconInfo() {
421 return winAttr.icons;
422 }
|
193 // which the peer may not be ready to do yet.
194 }
195
196 alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
197
198 GraphicsConfiguration gc = getGraphicsConfiguration();
199 ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
200 }
201
202 protected String getWMName() {
203 String name = target.getName();
204 if (name == null || name.trim().equals("")) {
205 name = " ";
206 }
207 return name;
208 }
209
210 private static native String getLocalHostname();
211 private static native int getJvmPID();
212
213 @SuppressWarnings("deprecation")
214 void postInit(XCreateWindowParams params) {
215 super.postInit(params);
216
217 // Init WM_PROTOCOLS atom
218 initWMProtocols();
219
220 // Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
221 XAtom.get("WM_CLIENT_MACHINE").setProperty(getWindow(), getLocalHostname());
222 XAtom.get("_NET_WM_PID").setCard32Property(getWindow(), getJvmPID());
223
224 // Set WM_TRANSIENT_FOR and group_leader
225 Window t_window = (Window)target;
226 Window owner = t_window.getOwner();
227 if (owner != null) {
228 ownerPeer = (XWindowPeer)owner.getPeer();
229 if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
230 focusLog.finer("Owner is " + owner);
231 focusLog.finer("Owner peer is " + ownerPeer);
232 focusLog.finer("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
233 focusLog.finer("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
384 if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) {
385 iconLog.finest(">>> Length_ of buffer of icons data: " + totalLength +
386 ", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON);
387 }
388
389 return result;
390 }
391
392 /*
393 * Dumps each icon from the list
394 */
395 static void dumpIcons(java.util.List<IconInfo> icons) {
396 if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) {
397 iconLog.finest(">>> Sizes of icon images:");
398 for (Iterator<IconInfo> i = icons.iterator(); i.hasNext(); ) {
399 iconLog.finest(" {0}", i.next());
400 }
401 }
402 }
403
404 @SuppressWarnings("deprecation")
405 public void recursivelySetIcon(java.util.List<IconInfo> icons) {
406 dumpIcons(winAttr.icons);
407 setIconHints(icons);
408 Window target = (Window)this.target;
409 Window[] children = target.getOwnedWindows();
410 int cnt = children.length;
411 for (int i = 0; i < cnt; i++) {
412 ComponentPeer childPeer = children[i].getPeer();
413 if (childPeer != null && childPeer instanceof XWindowPeer) {
414 if (((XWindowPeer)childPeer).winAttr.iconsInherited) {
415 ((XWindowPeer)childPeer).winAttr.icons = icons;
416 ((XWindowPeer)childPeer).recursivelySetIcon(icons);
417 }
418 }
419 }
420 }
421
422 java.util.List<IconInfo> getIconInfo() {
423 return winAttr.icons;
424 }
|