mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
screen: Add a function to get the client preferred screen
This commit is contained in:
parent
f02b73b0ee
commit
e8649d0a29
1 changed files with 11 additions and 1 deletions
|
@ -12,7 +12,8 @@ local capi =
|
||||||
{
|
{
|
||||||
mouse = mouse,
|
mouse = mouse,
|
||||||
screen = screen,
|
screen = screen,
|
||||||
client = client
|
client = client,
|
||||||
|
awesome = awesome,
|
||||||
}
|
}
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
local object = require("gears.object")
|
local object = require("gears.object")
|
||||||
|
@ -213,6 +214,15 @@ function screen.object.set_padding(self, padding)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Return the currently screen for new clients.
|
||||||
|
-- This is exactly the same as `awful.screen.focused` exept it avoids clients
|
||||||
|
-- being moved when Awesome is restarted. This is used by the default `rc.lua`.
|
||||||
|
-- @tparam client c A client
|
||||||
|
-- @treturn screen The preferred screen.
|
||||||
|
function screen.preferred(c)
|
||||||
|
return capi.awesome.startup and c.screen or screen.focused()
|
||||||
|
end
|
||||||
|
|
||||||
--- The defaults arguments for `awful.screen.focused`
|
--- The defaults arguments for `awful.screen.focused`
|
||||||
-- @tfield[opt=nil] table awful.screen.default_focused_args
|
-- @tfield[opt=nil] table awful.screen.default_focused_args
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue