drawin: Remove some dead code
Thanks to a recent commit, a drawin's window will always be a valid and existing window. This means we can remove all the code which checks this before doing something. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
61fde273ca
commit
4e31c72497
|
@ -176,8 +176,6 @@ static void
|
|||
drawin_moveresize(lua_State *L, int udx, area_t geometry)
|
||||
{
|
||||
drawin_t *w = luaA_checkudata(L, udx, &drawin_class);
|
||||
if(w->window)
|
||||
{
|
||||
int number_of_vals = 0;
|
||||
uint32_t moveresize_win_vals[4], mask_vals = 0;
|
||||
|
||||
|
@ -229,21 +227,6 @@ drawin_moveresize(lua_State *L, int udx, area_t geometry)
|
|||
if(mask_vals & XCB_CONFIG_WINDOW_HEIGHT)
|
||||
luaA_object_emit_signal(L, udx, "property::height", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
#define DO_DRAWIN_GEOMETRY_CHECK_AND_EMIT(prop) \
|
||||
if(w->geometry.prop != geometry.prop) \
|
||||
{ \
|
||||
w->geometry.prop = geometry.prop; \
|
||||
luaA_object_emit_signal(L, udx, "property::" #prop, 0); \
|
||||
}
|
||||
DO_DRAWIN_GEOMETRY_CHECK_AND_EMIT(x)
|
||||
DO_DRAWIN_GEOMETRY_CHECK_AND_EMIT(y)
|
||||
DO_DRAWIN_GEOMETRY_CHECK_AND_EMIT(width)
|
||||
DO_DRAWIN_GEOMETRY_CHECK_AND_EMIT(height)
|
||||
#undef DO_DRAWIN_GEOMETRY_CHECK_AND_EMIT
|
||||
}
|
||||
}
|
||||
|
||||
/** Refresh the window content by copying its pixmap data to its window.
|
||||
* \param drawin The drawin to refresh.
|
||||
|
@ -481,7 +464,6 @@ luaA_drawin_set_bg_color(lua_State *L, drawin_t *drawin)
|
|||
if(color_name &&
|
||||
color_init_reply(color_init_unchecked(&drawin->bg_color, color_name, len)))
|
||||
{
|
||||
if (drawin->window != XCB_NONE)
|
||||
xcb_change_window_attributes(globalconf.connection, drawin->window,
|
||||
XCB_CW_BACK_PIXEL, &drawin->bg_color.pixel);
|
||||
luaA_object_emit_signal(L, -3, "property::bg_color", 0);
|
||||
|
|
Loading…
Reference in New Issue