Revert "client: Add c.blob property"
This reverts commit a54636751b
.
We now have the new xproperty API which does the same thing in a much nicer way.
Thanks to Elv13 for the idea!
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
62e2dee4ba
commit
1b21dce46c
|
@ -1,4 +1,3 @@
|
|||
AWESOME_NAQUADAH_BLOB
|
||||
_NET_SUPPORTED
|
||||
_NET_STARTUP_ID
|
||||
_NET_CLIENT_LIST
|
||||
|
|
|
@ -45,7 +45,6 @@ module("client")
|
|||
-- @field shape_clip The client's clip shape as set by awesome as a (native) cairo surface.
|
||||
-- @field shape_client_bounding The client's bounding shape as set by the program as a (native) cairo surface.
|
||||
-- @field shape_client_clip The client's clip shape as set by the program as a (native) cairo surface.
|
||||
-- @field blob A string containing data that will still be available after awesome restarts.
|
||||
-- @class table
|
||||
-- @name client
|
||||
|
||||
|
|
|
@ -431,10 +431,6 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, bool startup)
|
|||
return;
|
||||
}
|
||||
|
||||
xcb_get_property_cookie_t blob_q;
|
||||
blob_q = xcb_get_property(globalconf.connection, false, w, AWESOME_NAQUADAH_BLOB,
|
||||
XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
|
||||
|
||||
/* If this is a new client that just has been launched, then request its
|
||||
* startup id. */
|
||||
xcb_get_property_cookie_t startup_id_q = { 0 };
|
||||
|
@ -500,19 +496,6 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, bool startup)
|
|||
xcb_ungrab_server(globalconf.connection);
|
||||
}
|
||||
|
||||
{
|
||||
/* Request our response */
|
||||
xcb_get_property_reply_t *reply =
|
||||
xcb_get_property_reply(globalconf.connection, blob_q, NULL);
|
||||
|
||||
if (reply)
|
||||
{
|
||||
c->blob.length = xcb_get_property_value_length(reply);
|
||||
c->blob.data = p_dup((char *) xcb_get_property_value(reply), c->blob.length);
|
||||
}
|
||||
p_delete(&reply);
|
||||
}
|
||||
|
||||
/* Do this now so that we don't get any events for the above
|
||||
* (Else, reparent could cause an UnmapNotify) */
|
||||
xcb_change_window_attributes(globalconf.connection, w, XCB_CW_EVENT_MASK, select_input_val);
|
||||
|
@ -1784,13 +1767,6 @@ luaA_client_get_icon_name(lua_State *L, client_t *c)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
luaA_client_get_blob(lua_State *L, client_t *c)
|
||||
{
|
||||
lua_pushlstring(L, NONULL(c->blob.data), c->blob.length);
|
||||
return 1;
|
||||
}
|
||||
|
||||
LUA_OBJECT_EXPORT_PROPERTY(client, client_t, class, lua_pushstring)
|
||||
LUA_OBJECT_EXPORT_PROPERTY(client, client_t, instance, lua_pushstring)
|
||||
LUA_OBJECT_EXPORT_PROPERTY(client, client_t, machine, lua_pushstring)
|
||||
|
@ -2100,23 +2076,6 @@ luaA_client_set_shape_clip(lua_State *L, client_t *c)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/** Set the client's blob.
|
||||
* \param L The Lua VM state.
|
||||
* \param client The client object.
|
||||
* \return The number of elements pushed on stack.
|
||||
*/
|
||||
static int
|
||||
luaA_client_set_blob(lua_State *L, client_t *c)
|
||||
{
|
||||
const char *blob = luaL_checklstring(L, -1, &c->blob.length);
|
||||
|
||||
p_delete(&c->blob.data);
|
||||
c->blob.data = p_dup(blob, c->blob.length);
|
||||
xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, c->window,
|
||||
AWESOME_NAQUADAH_BLOB, AWESOME_NAQUADAH_BLOB, 8, c->blob.length, blob);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Get or set keys bindings for a client.
|
||||
* \param L The Lua VM state.
|
||||
* \return The number of element pushed on stack.
|
||||
|
@ -2351,10 +2310,6 @@ client_class_setup(lua_State *L)
|
|||
NULL,
|
||||
(lua_class_propfunc_t) luaA_client_get_client_shape_clip,
|
||||
NULL);
|
||||
luaA_class_add_property(&client_class, "blob",
|
||||
(lua_class_propfunc_t) luaA_client_set_blob,
|
||||
(lua_class_propfunc_t) luaA_client_get_blob,
|
||||
(lua_class_propfunc_t) luaA_client_set_blob);
|
||||
|
||||
signal_add(&client_class.signals, "focus");
|
||||
signal_add(&client_class.signals, "list");
|
||||
|
|
|
@ -124,11 +124,6 @@ struct client_t
|
|||
/** The drawable for this bar. */
|
||||
drawable_t *drawable;
|
||||
} titlebar[CLIENT_TITLEBAR_COUNT];
|
||||
/** The blob! */
|
||||
struct {
|
||||
char *data;
|
||||
size_t length;
|
||||
} blob;
|
||||
};
|
||||
|
||||
ARRAY_FUNCS(client_t *, client, DO_NOTHING)
|
||||
|
|
Loading…
Reference in New Issue