diff --git a/lib/awful/permissions/_common.lua b/lib/awful/permissions/_common.lua index 368c95da..718d9028 100644 --- a/lib/awful/permissions/_common.lua +++ b/lib/awful/permissions/_common.lua @@ -20,10 +20,6 @@ local default_permissions = { } function module.check(object, class, request, context) - if not default_permissions[class] then return true end - if not default_permissions[class][request] then return true end - if default_permissions[class][request][context] == nil then return true end - local ret = nil if object._private.permissions and object._private.permissions[request] then @@ -32,6 +28,10 @@ function module.check(object, class, request, context) if ret ~= nil then return ret end + if not default_permissions[class] then return true end + if not default_permissions[class][request] then return true end + if default_permissions[class][request][context] == nil then return true end + return default_permissions[class][request][context] end diff --git a/spec/awful/permissions_spec.lua b/spec/awful/permissions_spec.lua index f02fde36..c35375cc 100644 --- a/spec/awful/permissions_spec.lua +++ b/spec/awful/permissions_spec.lua @@ -26,7 +26,7 @@ describe("awful.permissions.client_geometry_requests", function() local permissions = require("awful.permissions") it("removes x/y/width/height when immobilized", function() - local c = {} + local c = {_private={}} local s = stub.new(c, "geometry") permissions.client_geometry_requests(c, "ewmh", {})