Esempio n. 1
0
 public void xRequestFocus() {
   XToolkit.awtLock();
   try {
     if (focusLog.isLoggable(Level.FINER))
       focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()));
     XlibWrapper.XSetInputFocus(XToolkit.getDisplay(), getWindow());
   } finally {
     XToolkit.awtUnlock();
   }
 }
Esempio n. 2
0
 public void handleClientMessage(XEvent xev) {
   if (eventLog.isLoggable(Level.FINER)) {
     XClientMessageEvent msg = xev.get_xclient();
     eventLog.finer(msg.toString());
   }
 }
Esempio n. 3
0
 public void handleReparentNotifyEvent(XEvent xev) {
   if (eventLog.isLoggable(Level.FINER)) {
     XReparentEvent msg = xev.get_xreparent();
     eventLog.finer(msg.toString());
   }
 }
Esempio n. 4
0
 public void setSizeHints(long flags, int x, int y, int width, int height) {
   if (insLog.isLoggable(Level.FINER))
     insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(flags));
   XToolkit.awtLock();
   try {
     XSizeHints hints = getHints();
     // Note: if PPosition is not set in flags this means that
     // we want to reset PPosition in hints.  This is necessary
     // for locationByPlatform functionality
     if ((flags & XlibWrapper.PPosition) != 0) {
       hints.set_x(x);
       hints.set_y(y);
     }
     if ((flags & XlibWrapper.PSize) != 0) {
       hints.set_width(width);
       hints.set_height(height);
     } else if ((hints.get_flags() & XlibWrapper.PSize) != 0) {
       flags |= XlibWrapper.PSize;
     }
     if ((flags & XlibWrapper.PMinSize) != 0) {
       hints.set_min_width(width);
       hints.set_min_height(height);
     } else if ((hints.get_flags() & XlibWrapper.PMinSize) != 0) {
       flags |= XlibWrapper.PMinSize;
       // Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
       // We don't need to reset minimum size if it's already set
     }
     if ((flags & XlibWrapper.PMaxSize) != 0) {
       if (maxBounds != null) {
         if (maxBounds.width != Integer.MAX_VALUE) {
           hints.set_max_width(maxBounds.width);
         } else {
           hints.set_max_width(XToolkit.getDefaultScreenWidth());
         }
         if (maxBounds.height != Integer.MAX_VALUE) {
           hints.set_max_height(maxBounds.height);
         } else {
           hints.set_max_height(XToolkit.getDefaultScreenHeight());
         }
       } else {
         hints.set_max_width(width);
         hints.set_max_height(height);
       }
     } else if ((hints.get_flags() & XlibWrapper.PMaxSize) != 0) {
       flags |= XlibWrapper.PMaxSize;
       if (maxBounds != null) {
         if (maxBounds.width != Integer.MAX_VALUE) {
           hints.set_max_width(maxBounds.width);
         } else {
           hints.set_max_width(XToolkit.getDefaultScreenWidth());
         }
         if (maxBounds.height != Integer.MAX_VALUE) {
           hints.set_max_height(maxBounds.height);
         } else {
           hints.set_max_height(XToolkit.getDefaultScreenHeight());
         }
       } else {
         // Leave intact
       }
     }
     flags |= XlibWrapper.PWinGravity;
     hints.set_flags(flags);
     hints.set_win_gravity((int) XlibWrapper.NorthWestGravity);
     if (insLog.isLoggable(Level.FINER))
       insLog.finer(
           "Setting hints, resulted flags "
               + XlibWrapper.hintsToString(flags)
               + ", values "
               + hints);
     XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
   } finally {
     XToolkit.awtUnlock();
   }
 }