This caused a behavior change it wasn't clear how to use the
permission API to change the focus mode.
The change will only take effect if the user override the API
level.
This also pulls in part of the permission framework to ensure
backward compatibility is kept.
`awful.autofocus` was always weird. It is a module part of `awful`,
but it was never part of `awful` `init.lua`. Rather, `rc.lua` was
the sole place it was used. It behave exactly like a request, but
predate them by years. As I cleanup the request:: API before the
permissions API gets formalized, this has to be fixed now.
It isn't deprecated in this commit because it makes too many tests
fail. Another pull request will solve that by adding the "API level"
concept to AwesomeWM so I can change the behavior without breaking
existing configs. With that, the behavior of `autofocus` will be
enabled by default with the permissions to disable it.
They currently fit the general concept of a `request::` in the sense
that they are not property related and have "request handlers".
The commit also add deprecation for signals.
The reason for this fits within the larger standardization project.
Non-namespaced signals will eventually be renamed. This has started
a long time ago.
What is old is new again. Once upon a time, there was a `startup`
parameter to the `manage` signal. It is now back in the form of
a context.
Finally, this commit removes the `manage` section of `rc.lua`. It no
longer did anything worthy of being in the config. Each of its
important parts have been moved out over the years and the last
remaining bit is always required anyway. The code has been moved
to `client.lua`.
This doesn't mean removing all screens is supported. It isn't and never
will be. The only reason this commit exist is to allow some
initialization and error handling code to be tested.
A relatively common problem with awesome is with mixing sticky clients
and the focus history. Once a sticky client ever had the focus, it will
always get the focus after a tag switch. This is because the focus
history is global and the sticky client is always the most recently
focused and currently visible client in the list.
Work around this by discriminating sticky clients: First try to find a
client to focus, but ignore sticky clients. When this does not find
anything, try again, but this time also consider sticky clients.
(Basically the same issue exists with clients that are on multiple tags,
but I guess that one can be ignored.)
Fixes: https://github.com/awesomeWM/awesome/issues/733
Signed-off-by: Uli Schlachter <psychon@znc.in>
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This code uses delayed calls to lazily update things. Thanks to this, it can try
to update a screen long after it was removed. Fix this by just doing nothing on
invalid screens.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Because all our Lua code can now work with screen objects, most of the uses of
s.index that the previous patches added for reaching this goal can be removed
again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commits makes a random selection of modules in awful support screen objects
and accept them as parameters everywhere where a screen index is accepted.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In #152 I've changed the autofocus handler to emit the request::activate
signal, instead of setting client.focus only.
This is wrong IMHO, and can be annoying:
If you have two floating clients above a tiled / maximized one, and
close one of the floating ones, with the tiled one being the one
selected by autofocus, it will be raised above the other floating
client.
This is changed now to use the new `request::focus` signal instead.
This basically reverts 20cdb5d (#152), but allows for customizing this
behavior, by overriding the default `request::focus` handler
(`ewmh.focus`).
It would be nice if there was a helper to check if a window's content
isn't visible at all (i.e. covered by other windows), and that could be
used then by the (new) default handler for request::focus - raising the
client only, if it's completely covered by another window.
Fixes https://github.com/awesomeWM/awesome/issues/217