diff --git a/docs/89-NEWS.md b/docs/89-NEWS.md index 2e027f36f..18d315cb1 100644 --- a/docs/89-NEWS.md +++ b/docs/89-NEWS.md @@ -74,6 +74,8 @@ This document was last updated at commit v4.3-197-g9085ed631. * Setting `awful.rules.rules` now append the rules to the existing set. Clearing the rules was never officially supported. If you *really* want the old behavior, use `awful.rules.rules = {}; awful.rules.rules = my_new_rules`. + * `client:relative_move()` now default `nil` values to zero. The previous + behavior made no sense. # Awesome window manager framework version 4.3 changes diff --git a/lib/awful/client.lua b/lib/awful/client.lua index 16085ab49..8e665a7d7 100644 --- a/lib/awful/client.lua +++ b/lib/awful/client.lua @@ -523,16 +523,16 @@ end -- -- @method relative_move -- @see geometry --- @tparam[opt=c.x] number x The relative x coordinate. --- @tparam[opt=c.y] number y The relative y coordinate. --- @tparam[opt=c.width] number w The relative width. --- @tparam[opt=c.height] number h The relative height. +-- @tparam[opt=0] number x The relative x coordinate. +-- @tparam[opt=0] number y The relative y coordinate. +-- @tparam[opt=0] number w The relative width. +-- @tparam[opt=0] number h The relative height. function client.object.relative_move(self, x, y, w, h) local geometry = self:geometry() - geometry['x'] = geometry['x'] + (x or geometry.x) - geometry['y'] = geometry['y'] + (y or geometry.y) - geometry['width'] = geometry['width'] + (w or geometry.width) - geometry['height'] = geometry['height'] + (h or geometry.height) + geometry['x'] = geometry['x'] + (x or 0) + geometry['y'] = geometry['y'] + (y or 0) + geometry['width'] = geometry['width'] + (w or 0) + geometry['height'] = geometry['height'] + (h or 0) self:geometry(geometry) end