- get_screen_viewport (si->default_screen, &sx, &sy, &w, &h, False);
+ int mouse_x = 0, mouse_y = 0;
+
+ {
+ Window pointer_root, pointer_child;
+ int root_x, root_y, win_x, win_y;
+ unsigned int mask;
+ if (XQueryPointer (si->dpy,
+ RootWindowOfScreen (ssi->screen),
+ &pointer_root, &pointer_child,
+ &root_x, &root_y, &win_x, &win_y, &mask))
+ {
+ mouse_x = root_x;
+ mouse_y = root_y;
+ }
+ }
+
+ get_screen_viewport (ssi, &sx, &sy, &w, &h, mouse_x, mouse_y, False);