diff --git a/mouse.c b/mouse.c index 78557dfd..5c80b17b 100644 --- a/mouse.c +++ b/mouse.c @@ -30,6 +30,7 @@ */ #include "mouse.h" +#include "math.h" #include "common/util.h" #include "common/xutil.h" #include "globalconf.h" @@ -224,8 +225,8 @@ luaA_mouse_coords(lua_State *L) if(!mouse_query_pointer_root(&mouse_x, &mouse_y, NULL, &mask)) return 0; - x = luaA_getopt_integer_range(L, 1, "x", mouse_x, MIN_X11_COORDINATE, MAX_X11_COORDINATE); - y = luaA_getopt_integer_range(L, 1, "y", mouse_y, MIN_X11_COORDINATE, MAX_X11_COORDINATE); + x = round(luaA_getopt_number_range(L, 1, "x", mouse_x, MIN_X11_COORDINATE, MAX_X11_COORDINATE)); + y = round(luaA_getopt_number_range(L, 1, "y", mouse_y, MIN_X11_COORDINATE, MAX_X11_COORDINATE)); if(ignore_enter_notify) client_ignore_enterleave_events();