Rules refactor, part 1
This fix the following awful.rules bugs:
* **x**: Broken when "border_width" is set or left titlebars are used
* **y**: Borken when"border_width" is set or top titlebars are used
* **width**: See above + right litlebar
* **height**: Same as above
* **switchtotag**: Have a race with the "manage" -> "tag.withcurrent" code in `awful.tag`
* **tag**: Had dead code
* **screen**: Had a race condition with switchtotag
* **urgent**: Had a race with screen and another with switchtotag+focus
* **focusable**: Was broken yet again when request::activate was introduced (and also because of FS1098, that I also fixed)
* **no_overlap**: The "no_overlap" call in rc.lua "manage" section conflict with the geometry rules as the hints are not set (idk why).
* **size_hints_honor**: If set to false, it would be applied too late, causing height and width offsets due to placement or various geometry related properties
Remove request::fullscreen and request::maximized_* and use
a single request for them. The other client resizing features
will soon also start to use this.
Due to recent changes, it was no longer possible to disable the
default tag selection handler. This commit extend the already
existing request::tag mechanism to let handlers select the tags.
There was a regression when refactoring the API. It was no longer
possible to disable the automatic tag selection.
Due to recent changes, it was no longer possible to disable the
default tag selection handler. This commit extend the already
existing request::tag mechanism to let handlers select the tags.
Testing demonstrated that many rule properties were broken when used
together. This commit try to address this by forcing an execution order
that doesn't trigger the problems.
It is still possible to write broken rules, but it should not happen by
accident anymore. Users should not try to assign the client a tag on
screen 2 and also use screen=screen[1].
This commit also add a 3 step process to apply rules.
Testing showed that many rules are currently broken because
of execution races.
Create a new dynamic tag for the client.
There was many unfixable race conditions that could only be
solved by better integrating the request:: system and
awful.rules. This has the side effect to make rules mandatory.
The new stateful layout system try to avoid coupling and therefor
doesn't use these methods. It is not planned to deprecate the
stateless layout API, so these functions are just kept as-is with
the old naming convention.
ldoc doesn't allow to specify fields from class "A" into class "B",
so the only solution is to merge the 2.
Also, one of the most common complain on IRC since Awesome 3.0 is
that the client API doc is confusing since it is in 2 different files.
Also restore the `awful.client` doc link, point to `client`
This will avoid broken links.
gears modules usually don't depend on Awesome C-API. This code has
been placed there for unclear reasons.
Also, there is ongoing work to unify each "concepts" API into one
single page. Having `gears.screen` go against this effort.
This re-use the `align` code for the existing `centered`,
`center_horizontal` and `center_vertical` methods. It also
add all the other edges and corners alias.
This allow to place a client, wibox or cursor at the
edges, corners or center of the parent geometry.
This also add code from `awful.wibox` to ajust the workarea.
Future commit will use `awful.placement` to place `awful.wibox`.
Useful when using dynamic tags. The tags will be closed once
it is empty. This was part of Tyrannical for many years, but is
generally useful for other workflows too.
local t = awful.tag.add("my_tag",{volatile=true, screen=2})
awful.spawn("ayapp", {tag=t})
Any signal on a screen instance is also emitted on the screen class, so the here
can just connect to the screen class.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signals on instances are also emitted on the class and thus we can just connect
to the signal on the class here.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This code works just fine with non-integer table keys. Also, this is used by
awful.screen.focus_bydirection() and thus will be used with screen objects
instead of screen indicies when we get rid of screen indicies.
Signed-off-by: Uli Schlachter <psychon@znc.in>
There seem to be a little race condition (either in my layout code or
elsewhere) when playing with multiple screens. As most properties do
not depend on the tag, there is no point in returning early anyway.
Instead of true/false `merge` can be a callback now, which allows for
more dynamic handling of the client not being visible, e.g. moving it to
the current tag, instead of merging.
This makes awful.tooltip create its tooltip lazily when it is first needed
instead of immediately when the tooltip is created.
Fixes: https://github.com/awesomeWM/awesome/issues/591
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 commit makes the code in awful.client work with screen objects where
possible (which is not possible in awful.client.movetoscreen() because it uses
screen_idx + 1).
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>
This commit makes awful.ewmh re-apply the maximized geometry to any maximized
clients when the workarea of a screen changes. This happens e.g. when a wibox
that is docked to the edge of the screen is hidden.
Fixes: https://github.com/awesomeWM/awesome/issues/705
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since commit b2aaefd095, we correctly handle window gravities when
the border width of a client changes. Since most windows out there have a
NorthWest gravity, this means that most windows do not have this problem.
However, e.g. mplayer uses gravity "Static" and this causes this issue (any
gravity other than NorthWest will do).
This affects the fullscreen handling in awful.ewmh. The code has to set the
border width before it changes a client's geometry so that the move when the
border width changes doesn't matter.
No new integration test for this since I didn't find anything usable with a
non-NorthWest gravity. A test would be easy to write, just test if `c.fullscreen
= true ; c.fullscreen = false` restores the previous window geometry.
Fixes: https://github.com/awesomeWM/awesome/issues/697
Signed-off-by: Uli Schlachter <psychon@znc.in>
awful.layout.suit.corner does awful.tag.getmfpol(t), but doesn't actually have a
variable t in scope. I just copied the needed stuff from the tile layout.
Signed-off-by: Uli Schlachter <psychon@znc.in>
No idea what the correct value for this argument is supposed to be, but since
there is no variable "m" in scope, this always uses nil as the value.
Signed-off-by: Uli Schlachter <psychon@znc.in>
There is no "s" variable. This code wants "screen" instead. The effect of this
typo was that with multiple taglists, only the one that was created last got
updated.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This module is partly broken since 2009 (the way to use it that is mentioned in
the docs doesn't actually work) because the mousefinder object doesn't have a
find()-method (the line doing "self.find = find" should do "self.finder =
finder.find"). Since no one really noticed, this module is apparently not used
much.
When someone wants to still use this, they are free to copy this to their own
config. It's not much code, but it's enough code that I am annoyed that we ship
something broken to users. Everyone who copies it to their own config will make
sure it works the way they want.
Signed-off-by: Uli Schlachter <psychon@znc.in>