[comp.windows.x] XCopyArea

PAYNE@latlog.UUCP (02/11/88)

I have a query about the use of XCopyArea:

When trying to use XCopyArea to scroll the contents of a window I do the 
following:

Scroll-left: I use XCopyArea to move an area the full size of the window
	     from x=0 to x=-100 (say). This moves the image to the left
	     and generates a graphics expose event for the portion on the
	     right because it has no information to write to that portion
	     of the screen - this is good.

Scroll-right: This time I use XCopyArea to move an area the full size of
	       the screen from x=-100 to x=0. What seems to happen is that
	      the source origin gets changed to be 0(?) so that the image
	       is not moved. If I copy an area smaller than the full window
	      size then I do not get a graphics expose event so I can not
	      find out what part of the screen I need to refresh.


	1) Firstly, is this behaviour right, and if so is there a good
	   reason why the source origin is truncated (or whatever) ?

	2) I realize that this is not perhaps how you envisaged XCopyArea
	   to be used(?) but given that the scroll-left works just fine
	   in this case is there a way of getting identical behaviour
	   when I do a scroll-right?

	3) Alternatively am I doing something wrong?

Thanks in advance.

Julian Payne, European Silicon Structures (ES2
).
(payne@latlog.uucp)

asw@vax-d.rutherford.ac.UK (Antony Williams) (02/12/88)

You would be much better off to calculate the area to be drawn yourself.
A round trip to the server to get the exposure event will cause a delay
in the window update.  The scrolled part will appear first, then the
remainder will be drawn some time later.  Better to XCopyArea
entirely within the window, and compute the rectangle which has
come into view.
   Tony
---------------------------------------------------------------------------
Tony Williams					|Informatics Division
JANET:	asw@uk.ac.rl.vd				|Rutherford Appleton Lab
Usenet:	{... | mcvax}!ukc!rlvd!asw		|Chilton, Didcot
ARPA:	asw%vd.rl.ac.uk@nss.cs.ucl.ac.uk	|Oxon OX11 0QX, UK