This accidentally called the draw callbacks with a nil argument instead of the
context. This was introduced in some badly done rebase, sorry! :-(
Signed-off-by: Uli Schlachter <psychon@znc.in>
The default config has this:
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
This moves the client to the next screen and focuses that screen.
But it does not ensure that the client is raised above any existing
windows, e.g. when moving a floating client.
This patch emits the `request::activate` signal if the client is
currently focused, but only if the screen property actually has changed.
Closes https://github.com/awesomeWM/awesome/pull/98.
The parent was needed for :get_matrix_to_device() which recursively walked
parents and multiplied together their transformation matrices. This is now
replaced by calculating all these matrices while constructing the hierarchy.
Signed-off-by: Uli Schlachter <psychon@znc.in>
There once was a function :get_root() on hierarchies, but that wasn't needed any
more and thus was removed. This commit also removes the internal code that was
used to record the root element of the hierarchy.
Signed-off-by: Uli Schlachter <psychon@znc.in>
These caches, well, cache the result of the :layout and :fit callbacks on
widgets.
Clearing caches is done by recording dependencies between a widget. When a call
to base.fit_widget() or base.layout_widget() recursively causes another call to
such a function, this means that the earlier widget depends on the later widget.
This dependency is recorded and when the later widget emits
widget::layout_changed, the caches of all the widgets involved are cleared.
Signed-off-by: Uli Schlachter <psychon@znc.in>
A widget hierarchy describes the position of widgets. The hierarchy is a
recursive tree of widget hierarchy instances. This functionality depends on a
:layout function that is not yet implemented on widgets, but will be added
later.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This factors out `matches` and uses it in `matches_list` (renamed
from `does_match`) to short-circuit the successful case - where not all
rules have to get checked.
Closes https://github.com/awesomeWM/awesome/pull/431.
This new function spawns a program, similarly to awful.spawn, but captures its
output. On each line of output on stdout / stderr, a Lua function is called with
this line. There are different callbacks for stdout and stderr. When both stdout
and stderr are closed, another callback function is called. The intention for
this last callback is "the program is done", because most programs should only
close their output when they exit.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This allows the "label" callback to adjust the textbox itself.
`tasklist_label` is changed to make use of it and supports new style
arguments: `font_focus`, `font_urgent` and `font_minimized`.
Closes https://github.com/awesomeWM/awesome/pull/313.
After this change, fit_widget() enforces that a widget cannot ask for more space
than was offered to it. This also fixes a rounding issue in the flex layout
where its fit function would return too small numbers.
Thanks to this, lots of "XXX" comments in spec/ disappear.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In expand nodes "none" and "outside", the variable size_remains describes how
much space is available for the first/third widget. Everything else is used by
the second widget. Thus, fitting the second widget to anything involving
size_remains is wrong. Instead, this commit uses the correct value.
This also fixes a messed up argument order for horizontal align layouts.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The tooltip might be partly outside of the screen, and especially the
workarea, e.g. for tooltips on the tasklist.
Calling `awful.placement.no_offscreen` makes sure that it is fully
inside, and will even restrict it to the workarea, not only to the screen.
Closes https://github.com/awesomeWM/awesome/pull/409.
This table contains the drawable, wibox and titlebar that we are drawing on, but
also includes the screen and the DPI of that screen. This allows widgets to
depend on the DPI in their rendering.
Signed-off-by: Uli Schlachter <psychon@znc.in>
With the second argument being 2, the traceback will not include the error
handling function, but instead end at the actual place of the error.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Having two modules named "base" is confusing and "wibox.layout" doesn't contain
much useful stuff. This is a first step for removing wibox.layout by moving a
function which should only ever be used internally in awesome.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds gears.timer.start(timeout, callback) that creates a timer object and
connects a callback to it, all in one go.
Additionally, this adds gears.timer.weak_start(timeout, callback). The weak
version still allows the callback function to be garbage collected and will then
stop the timer.
This was tested with the following code:
require("gears.timer").start(0.3, function()
print("ping")
if collectgarbage("step", 500) then
print("collection done")
error("err")
end
return true end)
require("gears.timer").weak_start(0.1, function()
io.stdout:write(".")
return true
end)
After a full collection cycle, both timers are stopped. The first one is stopped
because of the error() that it generated. The second one is stopped because the
callback function was garbage collected.
Ref: https://github.com/awesomeWM/awesome/issues/216
Signed-off-by: Uli Schlachter <psychon@znc.in>
I'm working on something that adds :layout functions to widgets. This clashes
with the keyboardlayout widget's use of an entry with this name. This change
adds an underscore as a prefix to the private data members of the
keyboardlayout.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Given an outcome of e.g. 1.01 its more sane to use 1 than 2, especially
for `border_width`.
This uses the method from `wibox.layout.flex`.
Closes https://github.com/awesomeWM/awesome/pull/389.
Because of `placement.under_mouse` (and without
`placement.no_offscreen` fixing it), this will cause the tooltip to hide
immediately again.
There is no need for hooking into this signal, but this adds a click
handler to close the tooltip when clicking into it.
This splits the logic for `delay_show` out of `show`/`hide`, and handles
an already stopped timer. The timer gets also stopped after the tooltip
has been displayed.
Ref: https://github.com/awesomeWM/awesome/issues/371.
Use `beautiful.xresources.apply_dpi` for `common.list_update`'s textbox
margins, and add a left margin for the imagebox, too.
The latter is useful/nicer with the default behavior of an inverted
style for the focused tasklist entry.
18f6ab1 changed the behavior when resizing floating clients using the
mouse (via modkey + RMB).
Previously, you could initiate the mousegrabber using e.g. "modkey +
RMB", release the key and button, and resize the window using the left
mouse button.
This restores this behavior by canceling the mousegrabbers only if the
cursor was moved, without _any_ mouse button being pressed.
Fixes https://github.com/awesomeWM/awesome/issues/309.
Closes https://github.com/awesomeWM/awesome/pull/310.
Instead of `client.client`, the client object is now referred to as
`client.object` and the client class as `client.class`.
This moves the documentation of `client.focus` to the class.
Closes https://github.com/awesomeWM/awesome/pull/349.
This adds a `stacked` boolean argument to `awful.client.visible`, and
(relevant) callers of it.
This can be used with e.g. `awful.client.swap.bydirection` to swap clients
based on their stacking order.
Fixes https://github.com/awesomeWM/awesome/issues/178.
This adds an optional screen argument to get_dpi/apply_dpi and set_dpi
to store DPI values per screen.
This can be used in your config to manage different DPI values for an
internal and external display:
beautiful.xresources.set_dpi(125, 1)
beautiful.xresources.set_dpi(94, 2)
This is meant to be the foundation for more evolved DPI handling in
awesome.
Closes https://github.com/awesomeWM/awesome/pull/336.
This skips permanent notifications (with timeout=0) in `get_offset` when
there is not enough room for a new notification. It will still fallback
to removing the first/oldest one.
Closes https://github.com/awesomeWM/awesome/pull/306.
This is meant to get a new font (copy) with adjusted attributes, e.g.
font_focus = beautiful.get_font_copy(theme.font, "bold")
Closes https://github.com/awesomeWM/awesome/pull/308.
When windows are set as "above", they will basically behave as "ontop"
(under normal circumstances) and therefore an indicator is useful to get
displayed in that case, too.
Closes https://github.com/awesomeWM/awesome/pull/325.
color_strip_alpha was used to insert colors into Pango markup, but it
did not correctly check for valid Pango colors. ensure_pango_color
checks if the color is valid in Pango, and returns a placeholder if it
is not.
In ed09d8e this was changed accidentally, while only `request::focus`
should have been changed:
- c:emit_signal('request::activate',"rules")
+ c:emit_signal('request::activate', "rules", false)
Currently `taglist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
Currently `tasklist_update` gets triggered often, because it listens to
a lot of signals.
This patch makes it only call the last one through `timer.delayed_call`.
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
This still does `client.focus = c` by default, but allows to customize
it.
This was initially suggested in #194, but by using `request::activate`
instead, which would not be the same. Therefore a new signal is being
used instead.
Helped-by: Samir Benmendil <samir.benmendil@gmail.com>
This way "that other widget" doesn't prevent the current widget from being
garbage collected.
Please note that this in all of these cases the widget under consideration does
have a strong reference to the callback function. This means that the callback
cannot be garbage collected until "this widget" itself is collected. Thanks to
this, this change is safe.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Connecting to a signal weakly has the same effect as connecting to it strongly,
but it allows the garbage collector to disconnect the signal in case nothing
else references this function.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In commit 3cbdc2a79f, the argument order for awful.layout.inc was changed
from (layouts, i, s) to (i, s, layouts), so that layouts can become an optional
parameter. However, this change (obviously) breaks user configs.
To hide this breakage, we assume the old argument order if the number i is a
table. This cannot break anything, since the operator "+" will error out on
tables anyway. :-)
Signed-off-by: Uli Schlachter <psychon@znc.in>
I doubt that this makes much of a difference since lgi surely caches things, but
this still seems nicer to me.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since commit 52ec0ebd93, layouts should return the geometries to their caller
instead of setting them directly. The caller will also fix up the geometries for
border width.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds an optional `filter` arg to awful.client.focus.history.get,
and uses `awful.client.focus.filter` from the autofocus module.
This improves the behaviour when manually setting clients as
non-focusable (#237), and is considered to be the desired behaviour in
general.
Closes https://github.com/awesomeWM/awesome/pull/242.
Sometimes is a good idea to check if notifications are suspended,
for example, for changing the icon. This function just returns the value
of suspended.
Closes https://github.com/awesomeWM/awesome/pull/222.
Define @classmod wibox.widget.keyboardlayout, otherwise ldoc fails to
find the base class:
> module(...) name deduction failed: base .../src/build/docs/capi/ .../src/build/lib/awful/widget/keyboardlayout.lua
Fixes https://github.com/awesomeWM/awesome/pull/149#issuecomment-94014438
Widget shows current keyboard layout short name (usually two letters,
for example 'us', 'de'). Indicator will be hidden if only one layout
configured. Layout can be switched either by clicking on widget or by
function keyboardlayout.next_layout()
When moving a fullscreen/maximized client to a smaller screen or with
different Y offset etc, its offset was not handled properly.
This moves it first into the new area, and then makes sure that its not
off-screen. The latter should not happen, because the width/height is
adjusted before.
Enables users to replace text and reset expiration timeouts of existing
notifications, which is necessary for OSD creation by means of naughty.
Signed-off-by: taptap <alexey.e.egorov@gmail.com>
This moves all of the documentation into a separate folder, which keeps
everything in one place and avoids unnecessary clutter.
This will pay off when proper guides are written for various aspects of
using awesome or contributing to it.
This also updates the building system, so that the docs are properly
generated with new directories.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Reorganise the config table, so that we have a single table and the
fields are nested.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
This is basically an initial stab for some modules and some
experimenting with the `@classmod` directive.
For most of the docs only basic transforming was done.
At the moment the tooltip module looks the best.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
This converts the old documentation style into the new one to use
markdown instead of HTML in bigger doc blocks. Also, we can use block
comments, which means that writting documentation (and indenting code
blocks) easier.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
After a client gets unmanaged, the newly focused client might not be
visible / raised above other windows.
Using the `request::activate` signal makes the autofocus handler more
flexible, and will raise the focused client by default.
This avoids awful.autofocus to kick in, focusing some other client in
between (where a focused signal would get emitted for, although the
intermediate client was never meant to have focus).
This is the traceback:
stack traceback:
/home/user/.config/awesome/cyclefocus/init.lua:199: in function 'add'
/home/user/.config/awesome/cyclefocus/init.lua:309: in function </home/user/.config/awesome/cyclefocus/init.lua:304>
[C]: ?
/usr/local/share/awesome/lib/awful/autofocus.lua:22: in function 'check_focus'
/usr/local/share/awesome/lib/awful/autofocus.lua:31: in function </usr/local/share/awesome/lib/awful/autofocus.lua:28>
[C]: ?
/usr/local/share/awesome/lib/awful/tag.lua:517: in function 'viewonly'
/usr/local/share/awesome/lib/awful/client.lua:69: in function 'jumpto'
/home/user/.config/awesome/rc.lua:1188: in function 'client_run_or_raise'
/home/user/.config/awesome/rc.lua:1217: in function 'run_or_raise'
/home/user/.config/awesome/rc.lua:1243: in function 'press'
/usr/local/share/awesome/lib/awful/key.lua:42: in function </usr/local/share/awesome/lib/awful/key.lua:42>
Ref: https://github.com/awesomeWM/awesome/pull/19
This supersedes https://github.com/awesomeWM/awesome/pull/107.
If a client's width/height is larger than the screen's geometry, align
it at the screen's x/y offset.
Test case with gvim, from a maximized terminal on a floating tag:
% gvim -u NONE -N --cmd "set lines=$((LINES + 5))"
Without this patch the top of the window is off-screen, but the bottom
should be. Fixing it using a number of lines that fit the screen should
display the window completely.
The 'request::activate' signal should be sent and handled immediately,
and not delayed. It was too much of a hack to work around the client
not being visible.
Instead, the "is visible" constraint on `capi.client.focus` will be
removed.
This reverts commit 6963ede3dc.
This gets rid of awful.util.unittest and instead creates an automatic test for
it under spec/awful/util_spec.lua. In the process, it also fixes the test to
actually test the right thing and I took the liberty to add some more tests.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fix two things:
(1) Clients asking to be urgent while focussed, this have been reported
a few time for urxvt and I usually link a patch that fix this. This may
not be considered a bug by some, but I think it is.
(2) Add the ability to stop noisy clients from setting the urgent state
themselves.
This made it easier to figure out where a file causing an error was
coming from, but I could imagine that this could become too noisy, and
that there is/should probably be a more streamlined way to enable more
verbose logging / error output.
When loading persistent properties for a client, the loop value wasn't used,
but the original/requested property. This would only get triggered when
using more than one persistent client property (the default is one,
"floating").
That commit made awful.tag use timer.delayed_call() to call withcurrent() during
the manage signal. The idea was "if nothing else assigns any tags until the end,
apply some default ones".
However, the C core refuses to set the input focus to an unviewable client and
thus this means that setting the input focus during manage failed. So, instead
of using the delayed_call(), just call withcurrent() directly, like we did
before.
However, some part of that commit is still left: Awful.rules no longer
disconnects the withcurrent() callback from the "manage" signal. This was
originally added in commit 5e7ddd1efa, because it clients flickered otherwise if
they were moved to some unselected tag during "manage". This happened because
the C code unbanned the client when it got assigned the input focus and only
later did some other code move it to some unselected tag.
However, this flickering will no longer occur, because commit 3dbf89c990 added
lazy focus setting. Thanks to this, setting the focus no longer unbans a client
as a side-effect. Thus, if you focus a client and then remove it from all
selected tags, nothing will be visible on-screen.
To make a long story short: This commit reverts the part of commit 90fde1393f
which caused side effects. The part that wasn't necessary any more is left in.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This way this function runs after everything else did its job. The client will
only get assigned a tag after everything else had a chance to do so.
Thanks to this, awful.rules no longer has to disconnect the call to withcurrent.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Let's just quote a mail I received from Rastislav Barlik:
I tried to make use of awful.mouse.finder but I found out that it's not working
as supporting functions rounded_corners were removed with commit
03e0ee53d2.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Apparently I still had an old naughty.lua laying around in build/lib and thus
this new code wasn't actually tested. It's a miracle that it works so well
besides this.
Signed-off-by: Uli Schlachter <psychon@znc.in>