mouse: fix coords() set

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-20 16:25:45 +02:00
parent a651388da0
commit af49f6f8f1
1 changed files with 4 additions and 4 deletions

View File

@ -1171,17 +1171,17 @@ luaA_mouse_coords(lua_State *L)
uint16_t mask;
int screen, x, y, mouse_x, mouse_y, i = 0;
if(lua_gettop(L) == 2)
if(lua_gettop(L) == 1)
{
xcb_window_t root;
luaA_checktable(L, 3);
luaA_checktable(L, 1);
if(!mouse_query_pointer_root(&screen, &mouse_x, &mouse_y, &mask))
return 0;
x = luaA_getopt_number(L, 3, "x", mouse_x);
y = luaA_getopt_number(L, 3, "y", mouse_y);
x = luaA_getopt_number(L, 1, "x", mouse_x);
y = luaA_getopt_number(L, 1, "y", mouse_y);
root = xutil_screen_get(globalconf.connection, screen)->root;
mouse_warp_pointer(root, x, y);