[comp.windows.x] SelectionClear

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (04/22/88)

There are two things you didn't make clear in your message, and they may
be the things causing you problems.  First, selections are really owned
by clients, not by windows.  If a single client changes the selection
from window A to window B, no SelectionClear event is generated.
Second, there is a bug:

VERSION:
	X Window System, Version 11, Release 2

CLIENT MACHINE and OPERATING SYSTEM:
	not applicable

DISPLAY:
	not applicable

AREA:
	server

SYNOPSIS:
	SelectionClear can be sent to the wrong client

DESCRIPTION:
	At least as I interpret the spec, the SelectionClear is supposed
	to be sent to the owner (i.e., the client) of the selection, but
	the V11R2 code sends it to the creator of the owner window.
	This should generally be the same client (conventionally the
	selection owner should use one of its own windows), but needn't
	be according to the protocol spec.

REPEAT-BY:
	(setq dpy1 (xlib:open-display "apx"))
	(setq dpy2 (xlib:open-display "apx"))
	(xlib:set-selection-owner dpy1 :primary (xroot dpy1))
	(xlib:display-finish-output dpy1)
	(xlib:set-selection-owner dpy2 :primary (xroot dpy2))
	(xlib:display-finish-output dpy2)
	; this hangs, but shouldn't
	(xlib:event-case (dpy1) (:selection-clear () (print t) t))

FILES:
	server/dix/dispatch.c