< prev index next >

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

Print this page




 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")
 216     void postInit(XCreateWindowParams params) {




 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         if (!target.isFontSet()) {
 178                target.setFont(XWindow.getDefaultFont());


 179                // we should not call setFont because it will call a repaint
 180                // which the peer may not be ready to do yet.
 181         }
 182         if (!target.isBackgroundSet()) {
 183                target.setBackground(SystemColor.window);


 184                // we should not call setBackGround because it will call a repaint
 185                // which the peer may not be ready to do yet.
 186 
 187         }
 188         if (!target.isForegroundSet()) {

 189                target.setForeground(SystemColor.windowText);
 190                // we should not call setForeGround because it will call a repaint
 191                // which the peer may not be ready to do yet.
 192         }
 193 
 194 
 195         alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
 196 
 197         GraphicsConfiguration gc = getGraphicsConfiguration();
 198         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
 199     }
 200 
 201     protected String getWMName() {
 202         String name = target.getName();
 203         if (name == null || name.trim().equals("")) {
 204             name = " ";
 205         }
 206         return name;
 207     }
 208 
 209     private static native String getLocalHostname();
 210     private static native int getJvmPID();
 211 
 212     @SuppressWarnings("deprecation")
 213     void postInit(XCreateWindowParams params) {


< prev index next >