362
363 XlibWrapper.XSelectInput(XToolkit.getDisplay(),
364 dragRootWindow,
365 rootEventMask);
366 }
367
368 rootEventMask = 0;
369 dragRootWindow = 0;
370 }
371
372 private boolean processClientMessage(XClientMessageEvent xclient) {
373 if (dragProtocol != null) {
374 return dragProtocol.processClientMessage(xclient);
375 }
376 return false;
377 }
378
379 /**
380 * Updates the source action according to the specified state.
381 *
382 * @returns true if the source
383 */
384 private boolean updateSourceAction(int state) {
385 int action = SunDragSourceContextPeer.convertModifiersToDropAction(XWindow.getModifiers(state, 0, 0),
386 sourceActions);
387 if (sourceAction == action) {
388 return false;
389 }
390 sourceAction = action;
391 return true;
392 }
393
394 /**
395 * Returns the client window under the specified root subwindow.
396 */
397 private static long findClientWindow(long window) {
398 if (XlibUtil.isTrueToplevelWindow(window)) {
399 return window;
400 }
401
402 Set<Long> children = XlibUtil.getChildWindows(window);
553 }
554
555 XClientMessageEvent xclient = ev.get_xclient();
556
557 Iterator<XDragSourceProtocol> dragProtocols =
558 XDragAndDropProtocols.getDragSourceProtocols();
559 while (dragProtocols.hasNext()) {
560 XDragSourceProtocol dragProtocol = dragProtocols.next();
561 if (dragProtocol.processProxyModeEvent(xclient,
562 getProxyModeSourceWindow())) {
563 return true;
564 }
565 }
566
567 return false;
568 }
569
570 /**
571 * The caller must own awtLock.
572 *
573 * @returns true if the even was processed and shouldn't be passed along.
574 */
575 private boolean doProcessEvent(XEvent ev) {
576 assert XToolkit.isAWTLockHeldByCurrentThread();
577
578 if (processProxyModeEvent(ev)) {
579 return true;
580 }
581
582 if (!dndInProgress) {
583 return false;
584 }
585
586 switch (ev.get_type()) {
587 case XConstants.ClientMessage: {
588 XClientMessageEvent xclient = ev.get_xclient();
589 return processClientMessage(xclient);
590 }
591 case XConstants.DestroyNotify: {
592 XDestroyWindowEvent xde = ev.get_xdestroywindow();
593
|
362
363 XlibWrapper.XSelectInput(XToolkit.getDisplay(),
364 dragRootWindow,
365 rootEventMask);
366 }
367
368 rootEventMask = 0;
369 dragRootWindow = 0;
370 }
371
372 private boolean processClientMessage(XClientMessageEvent xclient) {
373 if (dragProtocol != null) {
374 return dragProtocol.processClientMessage(xclient);
375 }
376 return false;
377 }
378
379 /**
380 * Updates the source action according to the specified state.
381 *
382 * @return true if the source
383 */
384 private boolean updateSourceAction(int state) {
385 int action = SunDragSourceContextPeer.convertModifiersToDropAction(XWindow.getModifiers(state, 0, 0),
386 sourceActions);
387 if (sourceAction == action) {
388 return false;
389 }
390 sourceAction = action;
391 return true;
392 }
393
394 /**
395 * Returns the client window under the specified root subwindow.
396 */
397 private static long findClientWindow(long window) {
398 if (XlibUtil.isTrueToplevelWindow(window)) {
399 return window;
400 }
401
402 Set<Long> children = XlibUtil.getChildWindows(window);
553 }
554
555 XClientMessageEvent xclient = ev.get_xclient();
556
557 Iterator<XDragSourceProtocol> dragProtocols =
558 XDragAndDropProtocols.getDragSourceProtocols();
559 while (dragProtocols.hasNext()) {
560 XDragSourceProtocol dragProtocol = dragProtocols.next();
561 if (dragProtocol.processProxyModeEvent(xclient,
562 getProxyModeSourceWindow())) {
563 return true;
564 }
565 }
566
567 return false;
568 }
569
570 /**
571 * The caller must own awtLock.
572 *
573 * @return true if the even was processed and shouldn't be passed along.
574 */
575 private boolean doProcessEvent(XEvent ev) {
576 assert XToolkit.isAWTLockHeldByCurrentThread();
577
578 if (processProxyModeEvent(ev)) {
579 return true;
580 }
581
582 if (!dndInProgress) {
583 return false;
584 }
585
586 switch (ev.get_type()) {
587 case XConstants.ClientMessage: {
588 XClientMessageEvent xclient = ev.get_xclient();
589 return processClientMessage(xclient);
590 }
591 case XConstants.DestroyNotify: {
592 XDestroyWindowEvent xde = ev.get_xdestroywindow();
593
|