From d668268591c9854184583fffe58b945f8a9398d9 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 6 Dec 2014 11:07:20 +0100 Subject: [PATCH] Fix some more dubious uses of globalconf.L Signed-off-by: Uli Schlachter --- dbus.c | 10 +++++----- mouse.c | 2 +- objects/client.c | 6 +++--- objects/window.c | 2 +- root.c | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dbus.c b/dbus.c index 5b65acb88..7ded3c680 100644 --- a/dbus.c +++ b/dbus.c @@ -259,7 +259,7 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter) { /* i is the type name, i+1 the value */ size_t len; - const char *type = lua_tolstring(globalconf.L, idx, &len); + const char *type = lua_tolstring(L, idx, &len); if(!type || len < 1) return false; @@ -277,7 +277,7 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter) if(arraylen % 2 != 0) { - luaA_warn(globalconf.L, + luaA_warn(L, "your D-Bus signal handling method returned wrong number of arguments"); return false; } @@ -302,14 +302,14 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter) break; 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); } break; #define DBUS_MSG_RETURN_HANDLE_TYPE_STRING(dbustype) \ case dbustype: \ { \ - const char *s = lua_tostring(globalconf.L, idx + 1); \ + const char *s = lua_tostring(L, idx + 1); \ if(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) \ 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); \ } \ break; diff --git a/mouse.c b/mouse.c index f0f1cbbb5..056566e92 100644 --- a/mouse.c +++ b/mouse.c @@ -234,7 +234,7 @@ luaA_mouse_object_under_pointer(lua_State *L) return luaA_object_push(L, drawin); if((client = client_getbyframewin(child))) - return luaA_object_push(globalconf.L, client); + return luaA_object_push(L, client); return 0; } diff --git a/objects/client.c b/objects/client.c index 924d46308..54b52873d 100644 --- a/objects/client.c +++ b/objects/client.c @@ -378,7 +378,7 @@ client_focus_refresh(void) } static void -client_update_properties(client_t *c) +client_update_properties(lua_State *L, int cidx, client_t *c) { /* get all hints */ 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_wm_class(c, wm_class); 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. @@ -536,7 +536,7 @@ HANDLE_GEOM(height) luaA_object_emit_signal(globalconf.L, -1, "property::size_hints_honor", 0); /* update all properties */ - client_update_properties(c); + client_update_properties(globalconf.L, -1, c); /* Then check clients hints */ ewmh_client_check_hints(c); diff --git a/objects/window.c b/objects/window.c index f974ed4d8..d7d1cbe3b 100644 --- a/objects/window.c +++ b/objects/window.c @@ -292,7 +292,7 @@ luaA_window_set_type(lua_State *L, window_t *w) w->type = type; if(w->window != XCB_WINDOW_NONE) 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; diff --git a/root.c b/root.c index 9e6fde54c..2ffaee264 100644 --- a/root.c +++ b/root.c @@ -223,7 +223,7 @@ luaA_root_keys(lua_State *L) luaA_checktable(L, 1); foreach(key, globalconf.keys) - luaA_object_unref(globalconf.L, *key); + luaA_object_unref(L, *key); key_array_wipe(&globalconf.keys); key_array_init(&globalconf.keys); @@ -265,7 +265,7 @@ luaA_root_buttons(lua_State *L) luaA_checktable(L, 1); foreach(button, globalconf.buttons) - luaA_object_unref(globalconf.L, *button); + luaA_object_unref(L, *button); button_array_wipe(&globalconf.buttons); button_array_init(&globalconf.buttons);