Check-in [f8ece92270]
Not logged in

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

Overview
Comment:merge with trunk
Timelines: family | ancestors | descendants | both | wtf-8-experiment
Files: files | file ages | folders
SHA1: f8ece922700c5cd32aa394cbfb3a94a42cc600e1
User & Date: chw 2019-02-05 19:55:02
Context
2019-02-07
05:47
merge with trunk check-in: 87872be448 user: chw tags: wtf-8-experiment
2019-02-05
19:55
merge with trunk check-in: f8ece92270 user: chw tags: wtf-8-experiment
19:54
fix wrong overscan computations in SDL evdev driver check-in: 905ac8c5df user: chw tags: trunk
17:38
merge with trunk check-in: d24f465eb3 user: chw tags: wtf-8-experiment
Changes

Changes to jni/SDL2/src/core/linux/SDL_evdev.c.

452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
...
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
...
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
                            abs_x = median5_add(&item->raw_x, events[i].value);
                            abs_x = iir_filter(&item->filt_x, abs_x, 0);
                        }

                        if (item->range_x != 0) {
                            SDL_GetWindowSize(mouse->focus, &w, &h);
                            norm_x = (float)(abs_x - item->min_x) / (float)item->range_x;
                            abs_x = (w + mouse->add_w) * norm_x - mouse->off_x;
                            if (abs_x < 0) {
                                abs_x = 0;
                            } else if (abs_x >= w) {
                                abs_x = w - 1;
                            }
                            item->norm_x = norm_x;
                            if (item->norm_x < 0.0) {
                                item->norm_x = 0.0;
                            } else if (item->norm_x > 1.0) {
                                item->norm_x = 1.0;
                            }
                            flags |= EVDEV_FLAG_XY;
                            mouseID = SDL_TOUCH_MOUSEID;
                        } else {
                            mouseID = mouse->mouseID;
                        }
                        SDL_SendMouseMotion(mouse->focus, mouseID, SDL_FALSE, abs_x, mouse->y);
                        break;
                    case ABS_Y:
                        if (item->is_touchscreen && (flags & EVDEV_FLAG_MT)) /* FIXME: temp hack */
                            break;
                        if (item->swap_xy)
                            goto do_abs_x;
                    do_abs_y:
................................................................................
                            abs_y = median5_add(&item->raw_y, events[i].value);
                            abs_y = iir_filter(&item->filt_y, abs_y, 0);
                        }

                        if (item->range_y != 0) {
                            SDL_GetWindowSize(mouse->focus, &w, &h);
                            norm_y = (float)(abs_y - item->min_y) / (float)item->range_y;
                            abs_y = (h + mouse->add_h) * norm_y - mouse->off_y;
                            if (abs_y < 0) {
                                abs_y = 0;
                            } else if (abs_y >= h) {
                                abs_y = h - 1;
                            }
                            item->norm_y = norm_y;
                            if (item->norm_y < 0.0) {
                                item->norm_y = 0.0;
                            } else if (item->norm_y > 1.0) {
                                item->norm_y = 1.0;
                            }
                            flags |= EVDEV_FLAG_XY;
                            mouseID = SDL_TOUCH_MOUSEID;
                        } else {
                            mouseID = mouse->mouseID;
                        }
                        SDL_SendMouseMotion(mouse->focus, mouseID, SDL_FALSE, mouse->x, abs_y);
                        break;
                    default:
                        break;
                    }
                    break;
                case EV_REL:
                    switch(events[i].code) {
................................................................................
                             * mouse window size ... and hope for the best.
                             */
                            switch(item->touchscreen_data->slots[j].delta) {
                            case EVDEV_TOUCH_SLOTDELTA_DOWN:
                            case EVDEV_TOUCH_SLOTDELTA_MOVE:
                                SDL_GetWindowSize(mouse->focus, &w, &h);
                                if (item->touchscreen_data->range_x > w + mouse->add_w) {
                                    abs_x = (w + mouse->add_w) * norm_x - mouse->off_x;
                                    if (abs_x < 0) {
                                        abs_x = 0;
                                    } else if (abs_x >= w) {
                                        abs_x = w - 1;
                                    }
                                }
                                if (item->touchscreen_data->range_x > h + mouse->add_h) {
                                    abs_y = (h + mouse->add_h) * norm_y - mouse->off_y;
                                    if (abs_y < 0) {
                                        abs_y = 0;
                                    } else if (abs_y >= h) {
                                        abs_y = h - 1;
                                    }
                                }
                                break;
                            default:
                                break;
                            }








|
|
|
|
|












|







 







|
|
|
|
|












|







 







|
|
|
|
|



|
|
|
|
|







452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
...
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
...
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
                            abs_x = median5_add(&item->raw_x, events[i].value);
                            abs_x = iir_filter(&item->filt_x, abs_x, 0);
                        }

                        if (item->range_x != 0) {
                            SDL_GetWindowSize(mouse->focus, &w, &h);
                            norm_x = (float)(abs_x - item->min_x) / (float)item->range_x;
                            abs_x = (w + mouse->add_w) * norm_x;
                            if (abs_x < mouse->off_x) {
                                abs_x = mouse->off_x;
                            } else if (abs_x >= w + mouse->off_x) {
                                abs_x = w - 1 + mouse->off_x;
                            }
                            item->norm_x = norm_x;
                            if (item->norm_x < 0.0) {
                                item->norm_x = 0.0;
                            } else if (item->norm_x > 1.0) {
                                item->norm_x = 1.0;
                            }
                            flags |= EVDEV_FLAG_XY;
                            mouseID = SDL_TOUCH_MOUSEID;
                        } else {
                            mouseID = mouse->mouseID;
                        }
                        SDL_SendMouseMotion(mouse->focus, mouseID, SDL_FALSE, abs_x, mouse->y + mouse->off_y);
                        break;
                    case ABS_Y:
                        if (item->is_touchscreen && (flags & EVDEV_FLAG_MT)) /* FIXME: temp hack */
                            break;
                        if (item->swap_xy)
                            goto do_abs_x;
                    do_abs_y:
