Fix some more dubious uses of globalconf.L

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2014-12-06 11:07:20 +01:00
parent 4cfea189f0
commit d668268591
5 changed files with 12 additions and 12 deletions

10
dbus.c
View File

@ -259,7 +259,7 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter)
{ {
/* i is the type name, i+1 the value */ /* i is the type name, i+1 the value */
size_t len; size_t len;
const char *type = lua_tolstring(globalconf.L, idx, &len); const char *type = lua_tolstring(L, idx, &len);
if(!type || len < 1) if(!type || len < 1)
return false; return false;
@ -277,7 +277,7 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter)
if(arraylen % 2 != 0) if(arraylen % 2 != 0)
{ {
luaA_warn(globalconf.L, luaA_warn(L,
"your D-Bus signal handling method returned wrong number of arguments"); "your D-Bus signal handling method returned wrong number of arguments");
return false; return false;
} }
@ -302,14 +302,14 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter)
break; break;
case DBUS_TYPE_BOOLEAN: case DBUS_TYPE_BOOLEAN:
{ {
dbus_bool_t b = lua_toboolean(globalconf.L, idx + 1); dbus_bool_t b = lua_toboolean(L, idx + 1);
dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &b); dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &b);
} }
break; break;
#define DBUS_MSG_RETURN_HANDLE_TYPE_STRING(dbustype) \ #define DBUS_MSG_RETURN_HANDLE_TYPE_STRING(dbustype) \
case dbustype: \ case dbustype: \
{ \ { \
const char *s = lua_tostring(globalconf.L, idx + 1); \ const char *s = lua_tostring(L, idx + 1); \
if(s) \ if(s) \
dbus_message_iter_append_basic(iter, dbustype, &s); \ dbus_message_iter_append_basic(iter, dbustype, &s); \
} \ } \
@ -320,7 +320,7 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter)
#define DBUS_MSG_RETURN_HANDLE_TYPE_NUMBER(type, dbustype) \ #define DBUS_MSG_RETURN_HANDLE_TYPE_NUMBER(type, dbustype) \
case dbustype: \ case dbustype: \
{ \ { \
type num = lua_tonumber(globalconf.L, idx + 1); \ type num = lua_tonumber(L, idx + 1); \
dbus_message_iter_append_basic(iter, dbustype, &num); \ dbus_message_iter_append_basic(iter, dbustype, &num); \
} \ } \
break; break;

View File

@ -234,7 +234,7 @@ luaA_mouse_object_under_pointer(lua_State *L)
return luaA_object_push(L, drawin); return luaA_object_push(L, drawin);
if((client = client_getbyframewin(child))) if((client = client_getbyframewin(child)))
return luaA_object_push(globalconf.L, client); return luaA_object_push(L, client);
return 0; return 0;
} }

View File

@ -378,7 +378,7 @@ client_focus_refresh(void)
} }
static void static void
client_update_properties(client_t *c) client_update_properties(lua_State *L, int cidx, client_t *c)
{ {
/* get all hints */ /* get all hints */
xcb_get_property_cookie_t wm_normal_hints = property_get_wm_normal_hints(c); xcb_get_property_cookie_t wm_normal_hints = property_get_wm_normal_hints(c);
@ -415,7 +415,7 @@ client_update_properties(client_t *c)
property_update_net_wm_icon_name(c, net_wm_icon_name); property_update_net_wm_icon_name(c, net_wm_icon_name);
property_update_wm_class(c, wm_class); property_update_wm_class(c, wm_class);
property_update_wm_protocols(c, wm_protocols); property_update_wm_protocols(c, wm_protocols);
window_set_opacity(globalconf.L, -1, xwindow_get_opacity_from_cookie(opacity)); window_set_opacity(L, cidx, xwindow_get_opacity_from_cookie(opacity));
} }
/** Manage a new client. /** Manage a new client.
@ -536,7 +536,7 @@ HANDLE_GEOM(height)
luaA_object_emit_signal(globalconf.L, -1, "property::size_hints_honor", 0); luaA_object_emit_signal(globalconf.L, -1, "property::size_hints_honor", 0);
/* update all properties */ /* update all properties */
client_update_properties(c); client_update_properties(globalconf.L, -1, c);
/* Then check clients hints */ /* Then check clients hints */
ewmh_client_check_hints(c); ewmh_client_check_hints(c);

View File

@ -292,7 +292,7 @@ luaA_window_set_type(lua_State *L, window_t *w)
w->type = type; w->type = type;
if(w->window != XCB_WINDOW_NONE) if(w->window != XCB_WINDOW_NONE)
ewmh_update_window_type(w->window, window_translate_type(w->type)); ewmh_update_window_type(w->window, window_translate_type(w->type));
luaA_object_emit_signal(globalconf.L, -3, "property::type", 0); luaA_object_emit_signal(L, -3, "property::type", 0);
} }
return 0; return 0;

4
root.c
View File

@ -223,7 +223,7 @@ luaA_root_keys(lua_State *L)
luaA_checktable(L, 1); luaA_checktable(L, 1);
foreach(key, globalconf.keys) foreach(key, globalconf.keys)
luaA_object_unref(globalconf.L, *key); luaA_object_unref(L, *key);
key_array_wipe(&globalconf.keys); key_array_wipe(&globalconf.keys);
key_array_init(&globalconf.keys); key_array_init(&globalconf.keys);
@ -265,7 +265,7 @@ luaA_root_buttons(lua_State *L)
luaA_checktable(L, 1); luaA_checktable(L, 1);
foreach(button, globalconf.buttons) foreach(button, globalconf.buttons)
luaA_object_unref(globalconf.L, *button); luaA_object_unref(L, *button);
button_array_wipe(&globalconf.buttons); button_array_wipe(&globalconf.buttons);
button_array_init(&globalconf.buttons); button_array_init(&globalconf.buttons);