< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 191                target.setBackground(SystemColor.window);
 192                // we should not call setBackGround because it will call a repaint
 193                // which the peer may not be ready to do yet.
 194 
 195         }
 196         if (!target.isForegroundSet()) {
 197                target.setForeground(SystemColor.windowText);
 198                // we should not call setForeGround because it will call a repaint
 199                // which the peer may not be ready to do yet.
 200         }
 201 
 202 
 203         alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
 204 
 205         GraphicsConfiguration gc = getGraphicsConfiguration();
 206         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
 207     }
 208 
 209     protected String getWMName() {
 210         String name = target.getName();
 211         if (name == null || name.trim().equals("")) {
 212             name = " ";
 213         }
 214         return name;
 215     }
 216 
 217     private static native String getLocalHostname();
 218     private static native int getJvmPID();
 219 
 220     @SuppressWarnings("deprecation")
 221     void postInit(XCreateWindowParams params) {
 222         super.postInit(params);
 223 
 224         // Init WM_PROTOCOLS atom
 225         initWMProtocols();
 226 
 227         // Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
 228         XAtom.get("WM_CLIENT_MACHINE").setProperty(getWindow(), getLocalHostname());
 229         XAtom.get("_NET_WM_PID").setCard32Property(getWindow(), getJvmPID());
 230 
 231         // Set WM_TRANSIENT_FOR and group_leader


   1 /*
   2  * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 191                target.setBackground(SystemColor.window);
 192                // we should not call setBackGround because it will call a repaint
 193                // which the peer may not be ready to do yet.
 194 
 195         }
 196         if (!target.isForegroundSet()) {
 197                target.setForeground(SystemColor.windowText);
 198                // we should not call setForeGround because it will call a repaint
 199                // which the peer may not be ready to do yet.
 200         }
 201 
 202 
 203         alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported();
 204 
 205         GraphicsConfiguration gc = getGraphicsConfiguration();
 206         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
 207     }
 208 
 209     protected String getWMName() {
 210         String name = target.getName();
 211         if (name == null || name.trim().isEmpty()) {
 212             name = " ";
 213         }
 214         return name;
 215     }
 216 
 217     private static native String getLocalHostname();
 218     private static native int getJvmPID();
 219 
 220     @SuppressWarnings("deprecation")
 221     void postInit(XCreateWindowParams params) {
 222         super.postInit(params);
 223 
 224         // Init WM_PROTOCOLS atom
 225         initWMProtocols();
 226 
 227         // Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
 228         XAtom.get("WM_CLIENT_MACHINE").setProperty(getWindow(), getLocalHostname());
 229         XAtom.get("_NET_WM_PID").setCard32Property(getWindow(), getJvmPID());
 230 
 231         // Set WM_TRANSIENT_FOR and group_leader


< prev index next >