................................................................................
                            abs_y = median5_add(&item->raw_y, events[i].value);
                            abs_y = iir_filter(&item->filt_y, abs_y, 0);
                        }

                        if (item->range_y != 0) {
                            SDL_GetWindowSize(mouse->focus, &w, &h);
                            norm_y = (float)(abs_y - item->min_y) / (float)item->range_y;
                            abs_y = (h + mouse->add_h) * norm_y;
                            if (abs_y < mouse->off_y) {
                                abs_y = mouse->off_y;
                            } else if (abs_y >= h + mouse->off_y) {
                                abs_y = h - 1 + mouse->off_y;
                            }
                            item->norm_y = norm_y;
                            if (item->norm_y < 0.0) {
                                item->norm_y = 0.0;
                            } else if (item->norm_y > 1.0) {
                                item->norm_y = 1.0;
                            }
                            flags |= EVDEV_FLAG_XY;
                            mouseID = SDL_TOUCH_MOUSEID;
                        } else {
                            mouseID = mouse->mouseID;
                        }
                        SDL_SendMouseMotion(mouse->focus, mouseID, SDL_FALSE, mouse->x + mouse->off_x, abs_y);
                        break;
                    default:
                        break;
                    }
                    break;
                case EV_REL:
                    switch(events[i].code) {
................................................................................
                             * mouse window size ... and hope for the best.
                             */
                            switch(item->touchscreen_data->slots[j].delta) {
                            case EVDEV_TOUCH_SLOTDELTA_DOWN:
                            case EVDEV_TOUCH_SLOTDELTA_MOVE:
                                SDL_GetWindowSize(mouse->focus, &w, &h);
                                if (item->touchscreen_data->range_x > w + mouse->add_w) {
                                    abs_x = (w + mouse->add_w) * norm_x;
                                    if (abs_x < mouse->off_x) {
                                        abs_x = mouse->off_x;
                                    } else if (abs_x >= w + mouse->off_x) {
                                        abs_x = w - 1 + mouse->off_x;
                                    }
                                }
                                if (item->touchscreen_data->range_x > h + mouse->add_h) {
                                    abs_y = (h + mouse->add_h) * norm_y;
                                    if (abs_y < mouse->off_y) {
                                        abs_y = mouse->off_y;
                                    } else if (abs_y >= h + mouse->off_y) {
                                        abs_y = h - 1 + mouse->off_y;
                                    }
                                }
                                break;
                            default:
                                break;
                            }