jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java
author yan
Mon, 06 Oct 2008 16:45:00 +0400
changeset 1966 12a51fb0db0d
parent 439 3488710b02f8
child 3938 ef327bd847c0
permissions -rw-r--r--
5100701: Toolkit.getLockingKeyState() does not work on XToolkit, but works on Motif Summary: Does not work on Motif but works on XToolkit now; implemented using XQueryPointer. Reviewed-by: anthony
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
439
3488710b02f8 6623459: Get rid of XConstant, XProtocolConstants and XUtilConstants antipattern
dav
parents: 2
diff changeset
     2
 * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
package sun.awt.X11;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.util.logging.Level;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.logging.Logger;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
    final static Logger log = Logger.getLogger("sun.awt.X11.XWINProtocol");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/* Gnome WM spec  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    XAtom XA_WIN_SUPPORTING_WM_CHECK = XAtom.get("_WIN_SUPPORTING_WM_CHECK");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    XAtom XA_WIN_PROTOCOLS = XAtom.get("_WIN_PROTOCOLS");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    XAtom XA_WIN_STATE = XAtom.get("_WIN_STATE");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    public boolean supportsState(int state) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        return doStateProtocol();   // TODO - check for Frame constants
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    public void setState(XWindowPeer window, int state) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        if (window.isShowing()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
            /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
             * Request state transition from a Gnome WM (_WIN protocol) by sending
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
             * _WIN_STATE ClientMessage to root window.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
             */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
            long win_state = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
            if ( (state & Frame.MAXIMIZED_VERT) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
                win_state |= WIN_STATE_MAXIMIZED_VERT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
            if ( (state & Frame.MAXIMIZED_HORIZ) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
                win_state |= WIN_STATE_MAXIMIZED_HORIZ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
            XClientMessageEvent req = new XClientMessageEvent();
439
3488710b02f8 6623459: Get rid of XConstant, XProtocolConstants and XUtilConstants antipattern
dav
parents: 2
diff changeset
    61
            req.set_type(XConstants.ClientMessage);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            req.set_window(window.getWindow());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
            req.set_message_type(XA_WIN_STATE.getAtom());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
            req.set_format(32);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
            req.set_data(0, (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            req.set_data(1, win_state);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            if (log.isLoggable(Level.FINE)) log.fine("Sending WIN_STATE to root to change the state to " + win_state);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
                XToolkit.awtLock();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                XlibWrapper.XSendEvent(XToolkit.getDisplay(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                        XlibWrapper.RootWindow(XToolkit.getDisplay(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                            window.getScreenNumber()),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                        false,
439
3488710b02f8 6623459: Get rid of XConstant, XProtocolConstants and XUtilConstants antipattern
dav
parents: 2
diff changeset
    74
                        XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                        req.pData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                XToolkit.awtUnlock();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
            req.dispose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
             * Specify initial state for a Gnome WM (_WIN protocol) by setting
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
             * WIN_STATE property on the window to the desired state before
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
             * mapping it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
             */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            /* Be careful to not wipe out state bits we don't understand */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            long win_state = XA_WIN_STATE.getCard32Property(window);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            long old_win_state = win_state;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
             * In their stupid quest of reinventing every wheel, Gnome WM spec
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
             * have its own "minimized" hint (instead of using initial state
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
             * and WM_STATE hints).  This is bogus, but, apparently, some WMs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
             * pay attention.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
             */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            if ((state & Frame.ICONIFIED) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
                win_state |= WIN_STATE_MINIMIZED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                win_state &= ~WIN_STATE_MINIMIZED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            if ((state & Frame.MAXIMIZED_VERT) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                win_state |= WIN_STATE_MAXIMIZED_VERT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                win_state &= ~WIN_STATE_MAXIMIZED_VERT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            if ((state & Frame.MAXIMIZED_HORIZ) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                win_state |= WIN_STATE_MAXIMIZED_HORIZ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                win_state &= ~WIN_STATE_MAXIMIZED_HORIZ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
            if ((old_win_state ^ win_state) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                if (log.isLoggable(Level.FINE)) log.fine("Setting WIN_STATE on " + window + " to change the state to " + win_state);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                XA_WIN_STATE.setCard32Property(window, win_state);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public int getState(XWindowPeer window) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        long win_state = XA_WIN_STATE.getCard32Property(window);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        int java_state = Frame.NORMAL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        if ((win_state & WIN_STATE_MAXIMIZED_VERT) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            java_state |= Frame.MAXIMIZED_VERT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        if ((win_state & WIN_STATE_MAXIMIZED_HORIZ) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            java_state |= Frame.MAXIMIZED_HORIZ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        return java_state;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    public boolean isStateChange(XPropertyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        return doStateProtocol() && e.get_atom() == XA_WIN_STATE.getAtom();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    public void unshadeKludge(XWindowPeer window) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        long win_state = XA_WIN_STATE.getCard32Property(window);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        if ((win_state & WIN_STATE_SHADED) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        win_state &= ~WIN_STATE_SHADED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        XA_WIN_STATE.setCard32Property(window, win_state);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    public boolean supportsLayer(int layer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        return ((layer == LAYER_ALWAYS_ON_TOP) || (layer == LAYER_NORMAL)) && doLayerProtocol();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    public void setLayer(XWindowPeer window, int layer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        if (window.isShowing()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            XClientMessageEvent req = new XClientMessageEvent();
439
3488710b02f8 6623459: Get rid of XConstant, XProtocolConstants and XUtilConstants antipattern
dav
parents: 2
diff changeset
   153
            req.set_type(XConstants.ClientMessage);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            req.set_window(window.getWindow());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            req.set_message_type(XA_WIN_LAYER.getAtom());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            req.set_format(32);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            req.set_data(0, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            req.set_data(1, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            req.set_data(2, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            if (log.isLoggable(Level.FINE)) log.fine("Setting layer " + layer + " by root message : " + req);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            XToolkit.awtLock();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                XlibWrapper.XSendEvent(XToolkit.getDisplay(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                        XlibWrapper.RootWindow(XToolkit.getDisplay(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                            window.getScreenNumber()),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                        false,
439
3488710b02f8 6623459: Get rid of XConstant, XProtocolConstants and XUtilConstants antipattern
dav
parents: 2
diff changeset
   167
                        /*XConstants.SubstructureRedirectMask | */XConstants.SubstructureNotifyMask,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                        req.pData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                XToolkit.awtUnlock();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            req.dispose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            if (log.isLoggable(Level.FINE)) log.fine("Setting layer property to " + layer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            XA_WIN_LAYER.setCard32Property(window, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    XAtom XA_WIN_LAYER = XAtom.get("_WIN_LAYER");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
/* _WIN_STATE bits */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    final static int WIN_STATE_STICKY          =(1<<0); /* everyone knows sticky            */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    final static int WIN_STATE_MINIMIZED       =(1<<1); /* Reserved - definition is unclear */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    final static int WIN_STATE_MAXIMIZED_VERT  =(1<<2); /* window in maximized V state      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    final static int WIN_STATE_MAXIMIZED_HORIZ =(1<<3); /* window in maximized H state      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    final static int WIN_STATE_HIDDEN          =(1<<4); /* not on taskbar but window visible*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    final static int WIN_STATE_SHADED          =(1<<5); /* shaded (MacOS / Afterstep style) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
/* _WIN_LAYER values */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    final static int WIN_LAYER_ONTOP = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    final static int WIN_LAYER_NORMAL = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    long WinWindow = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    boolean supportChecked = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    void detect() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        if (supportChecked) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        WinWindow = checkAnchor(XA_WIN_SUPPORTING_WM_CHECK, XAtom.XA_CARDINAL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        supportChecked = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        if (log.isLoggable(Level.FINE)) log.fine("### " + this + " is active: " + (WinWindow != 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    boolean active() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        detect();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        return WinWindow != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    boolean doStateProtocol() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_STATE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        if (log.isLoggable(Level.FINE)) log.fine("### " + this + " supports state: " + res);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        return res;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    boolean doLayerProtocol() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_LAYER);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        if (log.isLoggable(Level.FINE)) log.fine("### " + this + " supports layer: " + res);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        return res;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
}