naughty: Add a way to revert to the legacy mode.

When `rc.lua` will use the new notification API by default, we need
a way to revert back to the lagacy mode to be able to test it.
This commit is contained in:
Emmanuel Lepage Vallee 2019-12-16 00:05:21 -05:00
parent 9ec11bf1b3
commit 21caa19a21
2 changed files with 7 additions and 0 deletions

View File

@ -415,6 +415,10 @@ function naughty.get__has_preset_handler()
return conns["request::preset"] and #conns["request::preset"] > 0 or false
end
function naughty._reset_display_handlers()
conns["request::display"] = nil
end
--- Set new notification timeout.
--
-- This function is deprecated, use `notification:reset_timeout(new_timeout)`.

View File

@ -11,6 +11,9 @@ local GLib = require("lgi" ).GLib
local gpcall = require("gears.protected_call")
local dwidget = require("naughty.widget._default")
-- Bypass the new rc.lua and force the legacy mode again.
naughty._reset_display_handlers()
-- This module test deprecated APIs
require("gears.debug").deprecate = function() end