< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java

Print this page




 156         long eventMask = 0;
 157         if (params.containsKey(EVENT_MASK)) {
 158             eventMask = ((Long)params.get(EVENT_MASK));
 159         }
 160         eventMask |= XConstants.VisibilityChangeMask;
 161         params.put(EVENT_MASK, eventMask);
 162 
 163         XA_NET_WM_STATE = XAtom.get("_NET_WM_STATE");
 164 
 165 
 166         params.put(OVERRIDE_REDIRECT, Boolean.valueOf(isOverrideRedirect()));
 167 
 168         SunToolkit.awtLock();
 169         try {
 170             windows.add(this);
 171         } finally {
 172             SunToolkit.awtUnlock();
 173         }
 174 
 175         cachedFocusableWindow = isFocusableWindow();
 176 
 177         Font f = target.getFont();
 178         if (f == null) {
 179             f = XWindow.getDefaultFont();
 180             target.setFont(f);
 181             // we should not call setFont because it will call a repaint
 182             // which the peer may not be ready to do yet.
 183         }
 184         Color c = target.getBackground();
 185         if (c == null) {
 186             Color background = SystemColor.window;
 187             target.setBackground(background);
 188             // we should not call setBackGround because it will call a repaint
 189             // which the peer may not be ready to do yet.
 190         }
 191         c = target.getForeground();
 192         if (c == null) {
 193             target.setForeground(SystemColor.windowText);
 194             // we should not call setForeGround because it will call a repaint
 195             // which the peer may not be ready to do yet.

 196         }
 197 
 198         alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
 199 
 200         GraphicsConfiguration gc = getGraphicsConfiguration();
 201         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
 202     }
 203 
 204     protected String getWMName() {
 205         String name = target.getName();
 206         if (name == null || name.trim().equals("")) {
 207             name = " ";
 208         }
 209         return name;
 210     }
 211 
 212     private static native String getLocalHostname();
 213     private static native int getJvmPID();
 214 
 215     @SuppressWarnings("deprecation")




 156         long eventMask = 0;
 157         if (params.containsKey(EVENT_MASK)) {
 158             eventMask = ((Long)params.get(EVENT_MASK));
 159         }
 160         eventMask |= XConstants.VisibilityChangeMask;
 161         params.put(EVENT_MASK, eventMask);
 162 
 163         XA_NET_WM_STATE = XAtom.get("_NET_WM_STATE");
 164 
 165 
 166         params.put(OVERRIDE_REDIRECT, Boolean.valueOf(isOverrideRedirect()));
 167 
 168         SunToolkit.awtLock();
 169         try {
 170             windows.add(this);
 171         } finally {
 172             SunToolkit.awtUnlock();
 173         }
 174 
 175         cachedFocusableWindow = isFocusableWindow();
 176         if (!target.isBackgroundSet()) {
 177                target.setBackground(SystemColor.window);





 178         }
 179         if (!target.isForegroundSet()) {








 180                target.setForeground(SystemColor.windowText);
 181         }
 182         if (!target.isFontSet()) {
 183                target.setFont(XWindow.getDefaultFont());
 184         }
 185 
 186         alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
 187 
 188         GraphicsConfiguration gc = getGraphicsConfiguration();
 189         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
 190     }
 191 
 192     protected String getWMName() {
 193         String name = target.getName();
 194         if (name == null || name.trim().equals("")) {
 195             name = " ";
 196         }
 197         return name;
 198     }
 199 
 200     private static native String getLocalHostname();
 201     private static native int getJvmPID();
 202 
 203     @SuppressWarnings("deprecation")


< prev index next >