Sometimes, the boxcx value is something really large, like 32691. This makes XCopyArea fail with Xvnc. If boxcx is this large, reset to g_width - boxx. (The reason why boxcx is strange is that os->boxright is strange. I have no idea what's causing this, though.)