This event should contain the position of the top-left corner of the client's
content area. Thus, we have to add the border width to the position.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This reverts commit bd8158495e.
The idea was to track the current list of pressed and depressed mouse buttons,
because we get button events for more than 5 buttons, but can only query the
state of the first 5 buttons.
However, there are cases where we see button presses, but won't see the
corresponding release event. This is quite bad.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since only the body text of a notification may contain markup,
by combining the two together and calling set_markup(), the
title would also get interpreted as if it had markup.
This could be seen with:
$ notify-send "Title & text" "<i>body text</i>"
The unescaped & would get interpreted as broken markup and so
naughty would fall back to escaping everything which would make
the "<i>" tags be shown rather than interpreted.
So, the title must always be escaped so that it is not interpreted
as markup.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The flex:fit() function was calling the fit() function of the widgets it
contained with too large values, trying to hand out more space than it had
available. This resulted in more space being requested than was available and
some weird layout issues resulted.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The old code had flaws:
* If the tag chnaged screen, the code was unstable.
* If awful.tag.del was used, then it displayed an error
* If tags were added later, the keyboard shortcut were unavailable
Since commit d8a93dafa3, tags have an "index" property which decides about
the order in which they are displayed in the taglist. If a tag doesn't have this
property set, the next call to awful.tag.gettags() will fix this and "invent" an
index for this new tag.
However, if multiple tags didn't have an "index" property, gettags() would
assign all of them the same index. The following call to table.sort() would then
do random magic to these tags (remember: table.sort() is not a stable sorting
algorithm, so it is allowed to randomly swap around entries which have the same
sorting key).
Fix this by making sure that the new "index" properties are different from each
other.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Due to some layout changes, the client title widget is no longer assigned all
the remaining space. To work around this, we wrap the widget in a flex layout
which means that it asks for all the available space. This way, moving via the
titlebar works again.
Additionally, these button events are now also assigned to the client's icon
widget. No idea why this wasn't done before...
Signed-off-by: Uli Schlachter <psychon@znc.in>
Titlebars are not visible for fullscreen clients, so it doesn't make sense to
substract the area used for the titlebar in ConfigureNotify events.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>