~ubuntu-branches/ubuntu/saucy/xorg-server/saucy

« back to all changes in this revision

Viewing changes to dix/getevents.c

  • Committer: Package Import Robot
  • Author(s): Maarten Lankhorst
  • Date: 2013-07-16 09:36:06 UTC
  • mto: This revision was merged to the branch mainline in revision 277.
  • Revision ID: package-import@ubuntu.com-20130716093606-baxrj0qof9ev8f69
Tags: upstream-1.14.2
ImportĀ upstreamĀ versionĀ 1.14.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
277
277
            dce->valuators[i].mode = slave->valuator->axes[i].mode;
278
278
            dce->valuators[i].name = slave->valuator->axes[i].label;
279
279
            dce->valuators[i].scroll = slave->valuator->axes[i].scroll;
 
280
            dce->valuators[i].value = slave->valuator->axisVal[i];
280
281
        }
281
282
    }
282
283
    if (slave->key) {
297
298
 
298
299
    if (from && from->min_value < from->max_value) {
299
300
        fmin = from->min_value;
300
 
        fmax = from->max_value;
 
301
        fmax = from->max_value + 1;
301
302
    }
302
303
    if (to && to->min_value < to->max_value) {
303
304
        tmin = to->min_value;
304
 
        tmax = to->max_value;
 
305
        tmax = to->max_value + 1;
305
306
    }
306
307
 
307
308
    if (fmin == tmin && fmax == tmax)
913
914
 
914
915
    /* scale x&y to desktop coordinates */
915
916
    *screenx = rescaleValuatorAxis(x, dev->valuator->axes + 0, NULL,
916
 
                                   screenInfo.x, screenInfo.width - 1);
 
917
                                   screenInfo.x, screenInfo.width);
917
918
    *screeny = rescaleValuatorAxis(y, dev->valuator->axes + 1, NULL,
918
 
                                   screenInfo.y, screenInfo.height - 1);
 
919
                                   screenInfo.y, screenInfo.height);
919
920
 
920
921
    *devx = x;
921
922
    *devy = y;
1355
1356
 * is the last coordinate on the first screen and must be rescaled for the
1356
1357
 * event to be m. XI2 clients that do their own coordinate mapping would
1357
1358
 * otherwise interpret the position of the device elsewere to the cursor.
 
1359
 * However, this scaling leads to losses:
 
1360
 * if we have two ScreenRecs we scale from e.g. [0..44704]  (Wacom I4) to
 
1361
 * [0..2048[. that gives us 2047.954 as desktop coord, or the per-screen
 
1362
 * coordinate 1023.954. Scaling that back into the device coordinate range
 
1363
 * gives us 44703. So off by one device unit. It's a bug, but we'll have to
 
1364
 * live with it because with all this scaling, we just cannot win.
1358
1365
 *
1359
1366
 * @return the number of events written into events.
1360
1367
 */