How to grab and hide cursor using gtkmm?
===

I'm trying to write an application using gtkmm, and I want it to hide the mouse cursor when it has focus. So the first step I tried is I hide mouse cursor when the cursor is on top of my window, which is successful. But to prevent the mouse from showing when it is moved outside of my window, I then restrict the mouse movement by constantly warp the mouse cursor back to the center of my drawing area.

To do this I need to know the window position and the size of the window, which are easy to get using Gdk::Window::get_position and Gdk::Window::get_size. However, if the window is moved, get_position will not return the updated position and thus my cursor will to frozen at a wrong position!

So what are the alternatives to achieve the effect that I want here?