From: Kai J. <b1...@fr...> - 2009-07-06 03:01:01
|
Florian Tobias Schandinat wrote: > Ville Syrjälä schrieb: >>> So here we have to check the whether the x/yoffset is smaller than >>> zero. If the offset is smaller than zero, in the driver, we should >>> not move the virtual screen any more. >> >> Checking for overflow will catch you buggy application's negative >> values too. > > That's true, but the problem lies in the current implementation first > adding the resolution, which results in small negative [0 to > -resolution] values (=large positives) being accepted as they overflow > during add and become small positive values. > I'd recommend changing > > var->yoffset + yres > info->var.yres_virtual || > var->xoffset + info->var.xres > info->var.xres_virtual > > to > > var->yoffset > info->var.yres_virtual - yres || > var->xoffset > info->var.xres_virtual - info->var.xres > I am not sure why do we have these change. Could you give a detail description or an example? Thanks! Best Regards, Kai Jiang |