c - Coordinates passed to XDrawImageString() -
i tracking downwards unusual behavior in programme have been working on.
the programme has x11 status window big amount of text written using
xdrawimagestring(d, w, defaultgc(d, s), x, y, str_to_draw, strlen(str_to_draw)); in loop. there no check on y going off bottom of window, i'd assumed stuff drawn off border of window ignored, discovered if attempted draw stuff far off bottom of window, instead of beingness ignored, can wrap around , start drawing @ top of window again.
this behaviour can prevented calling xgetgeometry() @ start of loop , putting check in coordinates don't overrun dimensions of window, more worrying seems wrap around not causes screen corruption occasional core dump. not exclusively sure on core dump bit, encountered 1 attributing moment.
questions:
how careful 1 need coordinates passed xdrawimagestring() ?
how careful 1 need length of string passed? if there problem bottom, begs question happens if go off border in right hand direction.
how dependent on implementation of x11 reply of this?
x11 coordinates 16 bit, if go past 65535 in either dimension, have wrap around (and waste lot of resources in process).
c linux unix x11
No comments:
Post a Comment