> I don't think abs(...)%nOutputDev is the proper way to handle it. We want "-1"
> to represent the last display, i.e. display #4 on a 5-monitor system. By abs-
> ing it, we'll get 1 % 5 = 1, which will move the window to the second display
> (#1) instead.
Actually, you're right, usage of abs is probably the wrong way to go here. Testing that the value is negative and then adding the quotient is the right way to handle it:
> I don't think abs(...)%nOutputDev is the proper way to handle it. We want "-1"
> to represent the last display, i.e. display #4 on a 5-monitor system. By abs-
> ing it, we'll get 1 % 5 = 1, which will move the window to the second display
> (#1) instead.
Actually, you're right, usage of abs is probably the wrong way to go here. Testing that the value is negative and then adding the quotient is the right way to handle it:
outputNum = (currentNum - 1) % nOutputDev;
if (outputNum < 0)
outputNum += nOutputDev;