--- old/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2014-07-23 19:45:59.901498158 +0400 +++ new/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2014-07-23 19:45:59.761498154 +0400 @@ -1801,40 +1801,14 @@ Atom wmState = XInternAtom(awt_display, "_NET_WM_STATE", False); Atom wmStateFs = XInternAtom(awt_display, "_NET_WM_STATE_FULLSCREEN", False); - Window root, parent, *children = NULL; - unsigned int numchildren; + XWindowAttributes attr; XEvent event; - Status status; - if (wmState == None || wmStateFs == None) { + if (wmState == None || wmStateFs == None + || !XGetWindowAttributes(awt_display, win, &attr)) { return; } - /* - * Note: the Window passed to this method is typically the "content - * window" of the top-level, but we need the actual shell window for - * the purposes of constructing the XEvent. Therefore, we walk up the - * window hierarchy here to find the true top-level. - */ - do { - if (!XQueryTree(awt_display, win, - &root, &parent, - &children, &numchildren)) - { - return; - } - - if (children != NULL) { - XFree(children); - } - - if (parent == root) { - break; - } - - win = parent; - } while (root != parent); - memset(&event, 0, sizeof(event)); event.xclient.type = ClientMessage; event.xclient.message_type = wmState; @@ -1844,7 +1818,7 @@ event.xclient.data.l[0] = enabled ? 1 : 0; // 1==add, 0==remove event.xclient.data.l[1] = wmStateFs; - XSendEvent(awt_display, root, False, + XSendEvent(awt_display, attr.root, False, SubstructureRedirectMask | SubstructureNotifyMask, &event); XSync(awt_display, False);