Conditionalize use of gdk_pointer_grab/ungrab().