The previous commit made the hierarchy do a re-layout when the context changes.
However, widgets could change their appearance depending on the context without
changing their layout. Thus, the previous commit is not enough.
This commit also makes the drawable redraw everything when the context changes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When the context for widget changes (e.g. we are on a new different screen or
have a different DPI value), widgets might change their appearance even though
they didn't emit widget::layout_changed. Thus, update the hierarchy in these
cases.
Signed-off-by: Uli Schlachter <psychon@znc.in>
widget_at() no longer exists since 0aa4304bda (and the surrounding commits
stopped us using this function).
Signed-off-by: Uli Schlachter <psychon@znc.in>
The magnifier layout wants to ignore floating clients. Before 82342f0 this was
done by calling awful.client.floating.get(focus). If "focus" was nil, this might
have checked the floating status of a wrong client (if some other client was
focused, and the code in magnifier set focus=nil before). This issue can easily
be missed and might exist since forever. After 82342f, floating status is
checked via "focus.floating" and this now causes an "attempt to index nil value"
error instead. Much easier to notice.
Fix this by adding the missing nil check and while touching the code, merge this
with the previous "if" and correct another error (the wrong thing happened if we
had #cls=0).
Fixes: https://github.com/awesomeWM/awesome/issues/1103
Signed-off-by: Uli Schlachter <psychon@znc.in>
Imagine that you have two screens of different resolution and you change their
position (xrandr --output first --left-of second). Of course, the wallpaper has
to be updated afterwards.
This commit makes the default config do that.
Fixes: https://github.com/awesomeWM/awesome/issues/1102
Signed-off-by: Uli Schlachter <psychon@znc.in>
To ensure that some features such as SNID rules work, we need
to ensure that the screen isn't set by other code paths. Only
a single algorithm can be executed for the screen. As soon
as many algorithms are executed on events such as "manage", it
will most likely regress again.
This commit make sure of that by disabling the default normal source
of c.screen. After that, any other c.screen changes can be
considered bugs.
A client is supposed to go to a screen when:
* It has been started using `awful.spawn` with explicit instructions [1]
* An `awful.rules` rule **or any of its callbacks** set the screen [2]
* When something handle `request::screen` and/or `request::tag` in some
custom ways. [3]
* Some clients can request a screen and mean it (like MythTV/Kodi/XBMC and
some multi-window DAW) [4]
A client is supposed to go to the focused screen when none of the above are
true [5].
Other constraints:
* The screen need to be set only once, anything will will emit
`property::screen` many time and cause side effects.
* There has to be a single entry point to the algorithm, no multiple
"manage" handler.
* Awesome internals must use the `request::` signal API and not force
their decision outside of request handlers.
* Restarting Awesome must not change the client screen
Commit 2178744 fix use case number [1] and [2]. It actually fix [4] too, but
it is an accident and I am not sure we care about [4] anyway. Use case [1]
and [2], however, are very important.
Fix#1091
The code was written so that it assumes that disconnecting the last signal also
removed the corresponding entry in the signal array. This lead e.g. to an
index-out-of-bounds access in some cases.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The geometry storage has been moved into awful.placement. This
code was never executed as data[] was never populated.
There is some behavior that is indeed lost, but it is unlikely
someone will ever notice (it has been broken for 6 months).
The previous code attempted to handle scrren changes while
maximized. The new code organization shift this responsability
to awful.placement. However, it doesn't yet fully implement the
previous logic.
This should "protect" the user from some stupidities that Lua code might be
doing that e.g. makes a client jump to another position and then immediately
back to where it was before. Only the last change in a single main loop
iteration will actually have any effect.
Original idea by Daniel here: https://github.com/awesomeWM/awesome/pull/174
Signed-off-by: Uli Schlachter <psychon@znc.in>
Awesome 3.5.9 accepts `_active`/`_inactive` names for `beautiful`
minimize keys (such as "titlebar_minimize_button_focus_inactive").
Some themes rely on those, meaning that when they loaded under
the current Git, the minimize button went missing. This adds a
fallback, to improve compatibility with the existing themes.
dbus.connect_signal may only have a single function bound to
a given name, but the caller has no way of knowing if their
function was bound or not.
This change has dbus.connect_signal adopt the standard Lua error
convention of returning a truthy value upon success, or nil and an error
message upon failure.
The "test launching client on a specific screen" suit is very slow.
However, it is also necessary to avoid issues such as #1069 or #154
from regressing again.
This is a temporary fix until a faster test client "daemon" is
developped.