diff --git a/Makefile b/Makefile index 16327a47..6cfeaa67 100644 --- a/Makefile +++ b/Makefile @@ -44,4 +44,4 @@ distclean: $(MAKE) -C ${builddir} $@ $(and $(filter clean,$@),$(RM) $(BUILDLN) $(TARGETS)) -.PHONY: cmake-build cmake install distclean $(BUILDLN) +.PHONY: cmake-build cmake install distclean $(BUILDLN) tags diff --git a/awesomerc.lua b/awesomerc.lua index 9b8ee01c..e1f1831d 100755 --- a/awesomerc.lua +++ b/awesomerc.lua @@ -395,13 +395,13 @@ client.connect_signal("manage", function (c) -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) - -- Put windows in a smart way, only if they does not set an initial position. + -- Put windows in a smart way, only if they do not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end elseif not c.size_hints.user_position and not c.size_hints.program_position then - -- Prevent clients from being unreachable after screen count change + -- Prevent clients from being unreachable after screen count changes. awful.placement.no_offscreen(c) end diff --git a/common/lualib.h b/common/lualib.h index af439601..513eef88 100644 --- a/common/lualib.h +++ b/common/lualib.h @@ -26,7 +26,7 @@ #include "common/util.h" -/** Lua function to call on dofuction() error */ +/** Lua function to call on dofunction() error */ lua_CFunction lualib_dofunction_on_error; void luaA_checkfunction(lua_State *, int); diff --git a/docs/02-contributing.md b/docs/02-contributing.md index 4043faa6..e0add404 100644 --- a/docs/02-contributing.md +++ b/docs/02-contributing.md @@ -14,26 +14,31 @@ Imitate the existing code style. For concrete rules: - Use 4 spaces indentation, do not use tabulator characters; - Place braces alone on new lines, and do not place braces for single - line statement where it is not needed, i.e. no: + line statement where it is not needed, i.e.: - if(bla) { + if(foo) x = 1; + + if(foo) + { + x = 1; + bar(); } - Do not put a space after if, for, while or function call statements; - - The preferred line length is 80 characters; + - The preferred maximum line length is 80 characters; - Use `/* */` for comments; - - Use the API: there's a list of `a_*()` functions you should use instead + - Use the API: there is a list of `a_*()` functions you should use instead of the standard libc ones. There is also a common API for linked lists, tabulars, etc.; - Be *clear* in what you do; - - Prefix your function name with the module they are enhancing, - i.e. if you add a function to manipulate a tag prefix it with `tag_`; + - Prefix your function names with the module they are enhancing, + i.e. if you add a function to manipulate a tag, prefix it with `tag_`; - Write documentation for any new functions, options, whatever. diff --git a/keygrabber.c b/keygrabber.c index 3cb361d1..b57972ba 100644 --- a/keygrabber.c +++ b/keygrabber.c @@ -75,7 +75,7 @@ is_control(char *buf) /** Handle keypress event. * \param L Lua stack to push the key pressed. * \param e Received XKeyEvent. - * \return True if a key was successfully get, false otherwise. + * \return True if a key was successfully retrieved, false otherwise. */ bool keygrabber_handlekpress(lua_State *L, xcb_key_press_event_t *e) diff --git a/lib/awful/keygrabber.lua b/lib/awful/keygrabber.lua index aac8ab1e..02b63d5b 100644 --- a/lib/awful/keygrabber.lua +++ b/lib/awful/keygrabber.lua @@ -80,11 +80,11 @@ end -- end) -- end function keygrabber.run(g) - -- Remove the grabber if its in stack + -- Remove the grabber if it is in the stack. keygrabber.stop(g) - -- Record the grabber has latest added + -- Record the grabber that has been added most recently. table.insert(grabbers, 1, g) - -- start the keygrabber if its not running already + -- Start the keygrabber if it is not running already. if not keygrabbing then keygrabbing = true capi.keygrabber.run(grabber) diff --git a/lib/awful/rules.lua b/lib/awful/rules.lua index 6e57d793..7a1eb11f 100644 --- a/lib/awful/rules.lua +++ b/lib/awful/rules.lua @@ -214,8 +214,7 @@ function rules.execute(c, props, callbacks) end end - -- Do this at last so we do not erase things done by the focus - -- signal. + -- Do this at last so we do not erase things done by the focus signal. if props.focus and (type(props.focus) ~= "function" or props.focus(c)) then c:emit_signal('request::activate', "rules", {raise=true}) end diff --git a/objects/screen.c b/objects/screen.c index 1865e274..5f3af354 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -445,6 +445,8 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize) /* move / resize the client */ client_resize(c, new_geometry, false); + + /* emit signal */ luaA_object_push(L, c); if(old_screen_idx != 0) lua_pushinteger(L, old_screen_idx); @@ -452,6 +454,7 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize) lua_pushnil(L); luaA_object_emit_signal(L, -2, "property::screen", 1); lua_pop(L, 1); + if(had_focus) client_focus(c); } diff --git a/xrdb.c b/xrdb.c index f32693c7..974dee75 100644 --- a/xrdb.c +++ b/xrdb.c @@ -39,7 +39,7 @@ static void xrdb_init(void) { /**/ if (!(globalconf.xrmdb = XrmGetDatabase(globalconf.display))) - warn("Can't open xrdb\n"); + warn("Cannot open xrdb."); } } @@ -67,7 +67,10 @@ int luaA_xrdb_get_value(lua_State *L) { lua_pushstring(L, (char *)resource_value.addr); return 1; } else { - luaA_warn(L, "Failed to get xrdb value"); + if (strlen(resource_class)) + luaA_warn(L, "Failed to get xrdb value '%s' (class '%s').", resource_name, resource_class); + else + luaA_warn(L, "Failed to get xrdb value '%s'.", resource_name); return 0; } }