Check-in [f50d38a336]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:proper handle InputOnly windows in sdltk
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f50d38a336ac9ad58b2c65026cf87c016be3c0ec
User & Date: chw 2019-03-13 01:14:27
Context
2019-03-13
09:10
add exit handler to tkvlc check-in: f27d22789e user: chw tags: trunk
01:14
proper handle InputOnly windows in sdltk check-in: f50d38a336 user: chw tags: trunk
2019-03-11
19:59
make tepam usable in AndroWish check-in: 89174763b9 user: chw tags: trunk
Changes

Changes to jni/sdl2tk/sdl/SdlTkGfx.c.

652
653
654
655
656
657
658



659
660
661
662
663
664
665
SdlTkGfxExposeRegion(Window w, Region dirtyRgn)
{
    long i;
    int count;

    if (!(((_Window *) w)->atts.your_event_mask & ExposureMask)) {
	return 0;



    }
    if (XEmptyRegion(dirtyRgn)) {
	return 0;
    }
    count = dirtyRgn->numRects - 1;
    for (i = 0; i < dirtyRgn->numRects; i++, count--) {
	BoxPtr box = &((REGION *) dirtyRgn)->rects[i];







>
>
>







652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
SdlTkGfxExposeRegion(Window w, Region dirtyRgn)
{
    long i;
    int count;

    if (!(((_Window *) w)->atts.your_event_mask & ExposureMask)) {
	return 0;
    }
    if (((_Window *) w)->clazz == InputOnly) {
	return 0;
    }
    if (XEmptyRegion(dirtyRgn)) {
	return 0;
    }
    count = dirtyRgn->numRects - 1;
    for (i = 0; i < dirtyRgn->numRects; i++, count--) {
	BoxPtr box = &((REGION *) dirtyRgn)->rects[i];

Changes to jni/sdl2tk/sdl/SdlTkInt.c.

2616
2617
2618
2619
2620
2621
2622

2623
2624
2625
2626
2627
2628
2629
....
2653
2654
2655
2656
2657
2658
2659
2660

2661
2662
2663
2664
2665
2666
2667
	 */
	if (parent->child != _w) {
	    Region rgn2 = SdlTkRgnPoolGet();

	    child = parent->child;
	    while (child != _w) {
		if ((child->atts.map_state != IsUnmapped) &&

		    (XRectInRegion(_w->visRgnInParent, child->atts.x,
				   child->atts.y, child->parentWidth,
				   child->parentHeight) != RectangleOut)) {
		    rect.x = child->atts.x;
		    rect.y = child->atts.y;
		    rect.width = child->parentWidth;
		    rect.height = child->parentHeight;
................................................................................
     * Subtract one rectangle for each mapped child from visRgn (a window
     * can't draw over its children)
     */
    if (_w->child != NULL) {
	Region rgn2 = SdlTkRgnPoolGet();

	for (child = _w->child; child != NULL; child = child->next) {
	    if (child->atts.map_state != IsUnmapped) {

		rect.x = _w->atts.x + child->atts.x;
		rect.y = _w->atts.y + child->atts.y;
		rect.width = child->parentWidth;
		rect.height = child->parentHeight;
		XUnionRectWithRegion(&rect, rgn2, rgn2);
	    }
	}







>







 







|
>







2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
....
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
	 */
	if (parent->child != _w) {
	    Region rgn2 = SdlTkRgnPoolGet();

	    child = parent->child;
	    while (child != _w) {
		if ((child->atts.map_state != IsUnmapped) &&
		    (child->clazz != InputOnly) &&
		    (XRectInRegion(_w->visRgnInParent, child->atts.x,
				   child->atts.y, child->parentWidth,
				   child->parentHeight) != RectangleOut)) {
		    rect.x = child->atts.x;
		    rect.y = child->atts.y;
		    rect.width = child->parentWidth;
		    rect.height = child->parentHeight;
................................................................................
     * Subtract one rectangle for each mapped child from visRgn (a window
     * can't draw over its children)
     */
    if (_w->child != NULL) {
	Region rgn2 = SdlTkRgnPoolGet();

	for (child = _w->child; child != NULL; child = child->next) {
	    if ((child->atts.map_state != IsUnmapped) &&
		(child->clazz != InputOnly)) {
		rect.x = _w->atts.x + child->atts.x;
		rect.y = _w->atts.y + child->atts.y;
		rect.width = child->parentWidth;
		rect.height = child->parentHeight;
		XUnionRectWithRegion(&rect, rgn2, rgn2);
	    }
	}