Thanks to the previous commit, spawn_with_shell() can now easily fix lots of
problems that we previously had with escaping the argument to the shell.
Signed-off-by: Uli Schlachter <psychon@znc.in>
With this change, awesome.spawn() can be called with a table as its command line
argument. This gets rid of lots of problems with escaping the arguments. For
example, the following call is now possible:
awesome.spawn({ "bash", "-c", "echo \"foo\"" })
Thanks to Ignas Anikevičius for inspiring me to this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Having this in lua means that size hints are only applied after the client got
resized. The bad side effect of this is some flickering if awesome is being
slow. And apparently, it is slow for way too many people...
Signed-off-by: Uli Schlachter <psychon@znc.in>
Fixes mixed up min/max strategies and other bugs in min and max. Also
removes enforcing the size in draw, adhering more to awesome's layout
concept.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
There was a leftover info about marked client keybindings and the
default rc.lua doesn't have those.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This has to be removed because it breaks the fallback to the default config if
the first config already managed to create a systray widget. This doesn't mean
that it is suddenly possible to have the systray visible in more than one place,
it just means that awesome will no longer complain about this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Before this, surface.load() would throw a lua error because it couldn't load the
icon which broke naughty's state.
With this commit, this error is caught and an error message is printed on stderr
instead.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Let's consider the following notification:
naughty.notify({ text = "foo", bg = "#88888888", timeout=1 })
naughty.notify({ text = "foo", bg = "#88888888", timeout=2 })
When the first notification disappears, the second one is moved and takes its
place. However, its content was not redrawn. This makes the pseudo-transparency
break and the wallpaper that is shown in the back of the notification doesn't
match the real wallpaper.
Fix this by redrawing drawables when they get moved.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Thanks to the previous commit, a drawable can no longer have a finished cairo
surface. Instead, it will now have a nil surface. This commit handles this new
possibility.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When property::surface is emitted, the drawable didn't know its geometry yet,
which had weird side effects. Fix this by changing the C API a little. The
function drawable_set_surface() now no longer allows a NULL surface as its
argument.
The required changes for the titlebar code also means that we no longer throw
away the double-buffering surface when a client is moved.
Signed-off-by: Uli Schlachter <psychon@znc.in>
A hack around abusing the fact that width of a textbox is 0 when its
empty, while it's height is still set according to the font.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The function can be used to set the maximum size the widget in the
flex layout should take.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Additionally to handing over the focus to the window this commit raises
the window too. Otherwise a window which is hidden below other windows can
request the focus and because the window is not fully exposed, the user is
unaware which window has the input focus and is actually receiving the
keystrokes.
Signed-off-by: Stefan Haller <haliner@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The systray widget's fit() function worked in the (rotated) user coordinate
space while the draw() function used device coordinates (unrotated). This meant
that width and height were swapped up in the calculations and the systray ended
up being way too small.
Fix this by making the draw() function use user coordinates, too. This means
that it needs some new magic to detect a rotated coordinate space. This, in
turn, means that the systray is now automatically rotated when you put it into a
rotate layout.
This might cause some minor breakage because people no longer need to call
:set_horizontal() on the widgets.
Thanks a lot to Alexander Gehrke for his help!
Signed-off-by: Uli Schlachter <psychon@znc.in>
When no wallpaper exists yet, instead of creating a black image surface which
covers all the screens, just create a surface for the screen which we need. This
means that way less pixels have to be uploaded to the X11 server, which should
be faster.
Signed-off-by: Uli Schlachter <psychon@znc.in>
To avoid some oddities, awesome sets the input focus lazily. Instead of
immediately sending everything to the X11 server, awesome just sets a flag "have
to update the focus later".
However, this can cause problems. As Stefan noticed, awesome can forget about
focus changes on FocusIn events when such an event comes in while we still have
a pending focus change.
The fix here is to send out the pending focus change before we record the fact
that another client now acquired the input focus.
Reported-By: Stefan Haller <haliner@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This allows to use cairo patterns directly for any kind of "color". This makes
it easier to use things which aren't possible through gears.color.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Commit 08ca70c00d added support for Xlib cursor themes by making awesome use
Xlib for its X11 connection and for setting cursor icons. Everything else was
still done through xcb.
However, an unexpected side effect of this is that Xlib enabled the XKB
extension without asking us. This changes the way that keyboard events are
reported which causes problems with various keyboard events.
(Normally, Xlib hides these things by silently fixing up the events that it
hands out to applications. However, since we bypassed Xlib via xcb...)
The fix is simple: Luckily Xlib provides a function for disabling its XKB
support which is just what we need.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously, cairo would often have to download the old wallpaper from the X11
server and then upload it again. It did this because it couldn't see that the
two X11 connections involved are actually connected to the same X11 server.
This commit fixes this by setting up the pixmap from our main X11 connection.
This is the same connection that we use for accessing the "old" wallpaper and
thus cairo doesn't have to do stupid things.
The big improvement with this is that this speeds up wallpaper setup a lot.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The previous attempt at making the utils.wm_name variable useful for
accessing some entries was silly. This is because a typical ShowOnlyIn
string would look as: 'Unity;Gnome;KDE;' and the matching currently is
done for the whole string, where as we need to match only a part of it.
This small (hackish) commit fixes that, or do we wanna parse this line
of a .desktop file properly?
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
I amended some change to commit 8560de597c which made the align layout's
middle widget really centered instead of being way too wide. However, this also
shrunk the widget on the "other" axis, too. This commit fixes that up.
A big "sorry" to Lukáš for breaking his patch.
Signed-off-by: Uli Schlachter <psychon@znc.in>
If user changes locale with os.setlocale to a "dirty"
locale (which use comma as decimal separator (not dot), e.g.
hu_HU) `tonumber` will produce "0,6" instead of "0.6"
which causes bad comparision.
Signed-off-by: uzsolt <udvzsolt@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
If theme.tasklist_plain_task_name is set to true, the various client
state marks will not be prepended to the task name.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This layout can be used to constraint the size of the widget it holds.
Depending on the strategy passed to it, the widget will have a minimum,
maximum or exact size that was set through this layout.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The arguments are optional, making it possible to use a custom function
to create the {tag,task}list layout. The base_widget arguments can be
used to override the base layout of the {tag,task}list widget.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Centers the middle widget in the align layout in the remaining space
left by the widgets on the sides.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a fit function to the align layout that makes sure that
the layout will not take up all the available space in the other
axis than it's direction. Eg. for horizontal align layout, it will
only take up the maximum of its widgets' heights in the vertical axis.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The fit function of the flex layout is different from the fixed.fit one.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
No callers expect a nil result from this function. In fact, this broke
awful.tooltip because it tried to get the workarea of screen nil.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This was telling lua that no results are to be returned, but still tried to
return something. Thus, lua ignored the result.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The coordinates as used by X11 place (0, 0) at the top-left corner of the
window, including its border. However, this code wants the position relative to
the drawin's content, thus we also need to substract the border width.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The (x,y) position of a client is outside of the border, but the width/height
does not include the border (so the real width is width+2*border).
This means that we have to also subtract 2*border to make sure that the client
including its border really is inside of the expected area.
Signed-off-by: Uli Schlachter <psychon@znc.in>
No clue why this code is here, but it only allowed floating clients to be
resized beyond the edge of their screen. Clients on a floating layout were
forced to stay on their screen. Quite an unintuitive behavior and now this
behavior is gone.
Signed-off-by: Uli Schlachter <psychon@znc.in>