src/solaris/classes/sun/awt/X11/XProtocol.java

Print this page




  37 
  38     volatile boolean firstCheck = true;
  39     /*
  40      * Check that that the list of protocols specified by WM in property
  41      * named LIST_NAME on the root window contains protocol PROTO.
  42      */
  43     boolean checkProtocol(XAtom listName, XAtom protocol) {
  44         XAtomList protocols = atomToList.get(listName);
  45 
  46         if (protocols != null) {
  47             return protocols.contains(protocol);
  48         }
  49 
  50         protocols = listName.getAtomListPropertyList(XToolkit.getDefaultRootWindow());
  51         atomToList.put(listName, protocols);
  52         try {
  53             return protocols.contains(protocol);
  54         } finally {
  55             if (firstCheck) {
  56                 firstCheck = false;
  57                 if (log.isLoggable(PlatformLogger.FINE)) {
  58                     log.fine("{0}:{1} supports {2}", this, listName, protocols);
  59                 }
  60             }
  61         }
  62     }
  63 
  64     /*
  65      * Check for anchor_prop(anchor_type) on root, take the value as the
  66      * window id and check if that window exists and has anchor_prop(anchor_type)
  67      * with the same value (i.e. pointing back to self).
  68      *
  69      * Returns the anchor window, as some WM may put interesting stuff in
  70      * its properties (e.g. sawfish).
  71      */
  72     long checkAnchorImpl(XAtom anchorProp, long anchorType) {
  73         long root_xref, self_xref;
  74 
  75         XToolkit.awtLock();
  76         try {
  77             root_xref = anchorProp.get32Property(XToolkit.getDefaultRootWindow(),




  37 
  38     volatile boolean firstCheck = true;
  39     /*
  40      * Check that that the list of protocols specified by WM in property
  41      * named LIST_NAME on the root window contains protocol PROTO.
  42      */
  43     boolean checkProtocol(XAtom listName, XAtom protocol) {
  44         XAtomList protocols = atomToList.get(listName);
  45 
  46         if (protocols != null) {
  47             return protocols.contains(protocol);
  48         }
  49 
  50         protocols = listName.getAtomListPropertyList(XToolkit.getDefaultRootWindow());
  51         atomToList.put(listName, protocols);
  52         try {
  53             return protocols.contains(protocol);
  54         } finally {
  55             if (firstCheck) {
  56                 firstCheck = false;
  57                 if (log.isLoggable(PlatformLogger.Level.FINE)) {
  58                     log.fine("{0}:{1} supports {2}", this, listName, protocols);
  59                 }
  60             }
  61         }
  62     }
  63 
  64     /*
  65      * Check for anchor_prop(anchor_type) on root, take the value as the
  66      * window id and check if that window exists and has anchor_prop(anchor_type)
  67      * with the same value (i.e. pointing back to self).
  68      *
  69      * Returns the anchor window, as some WM may put interesting stuff in
  70      * its properties (e.g. sawfish).
  71      */
  72     long checkAnchorImpl(XAtom anchorProp, long anchorType) {
  73         long root_xref, self_xref;
  74 
  75         XToolkit.awtLock();
  76         try {
  77             root_xref = anchorProp.get32Property(XToolkit.getDefaultRootWindow(),