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>
* Move the "index" setting burden to individual functions
instead of gettags().
* Add some properties earlier so the signal hooks will be called
with valid data.
This patch allows 2 things to be done:
* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag
The advantages of the former are clear and simple. Those of the later include:
* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
This function was accidentally setting the global variable "icontypes". Fix this
by adding the needed "local" and also localize some more variables for
consistency.
Signed-off-by: Uli Schlachter <psychon@znc.in>
`client.property.persist` can be used to make properties persistent
across restarts. This works by backing them up via X properties (using
the `awful.client.property.` prefix).
`client.property.persist(c, "floating", "boolean")` is used to make the
floating property persistent by default.
Based on a patch from Uli, source: https://gist.github.com/psychon/10320743
doc, only set current prop in 'persist'
Fix xprop/prop mixup in 'persist'
Only call set for non-nil values
This new awful module reacts to shapes that a client sets on itself and sets the
shape of awesome's frame window to match. This way, xeyes really gets
transparent parts again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Setting a tag's screen to what it already is shouldn't have any bad effects.
However, this code messed up the tag order and selection status.
Fix this by returning early if the tag already has the right screen.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since commit 9c69e857ed, awful.tag.setscreen() unsets a tag's index to make
sure things end up in a sane order on the new screen. Thus, the call to
setscreen() removed the "index" property that tag.move just set.
Fix this by setting the index after the screen.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since commit 5b4666432f, we use set_text() instead of set_markup()
on the tooltip's textbox. This means it is no longer possible to use pango
markup in the tooltip which was not intended.
Fix this (properly) by introducing a :set_markup() function on tooltips (and use
it in the timer function to restore the old behavior).
Signed-off-by: Uli Schlachter <psychon@znc.in>
This inlines the set_defaults() function into its only caller and makes us less
stupid with the font property.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the screen objects use our existing infrastructure for implementing
classes and objects with lua instead of hand-rolling an own version.
This results in some small API change: Screen objects no longer have an
add_signal() function and instead this function exists on the parent screen
class.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The bugs this fix are:
* Invalid request using nil as screen
* Stop messing indexes in the old screen
* Prevent c.screen <-> t.screen mismatch
* Prevent no tags being selected in the old screen
When a screen doesn't have any tags selected, then just tag the new client with
all of the screen's tags. That way, we don't lose clients.
Also, if we failed at coming up with tags for a client, don't completely untag
it. This means that it can keep its old tags if it had any.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This reverts commit bbe86e4e25. That commit caused
unintuitive, special behavior. Instead, when someone wants us to set a screen,
we really should do so.
This commit partly reverts commit b4c83d0e70.
Because the C code emits property::screen before manage, this caused
awful.tag.withcurrent() to run on a client before it really was being managed.
This then tagged the client. Because of this tag changes, awful.layout reacted
and ran the layout code. Because c.type wasn't set up at this point yet, the
client wasn't considered to be floating yet. This caused the client's geometry
to change and thus its floating geometry was messed up.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The current premise is that c.screen should be the same as
awful.tag.getscreen(t).
The addition in `ewmh.tag` appears to be the important part here,
changing the order in awful.rules.execute is (maybe) only for
consistency across the codebase.
By default, tag.history.restore switches between the previous history
states, which is not what should get done when deleting a tag.
Without this, deleting multiple tags in a row, will jump back to the
first/fallback tag, instead of the older history entries.
The current premise is that c.screen should be the same as
awful.tag.getscreen(t).
The addition in `ewmh.tag` appears to be the important part here,
changing the order in awful.rules.execute is (maybe) only for
consistency across the codebase.
There is a strong hint that you are doing something wrong: You call
client.emit_signal(some_signal, c). Chances are high that this signal is
supposed to be emitted on the client object 'c' instead of the underlying client
class.
This applies to awful.rules' usage of this signal.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We now handle all "important" EWMH messages in lua and lua can decide to do
different things than the current obvious one.
Consistency!
Signed-off-by: Uli Schlachter <psychon@znc.in>
If a client gets moved to a screen without any selected tags, that client
disappears and it is non-trivial to get it back. Since this is unexpected and
annoying, make movetoscreen do nothing if the target screen has no tags
selected.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This allows to apply properties and callbacks to a client like
awful.rules.apply would do, without the matching part.
This is useful with the new startup notifications, and lets you apply
the same properties and callbacks from e.g. a manage signal handler.
This allow to spawn something, then apply some properties or rules when
the client show up ("manage").
This commit add:
* "startup_id" property for all clients object (immutable, can be nil)
* Second return value to awful.util.spawn() with the startup_id
* Update the documentation
Example:
local wait_for_it = {}
local pid,snid = awful.util.spawn("urxvtc")
wait_for_it[snid] = {ontop=true,sticky=false,
tag = awful.tag.gettags(mouse.screen)[1] }
client.connect_signal("manage", function (c, startup)
if c.startup_id and wait_for_it[c.startup_id] then
for k,v in pairs(wait_for_it[c.startup_id]) do
c[k] = v
end
if wait_for_it[c.startup_id].tag then
c:tags({wait_for_it[c.startup_id].tag})
end
end
end)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This helps in cases where you have accidentally cloned an entry from
`layouts`.
Previously, no current index would be found and the function would
silently fail.
Signed-off-by: Daniel Hahler <git@thequod.de>
This allows for having clones of a table, where its entries are still
references to the original values.
This is useful for copying a "default props" table, where you want to
keep the reference to entries like `awful.layout.suit.tile`.
Signed-off-by: Daniel Hahler <git@thequod.de>
Instead, use stack_client_push and emit the `request::activate` signal
from awful.rules.apply, if the client gets focus.
Signed-off-by: Daniel Hahler <git@thequod.de>
Pressing CTRL+DELETE removes the visible history entry, if any, then moves to the next history entry (like pressing DOWN would do).
If the last history entry is removed the previous one is shown in the prompt (like pressing UP would do).
CTRL+DELETE works on history entries only: i.e. it has no effect on a command entered but not executed yet.
To implement above behaviour I added saving history table to file on Escape key press.
Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Restoring a previous history entry changes the tag history (in the
meaning of currently selected tags), and therefore should also emit the
tag::history::update signal.
A use case might be to automatically hide tags with no clients on them.
Signed-off-by: Daniel Hahler <git@thequod.de>
Instead of having the C code mess with which tags are selected, we now emit a
signal on the tag that says that something requested it to be selected. Lua can
then handle this by only switching tags on the correct monitor and by updating
the focus history correctly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Ever since commit 6b2e4352b (from 2010!), awesome.spawn() doesn't have a screen
argument anymore and the extra argument from util.spawn was just ignored. Fix
the code and the luadoc for these functions.
Thanks to blueyed for noticing this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This reverts commit 20afb26080.
The commit caused endless loops with tracebacks like this (shortened):
lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
[C]: in function 'geometry'
lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
[C]: in function 'geometry'
lib/awful/ewmh.lua.in:122: in function <lib/awful/ewmh.lua.in:117>
[C]: in function 'geometry'
When a client's geometry changes (and I consider the border width to be part of
the geometry here) and that client is one of fullscreen or
maximized_{horizontally,vertically}, make sure that the geometry as specified by
the state is still obeyed.
This also (accidentally) fixes things when a client gets moved to another
screen!
Signed-off-by: Uli Schlachter <psychon@znc.in>
Due to a copy&paste error, maximized_vertical and maximized_horizontal were
handled the same. Of course, vertical and horizontal aren't the same direction.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When we receive a _NET_ACTIVE_WINDOW request on the root window, we used to just
focus and raise the window. This didn't do much for clients which are on
non-selected tags.
Thus, this commit makes awesome emit request::activate on the client instead.
This is used in awful.ewmh to implement the old behavior again, but with
additionally marking the client as urgent if it isn't visible.
People who don't like this behavior can use client.disconnect_signal to disable
this behavior again. To make this really possible, awful.ewmh becomes a
"non-nil" module.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The default value for the second argument to :find() is 1, so nothing is changed
here. The third arguments disables pattern matching and instead gets us literal
interpretation of strings. This means that pattern characters like e.g. [, ] and
. don't get interpreted.
Signed-off-by: Massimiliano Brocchini <massimiliano.brocchini@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
When an area is split in two, for example horizontally, one of the windows
should have height math.floor(previous height / 2) and the other
math.ceil(previous height / 2), to be certain that no gaps are left between the
windows.
For instance, if the first window has height h and the second window has height
math.floor(h / 2), the height of the third window should be math.ceil(h / 2)
instead of the same as for the second window.
So to compute the size of window n + 1 it’s necessary to remember the size of
window n - 1 as well as that of window n.
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This gets rid of the unused first argument and adds a new second argument that
can influence individual items.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The documentation says that screen, the last argument to viewmore(), is an
optional argument. However, the implementation only treated it as an optional
argument in one place.
Fix this by always setting the screen variable itself to a screen.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Label of menu entries will be escaped automatically. Doing it manually
in menu:clients() will escape it it twice.
Patch removes the util.escape() call in menu:clients()
Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>