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

Print this page

        

*** 126,136 **** XToolkit.awtLock(); try { long display = XToolkit.getDisplay(); synchronized(this) { setOwner(owner, screen); ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner ); XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask); XToolkit.addEventDispatcher(owner, new XEventDispatcher() { public void dispatchEvent(XEvent ev) { dispatchSelectionEvent(ev, screen); --- 126,138 ---- XToolkit.awtLock(); try { long display = XToolkit.getDisplay(); synchronized(this) { setOwner(owner, screen); ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("New Selection Owner for screen " + screen + " = " + owner ); ! } XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask); XToolkit.addEventDispatcher(owner, new XEventDispatcher() { public void dispatchEvent(XEvent ev) { dispatchSelectionEvent(ev, screen);
*** 146,168 **** void selectPerScreen(final int screen, long extra_mask) { XToolkit.awtLock(); try { try { long display = XToolkit.getDisplay(); ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("Grabbing XServer"); XlibWrapper.XGrabServer(display); synchronized(this) { String selection_name = getName()+"_S"+screen; ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("Screen = " + screen + " selection name = " + selection_name); XAtom atom = XAtom.get(selection_name); selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection setAtom(atom,screen); long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom()); if (owner != 0) { setOwner(owner, screen); ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner ); XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask); XToolkit.addEventDispatcher(owner, new XEventDispatcher() { public void dispatchEvent(XEvent ev) { dispatchSelectionEvent(ev, screen); --- 148,176 ---- void selectPerScreen(final int screen, long extra_mask) { XToolkit.awtLock(); try { try { long display = XToolkit.getDisplay(); ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("Grabbing XServer"); ! } XlibWrapper.XGrabServer(display); synchronized(this) { String selection_name = getName()+"_S"+screen; ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("Screen = " + screen + " selection name = " + selection_name); ! } XAtom atom = XAtom.get(selection_name); selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection setAtom(atom,screen); long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom()); if (owner != 0) { setOwner(owner, screen); ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("Selection Owner for screen " + screen + " = " + owner ); ! } XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask); XToolkit.addEventDispatcher(owner, new XEventDispatcher() { public void dispatchEvent(XEvent ev) { dispatchSelectionEvent(ev, screen);
*** 173,183 **** } catch (Exception e) { e.printStackTrace(); } finally { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("UnGrabbing XServer"); XlibWrapper.XUngrabServer(XToolkit.getDisplay()); } } finally { XToolkit.awtUnlock(); } --- 181,193 ---- } catch (Exception e) { e.printStackTrace(); } finally { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("UnGrabbing XServer"); ! } XlibWrapper.XUngrabServer(XToolkit.getDisplay()); } } finally { XToolkit.awtUnlock(); }
*** 185,195 **** static boolean processClientMessage(XEvent xev, int screen) { XClientMessageEvent xce = xev.get_xclient(); if (xce.get_message_type() == XA_MANAGER.getAtom()) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("client messags = " + xce); long timestamp = xce.get_data(0); long atom = xce.get_data(1); long owner = xce.get_data(2); long data = xce.get_data(3); --- 195,207 ---- static boolean processClientMessage(XEvent xev, int screen) { XClientMessageEvent xce = xev.get_xclient(); if (xce.get_message_type() == XA_MANAGER.getAtom()) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("client messags = " + xce); ! } long timestamp = xce.get_data(0); long atom = xce.get_data(1); long owner = xce.get_data(2); long data = xce.get_data(3);
*** 292,313 **** return selectionName; } synchronized void dispatchSelectionChanged( XPropertyEvent ev, int screen) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Changed : Screen = " + screen + "Event =" + ev); if (listeners != null) { Iterator iter = listeners.iterator(); while (iter.hasNext()) { XMSelectionListener disp = (XMSelectionListener) iter.next(); disp.selectionChanged(screen, this, ev.get_window(), ev); } } } synchronized void dispatchOwnerDeath(XDestroyWindowEvent de, int screen) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("Owner dead : Screen = " + screen + "Event =" + de); if (listeners != null) { Iterator iter = listeners.iterator(); while (iter.hasNext()) { XMSelectionListener disp = (XMSelectionListener) iter.next(); disp.ownerDeath(screen, this, de.get_window()); --- 304,329 ---- return selectionName; } synchronized void dispatchSelectionChanged( XPropertyEvent ev, int screen) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("Selection Changed : Screen = " + screen + "Event =" + ev); ! } if (listeners != null) { Iterator iter = listeners.iterator(); while (iter.hasNext()) { XMSelectionListener disp = (XMSelectionListener) iter.next(); disp.selectionChanged(screen, this, ev.get_window(), ev); } } } synchronized void dispatchOwnerDeath(XDestroyWindowEvent de, int screen) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("Owner dead : Screen = " + screen + "Event =" + de); ! } if (listeners != null) { Iterator iter = listeners.iterator(); while (iter.hasNext()) { XMSelectionListener disp = (XMSelectionListener) iter.next(); disp.ownerDeath(screen, this, de.get_window());
*** 315,325 **** } } } void dispatchSelectionEvent(XEvent xev, int screen) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("Event =" + xev); if (xev.get_type() == XConstants.DestroyNotify) { XDestroyWindowEvent de = xev.get_xdestroywindow(); dispatchOwnerDeath( de, screen); } else if (xev.get_type() == XConstants.PropertyNotify) { --- 331,343 ---- } } } void dispatchSelectionEvent(XEvent xev, int screen) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("Event =" + xev); ! } if (xev.get_type() == XConstants.DestroyNotify) { XDestroyWindowEvent de = xev.get_xdestroywindow(); dispatchOwnerDeath( de, screen); } else if (xev.get_type() == XConstants.PropertyNotify) {