If you entered a multi-byte character into a prompt and then changed your mind
and used backspace to fix the character, only the last byte of the character was
removed. Because pango is intelligent, it noticed the broken utf8 and
complained.
So far nothing new. But since 711d78b50c the textbox will throw a lua error
when it gets an invalid text (= pango complains). Throwing an unprotected lua
error in this context causes the keygrabber to be killed which stops the prompt.
Fix this by removing bytes as long as there are bytes left that can be removed.
This is FS#801.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since 3fbb5f1535 "luaobject: emit signals on class too" when a signal
is emitted on some object, it will also be emitted on the class. This means that
we don't have to connect our signals via the "new" signal anymore, but can
instead connect to the signal on the class.
(Of course, the signal on the class gets as first argument the object on which
the signal was emitted)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Ever since awesome.spawn() also returns the pid of the started process, the
prompt accidentally displayed the pid of processes that it started.
Signed-off-by: Uli Schlachter <psychon@znc.in>
tag.delete(t, fb):
Delete tags if certain criteria are met:
- There are no clients assigned exclusively to this tag.
- Stickied clients have somewhere to go, 'fb' the fallback tag
If after deleting there is no tag selected then try and
history.restore() or select the first tag on the screen.
Return true if successful and nil otherwise.
Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Ignas Anikevicius <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
While calculating if part of the window is outside the visible region, this code
should also add the border width. (FS#684)
Signed-off-by: Uli Schlachter <psychon@znc.in>
The tasklist shouldn't care about the tag history or new tags showing up and it
also shouldn't care about tags disappearing on other screens (on the current
screen the tasklist needs to update because the tag might have been selected).
On the other hand, the tasklist really should care about tags being selected and
unselected. This worked before because this causes changes to the focus history.
Signed-off-by: Uli Schlachter <psychon@znc.in>
"a .. b or c" is equivalent to "(a .. b) or c", but we want "a .. (b or c)".
This bug caused an "attempted to concatenate a nil value" error message.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
tag.add(name, props):
make tags and pass a table of properties to apply to it
tag.new:
modified to use add() instead of calling capi.tag
Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
tag.getidx(t):
Return the index of 't' in the screen[]:tags() table. Return 'nil'
if 't' is not found.
Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
tag.move(i, t):
move tag 't', or tag.selected(), to index 'i' in the current
screen's tags table.
Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
Raising it makes it more obvious that the focus was really changed and makes
working with the client easier since it's, well, raised.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
Patch allows user to define menu position in pixels when
showing menu in keyboard-driven mode.
Note: Patch changes signature of show() and toggle() functions.
Signed-off-by: Julien Danjou <julien@danjou.info>
Initial implementation of stacked graphs. Adds two new methods,
set_stack (false by default) and set_stack_colors (i.e. {"red",
"white", "blue"}). The order of the colors matters, because the
add_value method now accepts an (optional) last argument, an index of
a color from your stack color group.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
Setting width or height (horizontal or vertical) to an arbitrary value
causes the wibox not to be stretched. Instead the align() function is
called, which might not modify any wibox property in many situations,
or none when align parameter was not provided by the user. The major
side effect is that wibox struts were never updated and clients
covered the wibox (until a first signal handler caused struts to be
updated).
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
Second implementation of the progressbar ticks. Adds set_ticks,
set_ticks_gap and set_ticks_size methods. Default gap is 1, size 4 in
respect to the default progressbar width of 100px.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
Return the label of the selected menu item as an argument for the
callback function
Signed-off-by: Pierre Mazière <pierre.maziere@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
Changing the width or height of a (right or bottom positioned)wibox,
after it was initialized, to a value different than used when it was
created would leave the wibox in a wrong position. Position was off by
as many pixels as the difference between the old and the new
value. Now every wibox is repositioned to reflect this new setup.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
The awful.widget.graph allows to change the maximum value a graph can
handle, thus allows users to use widgets and scripts that don't scale
the values down to 0 - 1 range. The progressbars did not allow this
and worked with a hard-coded value of 1.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
Commit 87070ca introduced support for access keys in menus. Chosen
character was "&", an XML entity that has potential to cause problems;
if a user tries to add multiple access keys or just put an ampersand
in the name of the item the menu will break. Breaking happened because
ampersands were not escaped - first one was substituted and the rest
were ignored, but not escaped which triggered a pango markup error.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
Commit a757dda replaced the awful.client.movetotag call with c:tags()
in the tag property handler. Which introduced a regression when more
than one screen is used. The awful.tag.withcurrent function was being
called even when there was a valid tag property. Now the clients
screen is set to the tag screen to ensure the client is moved to the
correct tag and screen.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
Changing screen focus to an empty tag leaves focus on a client on the
previous screen, if a tag with clients is focused next the focus
remains on the previous screen. Now awful.autofocus compares the tag
screen and clients screen to learn if the focus should be given to a
client on the focused screen. Client that gets the focus is selected
from history, as usual.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
We unregister the default awful.tag.withcurrent 'manage' signal handler
and have awful.rules.apply handle initial client tagging.
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This explicitly registers withcurrent(c) as a manage signal handler so
that it can be removed if necessary.
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
When both height and width arguments are provided to the function
new() there is a check to see if one of them was a screen percentage,
and is expected to be a string. If the user provided absolute pixels,
and argument is of type number awesome will crash. Now tostring is
used to sanitize the arguments during this check.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
awful.wibox.align() in 3.4.x gets the available screen area from
capi.screen[screen].geometry.
this can easily result in overlapping wiboxes since the work area
provided does not account for existing wiboxes.
In my configuration I use a vertical wibox positioned at the
right and it half-overlaps my top wibox because it is streched and
hard-coded to align at the middle.
Signed-off-by: Julien Danjou <julien@danjou.info>
Function wibox_update_strut would not take the border width into
account when calculating struts. When a wibox border was in use
clients would overlap the wibox. With a border of 1px we loose 1px of
the wibox, but as the wibox border increases it is "pushed" by the
border nearest the screen edge and clients steal more and more space.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
Commit 6c5d0ca9 introduced a side effect. If tooltip text isn't changed
place() function is not called. To prevent multiple place() set_geometry
calls that function when tooltip is not visible (before it appears to the
user).
Signed-off-by: Sébastien Gross <seb•ɱɩɲʋʃ•awesome•ɑƬ•chezwam•ɖɵʈ•org>
Signed-off-by: Julien Danjou <julien@danjou.info>