Mouse troubles

I apologize in advance if this becomes a double post, but my original
message never got posted.

To handle mouse input in my game I have this code inside my event
handler:

case SDL_MOUSEMOTION:
	if(!ignore) {
		mov_mouse_x += event.motion.xrel;
		mov_mouse_y += event.motion.yrel;
		mov_mouse_z = 0;
		SDL_WarpMouse(thegame->options.GetWidth()/2,

thegame->options.GetWidth()/2);
ignore = true;
}
else ignore = false;
break;
case SDL_MOUSEBUTTONDOWN:
if(event.button.button == SDL_BUTTON_LEFT)
buttons[0] = true;
else buttons[1] = true;
break;
case SDL_MOUSEBUTTONUP:
if(event.button.button == SDL_BUTTON_LEFT)
buttons[0] = false;
else buttons[1] = false;
break;

The problem is that when the mouse is moving, and I press a button, it
starts flickering, like the button is being pressed on and off. The
code works as expected if the mouse wasn’t moving while button was
pressed. Any ideas?

Thanks,
Andrew