There isn't much point in the screen property of a drawin because the geometry
already defines on which screen the drawin is.
The biggest chunk of changes from this is due to removing the functions
drawin_detach and drawin_attach which where called when the screen property was
set/unset.
The code from drawin_detach is moved into drawin_set_visible and drawin_wipe.
drawin_attach is moved into drawin_init.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When some client sets an invalid window title, a lua error was generated while
updating the tasklist. This caused all later tasklist entries to be skipped /
missing and the last entry to be empty.
Fix this by catching lua errors with pcall.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Thanks to a recent commit, a drawin's window will always be a valid and existing
window. This means we can remove all the code which checks this before doing
something.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We don't need an up-to-date pixmap and cairo surface for a drawin which isn't
visible. Thus, only bring those up-to-date when the drawin is visible.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of creating/destroying a window whenever the drawin is attached/detached
from some screen, a window is now created when the drawin is created and it
isn't destroyed until the drawin is garbage collected.
Since we can now safely assume that a drawin always has a associated window,
this should make it possible to simplify some stuff.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the imagebox widget refuse images which have a zero or negative width
or height. A zero size causes problems where a division by zero results in inf
which makes various stuff fail in weird ways later on.
Additionally, cairo's "error surfaces" have a negative size. Displaying those
would cause all sorts of weird problems, too, so we better reject those.
Signed-off-by: Uli Schlachter <psychon@znc.in>
awful.placement.no_overlap caused clients on an otherwise empty desktop to stich
to the top-left corner of the screen because it always preferred the top-left
corner of the available space.
This commit doesn't change the way in which the available area is computed, but
instead this now tries to keep the client at its original position if that is
available.
This fixes cases where calling awful.placement.no_overlap as a callback from an
awful.rule rule didn't work because the manage signal in the default config
later overrode that via calling awful.placement.no_overlap.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This corrects a type in awful.client.restore which caused it not to restore any
client at all if all clients are minimized.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The elements in ${icon_sources}, as returned by file(GLOB ...) contain
double slashes, could be a bug in cmake. This causes building with
cmake 2.8.4 to fail, due to dependency problems lateron.
This patch works around the issue by normalizing all path names in
${icon_sources} while appending them to ${ALL_ICONS}, thereby removing
the double slashes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This restores the first minimized client it finds on the selected tags.
Optionally, this function accepts a screen number as its first argument.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fixes a bug where the tasklist would still show its old content after a
client was minimized/unminized because it didn't connect to the appropriate
signal.
This wasn't noticed before, because in most cases minimizing a client also
unfocuses this client which causes a tasklist update.
Signed-off-by: Uli Schlachter <psychon@znc.in>
awful.client.floating.get() does some sensible defaults. E.g. dialogs are
floating by default. Since floating.toggle only checked the property, these
defaults made it break.
So floating.toggle() should use floating.get to decide if a given client is
floating. It should also use "false" instead of "nil" when the client is made
non-floating or else the default will apply again.
Thanks to vsp for making me figure this out. :)
Signed-off-by: Uli Schlachter <psychon@znc.in>
When a client sets WM_NAME (client->alt_name) but doesn't set _NET_WM_NAME
(client->name), we give alt_name to lua when c.name is used. However, we still
emitted property::alt_name instead of property::name to lua. Obviously, this
breaks stuff.
(The same applies to client->alt_icon_name)
I noticed this via feh whose tasklist entry wasn't refreshed when multiple
images were displayed and I switched to the next one.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When some client on the left monitor was closed while client.focus is on the
right monitor (e.g. 'sleep 5 ; exit' in a terminal), awful.autofocus would shift
the input focus to whatever client happened to be next in the focus history on
the left monitor.
Fix this by only ever moving the input focus between screens when a tag is
selected, not when some client does its magic.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Added a very simple example to show the usage, and applicability of
awful.menu by dynamically constructing a menu of clients that match a
particular rule.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Display the possible keys to the 'menu' params as a bullet list
(unreadable otherwise).
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
image:type() was removed from oocairo, because the ._NAME property already
exists and there's no need for two functions doing the same job.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Some time ago I added a --no-argb option with the short-hand version -a.
However, the short version didn't actually work. Whoops!
Signed-off-by: Uli Schlachter <psychon@znc.in>
Before this commit, c:tags(tags) and t:clients(clients) first removed all
tags/clients and then added the new one.
This is now changed into only removing the tags/clients that have to be removed
and leaving the others in place. Hopefully, this avoids all kinds of weird
issues which we had.
Signed-off-by: Uli Schlachter <psychon@znc.in>
To demonstrate keygrabber API usage, I added a small function to the
docs that can be bound to a key and used to resize clients using
keyboard.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
naughty now tries to ignore all pango markup by using :set_text() instead of
:set_markup(). If this fails, too, we must have been fed invalid utf8 which we
cannot do anything about.
Signed-off-by: Uli Schlachter <psychon@znc.in>
I removed textbox' check() function, but forgot to see if anything actually
calls it. Just removing the call fixes all problems here.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In commit 3dbf89c I removed a client_unban() in the code path for focusing
clients. The idea was that client focusing is now done after rebanning, so that
it should already be visible by the time this code is executed.
However, minimized clients obviously don't get unbanned, So we have to call
client_unban() here to make sure the client is unminimized.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the textbox pass the markup/text it is given to oopango immediately.
If it is invalid, a lua error will be thrown and the old text will still be
shown.
This fixes a bug where the whole wibox isn't redrawn when a textbox complains
about broken UTF8.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The luadoc API documentation already contained this function and it seems to be
useful for user configs.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The lua code could keep a reference to out cairo surface for a drawin after it
was destroyed. So make sure the surface is finished before the associated
drawable is destroyed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This reverts commit 7c86714dca.
It doesn't make sense to hard-wire /usr/local into the build, as this
depends entirely on the build target.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We actually have to set a proper background color on all our drawins, else the
default black will "flicker through" while the window is drawn.
Signed-off-by: Uli Schlachter <psychon@znc.in>
setwfact() calls idx() on the client that it works on. When idx() is called with
a client that isn't visible, it fails while trying to find outs the client's
index in the current layout.
event_handle_mousegrabber:119: error running function:
lib/awful/client.lua:688: attempt to compare nil with number
Fix this by ignoring all clients that aren't visible in setwfact().
Signed-off-by: Uli Schlachter <psychon@znc.in>
This function can be called from unprotected contexts. Calling luaL_error() in
this case results in a call to luaA_panic() and awesome dies.
The only real change here is that this now calls warn() instead of luaL_error().
The rest is reindentation because warn() returns while luaL_error() didn't.
Signed-off-by: Uli Schlachter <psychon@znc.in>