net@tub.UUCP (06/16/87)
I have a couple of questions about the X Window System. I'm new to X
and to this newsgroup/list, so maybe the answers are obvious or the
questions have already been asked before. I'm using X version 10 on an
Integrated Solutions Optimum V WorkStation.
1) Is there a way to define a temporary clipping rectangle for a window?
If not, why?
When a client receives an expose-region event, the XExposeEvent
structure gives the coordinates of the region of the window that
must be repainted by the client. However, clients typically are
kept simple so they can repaint only entire windows, not arbitrary
rectangles within a window. This causes unnecessary activity on the
screen when, for instance, only a small part of a large window has
been exposed.
To avoid unnecessary repainting, the client must clip all drawing
primitives with respect to the rectangle that has become visible. This can
be complicated, and I don't see a reason why the clipping should
not be performed by the server. It would be useful to have
"XSetTemporaryClipping" and "XRemoveTemporaryClipping" requests that
can be used to define (and remove) a rectangle within a window
to which all further drawing requests are clipped. One would
set a temporary clipping on receipt of an expose-region event,
then invoke the function to repaint the entire window, and finally
remove the clipping.
I can't find something like this in the Xlib manual. Is there a way
to obtain this functionality using existing X requests?
2) Is there a way to purge the Xlib request queue? If not, why?
There is a function to flush the output request queue, XFlush(),
but I can't find a way to discard the contents of the request queue.
Imagine the following typical scenario:
A client submits several drawing requests, for instance, to draw a
curve in a window. The requests are buffered in the Xlib until the
next call to XFlush(), XPending(), XNextEvent(), etc. The drawing
requests are based on certain assumptions about the size of the
window, e.g. the curve is scaled so that if fits nicely into the
window. Now, the window gets resized. Before this event is noticed
by the client, the output queue is flushed (typically by a call to
XPending()). The problem is that the requests that had been waiting
in the queue are now executed in the wrong context, because the
window has changed its size in the meantime. The coordinates that
have been supplied together with these requests may no longer be
valid with the new window size (e.g. the curve should be rescaled);
this can produce ugly glitches on the screen.
Obviously, in addition to XFlush() one needs something like "XDiscard()"
or "XPurge()" that can be used to throw away the current contents
of the output request queue. However, there remains the problem that
some requests may have already been sent out by the Xlib, but have
not yet been received by the server (for instance, they may sit somewhere
in the connection to the server).
3) When a rubber box is displayed on the screen by XCreate(), the size of
the box is the minimum window size (determined by the "minwidth" and
"minheight" arguments to XCreate()). This is counter-intuitive.
Instead, a rubber box of the default size should be shown.
It still could be reduced to the minimum size when the middle button
is used for sizing the window.
Is showing the minimum size a feature? If so, how can I tell
XCreate() to rubber band (and finally create) a box of the default size?
If you want to comment publicly, please send me a copy of your response
by E-Mail, too, because the news feed to developing countries like
Germany is very unreliable.
--
Regards,
Oliver Laumann, Technical University of Berlin, Germany.
...!pyramid!tub!net or net@TUB.BITNETnet@tub.BITNET.UUCP (06/16/87)
I have a couple of questions about the X Window System. I'm new to X
and to this newsgroup/list, so maybe the answers are obvious or the
questions have already been asked before. I'm using X version 10 on an
Integrated Solutions Optimum V WorkStation.
1) Is there a way to define a temporary clipping rectangle for a window?
If not, why?
When a client receives an expose-region event, the XExposeEvent
structure gives the coordinates of the region of the window that
must be repainted by the client. However, clients typically are
kept simple so they can repaint only entire windows, not arbitrary
rectangles within a window. This causes unnecessary activity on the
screen when, for instance, only a small part of a large window has
been exposed.
To avoid unnecessary repainting, the client must clip all drawing
primitives with respect to the rectangle that has become visible.
This can be complicated, and I don't see a reason why the clipping
should not be performed by the server. It would be useful to have
"XSetTemporaryClipping" and "XRemoveTemporaryClipping" requests that
can be used to define (and remove) a rectangle within a window to
which all further drawing requests are clipped. One would set a
temporary clipping on receipt of an expose-region event, then invoke
the function to repaint the entire window, and finally remove the
clipping.
I can't find something like this in the Xlib manual. Is there a way
to obtain this functionality using existing X requests?
2) Is there a way to purge the Xlib request queue? If not, why?
There is a function to flush the output request queue, XFlush(),
but I can't find a way to discard the contents of the request queue.
Imagine the following typical scenario:
A client submits several drawing requests, for instance, to draw a
curve in a window. The requests are buffered in the Xlib until the
next call to XFlush(), XPending(), XNextEvent(), etc. The drawing
requests are based on certain assumptions about the size of the
window, e.g. the curve is scaled so that if fits nicely into the
window. Now, the window gets resized. Before this event is noticed
by the client, the output queue is flushed (typically by a call to
XPending()). The problem is that the requests that had been waiting
in the queue are now executed in the wrong context, because the
window has changed its size in the meantime. The coordinates that
have been supplied together with these requests may no longer be
valid with the new window size (e.g. the curve should be rescaled);
this can produce ugly glitches on the screen.
Obviously, in addition to XFlush() one needs something like "XDiscard()"
or "XPurge()" that can be used to throw away the current contents
of the output request queue. However, there remains the problem that
some requests may have already been sent out by the Xlib, but have
not yet been received by the server (for instance, they may sit somewhere
in the connection to the server).
3) When a rubber box is displayed on the screen by XCreate(), the size of
the box is the minimum window size (determined by the "minwidth" and
"minheight" arguments to XCreate()). This is counter-intuitive.
Instead, a rubber box of the default size should be shown.
It still could be reduced to the minimum size when the middle button
is used for sizing the window.
Is showing the minimum size a feature? If so, how can I tell
XCreate() to rubber band (and finally create) a box of the default size?
If you want to comment publicly, please send me a copy of your response
by E-Mail, too, because the news feed to developing countries like
Germany is very unreliable.
--
Regards,
Oliver Laumann, Technical University of Berlin, Germany.
...!pyramid!tub!net or net@TUB.BITNET"E_Borovsky.ESCP8"@XEROX.COM.UUCP (06/17/87)
Gentlemen! I am a freshman to the world of X windows. I would like to have some introduction material like an overview or a tutorial. I need to know what X window system is all about and the status of the different versions. Thanks For Your Help //Emanuel
ken@hpcvlo.HP.COM (Ken Bronstein) (06/26/87)
One way to do clipping rectangles in Xv10 is to create a child window of your application window that is a TRANSPARENT WINDOW. Then you can move the window around to perform clipping as you write to it. Please do NOT perform input on the transparent window as you would have trouble moving that to Xv11. For transparent windows in v11 are GOING AWAY in favor of real clipping rectangles, somebody who really knows v11 help me out.) Not a great story but it works. -Ken Bronstein hp-pcd!ken
sanjeev@psuvax1.psuvax1.cs.psu.edu (Sanjeev Y. Dharap) (07/25/89)
I am programming in Xlib. I am writing an application and I need the application window to come up at a program specified position. I tried using PPosition|PSize but that does not work. Can someone tell me how to achieve such a thing? What does one use NoExpose events for? Thanx in advance for the help. Sanjeev. sanjeev@psuvax1.cs.psu.edu Sanjeev Dharap Dept. of Computer Science, Penn State University, University Park, PA 16802.
chuckles@SNE42E.ORL.MMC.COM (chuck strickland) (03/07/90)
thanks for help on earlier request. All functions are now operable. xmh interfaces to the Rand MH system. What is the RAND MH. Is available public domain. If not is there a mail handler for the sendmail. I did not see one in comp.sources.x thanks chuck strickland