Drawables could never be garbage-collected, because of the "wallpaper_changed"
signal. The callback function for this signal kept a strong reference to the
drawable.
Fix this by putting all drawable's draw() methods into a weakly keyed tabled so
that the strong reference to them disappears.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Size hints should be applied to the "real" client geometry. That means the area
taken by titlebars should be ignored.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commits adds the necessary lua code so that we finally can have titlebars.
As the baseline for the needed functionality, the titlebar code in awesome 3.4
and a quick poll on the mailing list were used.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signals are emitted on individual objects and on the class for a while now. This
can be used to simplify this function a lot.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This new property is used for fixing some missing redraws that the old code had.
Those could be seen via awful.menu. Open and close a submenu repeatedly and the
submenu will appear black.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes it possible to add titlebars to a client. These titlebars are
drawables.
The drawin's input handling is moved to the drawable. This allows it to use the
same code for drawin and titlebar input handling, although there are lots of
differences between the two on the C side.
On the lua side, a new wibox.drawable module is created which handles all the
drawable-specific magic and which can also be used for titlebars.
Signed-off-by: Uli Schlachter <psychon@znc.in>
A drawable is something that you can draw to, just like a drawin. However, a
drawable isn't necessarily its own windows. This will later on be used to
implement titlebars where the titlebars are drawables.
Signed-off-by: Uli Schlachter <psychon@znc.in>
It helps a lot to know which signal does not exist. That should make it a lot
easier to look for the "guily" code without having to resort to the backtrace.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The wrong module names were introduced in commits:
0e2960ebf3 and
d799ac76aa.
Once fixed, client.lua and screen.lua mutually require each other, so we must
use a trick, and load the modules inside the functions that need them.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When changing focus to an other screen, awful.screen.focus keeps relative
position of the cursor, instead of moving to the top left corner. Does not
trigger mouse:enter and mouse:leave signals.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Added functions awful.client.focus.global_bydirection and
awful.client.swap.global_bydirection, that change focus and swap clients,
crossing screen boundaries.
Also modified awful.client.movetoscreen. Now calls awful.screen.focus.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The function awful.screen.focus_bydirection changes the screen focus
according to physical position. The code is based on
awful.client.focus.bydirection.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Add a parameter to configure menubar's prompt.
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
After the rewrite from modules they ended up being local, but should
be available to user externally.
Also remove unnecessary local context bindings.
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
dump_return is no longer local, so debug prefix must be provided
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This function is the counterpart of awful.client.setslave.
Windows is moved to the first position in the stack.
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
When a property is now set to a function, the function's return value will be
used for the value of the property. The function gets the new client as its only
argument.
There is no property which accepts a function as its value and thus this change
can't break anything (yeah, famous last words...).
This should fix half of FS#1011. Panels now don't get focused by awful.rules.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Without this, input handling is broken (draw_widget() registers each widget with
its position for input handling).
This also removes some unnecessary save()/restore() calls. Our caller (again
draw_widget()) already does that for us.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes tag.viewidx take a screen index rather than a screen object,
complying with its doc string. This fixes#963.
Signed-off-by: Felix Bier <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Currently it takes `require('lgi.version')`, converts it blindly to
number and compares with another value.
I am using lgi v0.6.1 and that is not convertable to number value,
thus tonumber() returns nil and crashes Awesome.
The fix is to take major and minor numbers only ignoring the rest.
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
From 55eb706b698c3b0c59559eff342d6ee59ec9e3f3 Mon Sep 17 00:00:00 2001
From: Arvydas Sidorenko <asido4@gmail.com>
Date: Sun, 17 Jun 2012 15:11:01 +0200
Subject: [PATCH] Calling naughty.notify without specifing module
Lua 5.2 port bug, which shows up on notify-send
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
awful.wibox.tasklist was overwritting `tags` variable breaking all the
functionality which uses it.
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
For example, the rightmost pixel of a border-less graph wasn't draw and all
drawing was shifted one pixel to the left.
Signed-off-by: Uli Schlachter <psychon@znc.in>
behavior before: draw fg color everywhere and draw each value inverted as bg color.
if not enough values available "remove" the free area (draw a big rectangle with bg color over it).
behavior now: draw each value onto background as fg stroke.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When something sends notifications which don't get mapped into some preset,
args.preset would be nil and indexing nil throws a lua error. Fix this by using
the default preset in that case.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The cairo bindings are quite new in lgi and thus we depend on a quite new
version of lgi. Older versions will fail with lots of weird errors, e.g.:
lib/gears/color.lua:61:attempt to call field 'create_rgba' (a nil value)
Signed-off-by: Uli Schlachter <psychon@znc.in>
Commit d14d6959ea caused every notify() call to fail with 'attempt to
compare number with nil' because the default_preset table no longer exists.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Many themes have prerendered icons of different sizes stored in
subdirectories named as '<size>x<size>'. By looking in these directories
when a specific icon size is specified, we can support themes in a
rather straightforward way.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Build the preset values by merging the default preset with the one
actually specified, falling back to the normal preset if no preset is
specified.
This allows changing the position/font/whatever of all notification by
only setting up the default preset value (modulo overrides in the other
presets), instead of having to manually set it in all presets.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of creating unused cairo image surfaces, we create our temporary layouts
now via the (PangoCairo) font map. Way less ugly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds the documentation about keybindings for luadoc.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
For example, I have some lua code which sets the border width based on the
number of visible clients. When just a single client is visible, the border
width is 0, else it's what the theme says.
Previously, this caused visible "glitches" for fullscreen'd and maximized
clients. This patch fixes that and updates the client's geometry and
border width appropriately.
This has a slight chance of going into an endless loop if someone sets a
fullscreen'd clients border width from its property::border_width signal.
Just don't do that!
Thanks to Arvydas Sidorenko for finding this issue.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Patterns like
if condition then
return true
else
return false
end
could be simplified to
return condition
Signed-off-by: Felix <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds more navigation keybindings ('Home' and 'End'), which select
the first and the last entry from the list respectively. Also, it adds
two more keybindings:
'Ctrl+Enter' - Run the query (no need to press End and then
Enter)
'Ctrl+Alt+Enter' - Run query in the terminal (sometimes there are
terminal applications which one wants to run, e.g. ncmpcpp)
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
After some recent keygrabber changes the menubar's application
execution was broken. This commit fixes it.
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since we can search for commands in menubar and easily execute almost
any program now, we can definitely make use of awful.shell.completion,
which is enabled with this commit.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a 'Exec: <your-cmd-here>' item to the end of the list,
which appears only if there is at least one application entry in
the list. This is useful, when the program is not in the list of menubar
entries (e.g. it does not have a .desktop file).
When there is are no matching application entries, the 'Exec: ' item is
silently removed, as we already have the same in the prompt.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Should ideally have been removed in commit 'drawin: Remove bg_color property'.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
In commit "awful.client.setslave: Fix for not-visible clients", I copied some
code from awful.client.visible(). However, I missed that I where supposed to
change something in the code that I had copied. Whoops.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously, setslave() put a client only at the end of the list of visible
clients. Obviously this means that it didn't do anything helpful if the target
client was not visible.
Fix this by iterating over all clients on the target screen instead of just the
visible ones.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Enabling matching the command name of the menubar entries with the
query, which improves the flexibility of the widget. The functionality
works as follows:
You want to run GIMP, which has a name of "GNU Image Manipulation
Program". Previously by typing in gimp one would have <no matches>, but
now it will match GIMP entry.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
All of the capi should be in a capi table. This make the code more
consistent. Also, it is not worth importing awful.prompt as a different
variable as it is used only once. Calling it awful.prompt make the code
clearer as there are other variables called prompt.
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
this makes the use of cur_menu obsolete because now every menu and submenu gets its own keygrabber. there is no need anymore to track the latest opened menu globaly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
dump_raw function wasn't printing the plain (non-table) value if the
tag was not specified.
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
If you now set a wibox' background to e.g. "#00000080", the wibox will do fake
transparency and draw the wallpaper as its background.
This should cover 90% of uses of wibox transparency. For the remaining 10% I'll
wait for bug reports. :-)
Signed-off-by: Uli Schlachter <psychon@znc.in>
:lines() generator in parse_dir function was not used properly which
caused problems when using LuaJIT.
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit adds a new {bg,fg}_occupied option to the taglist. These control the
background and foreground color that unselected but occupied tags get in the
taglist. Occupied here means that at least one client is tagged with that tag.
Thanks to NougatRillettes for submitting this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The only caller of focus.history.add() should be the "focus" signal, so at that
time the unfocusable client already does have the focus. At that point, there is
no reason why this shouldn't be recorded in the focus history.
(And yes, unfocusable clients can be focused. Don't ask.)
This should hopefully fix FS#778.
Signed-off-by: Uli Schlachter <psychon@znc.in>
To avoid collision and confusion with other methods having the same name. So,
awful.client.cycle -> awful.client.iterate (renamed)
awful.util.table.cycle -> awful.util.table.iterate (renamed)
These methods were added in commit "add awful.client.cycle", and "add
awful.util.table.cycle".
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Menubar is a dmenu-like applications menu for Awesome
Signed-off-by: Alexander Yakushev <yakushev.alex@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
I simply moved out the code to 'jumpto' a client from
`awful.client.urgent.jumpto` into a separate function of its own so that it can
be reused.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
changed_callback allows to execute arbitrary code any time the
command string changes.
keypressed_callback allows to intercept keypresses before
awful.prompt.run code handles them and run arbitrary code depending on
the key pressed and modificators.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Returning true from the callback to `keygrabber` is no longer necessary to
continue grabbing the keyboard.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Returning true from the callback to `keygrabber` is no longer necessary to
continue grabbing the keyboard.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This was broken since 014d191f66 (which made this kind of stuff mandatory,
because 'return false' is ignored now). Whoops.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Fix this function so that it respects the recent changes in the ewmh.lua
code. It also incorporates some additional logic to respect the
border-width.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Previously we were not taking into account the border-width of the
client which we ought to as otherwise the client goes of the screen by
several pixels. It's slightly more ugly when we have several screens
connected.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes awful not to overwrite the saved geometry by just storing the
two geometries in separate places.
Signed-off-by: Uli Schlachter <psychon@znc.in>
I don't see why people would not want keyboard-enabled-menu by default.
Without it, you can't even use 'Escape' to quit the menu or press 'Enter' to
execute an entry. But instead of just enabling keyboard support by default, we
remove the option of disabling keyboard support altogether, which also
simplifies the implementation a bit.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The corresponding pattern factory that `string_pattern` delegates to is stored
in the `creator` parameter, and not `v`; probably a typo.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
add awful.client.cycle to iterate through clients that match a given condition
A common use case is to cycle through clients that match a given rule and take
certain action on them: raise, set or get property, etc.; see usage example in
the docs.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
add awful.util.table.cycle to iterate through elements that match given
condition
This will help writing concise code when one wants to apply a function to
(read, take some action) on a select list of elements in a table (of say,
clients and tags).
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Replaced all references to image_surface_create_from_png to
awesome.load_image
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
So the utility of `awful.placement` is not merely limited to client objects,
but also to wiboxes.
[us: use appropriate naming convention; catch misplaced statement]
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Given an object's coordinates, `awful.screen.getbycoord` can be used to
determine the screen than the object is, or should be attached to.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The `screen` property on wibox (drawin) was removed in the commit - 'drawin:
Remove screen property'.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Luadoc confuses '<stop>' with an HTML tag otherwise.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
In general, patterns are specified as 'type:arguments', where 'arguments' is
specific to the pattern used. The example provided in the documentation,
defined the pattern type to be 'linear', but used arguments meant to create
radial pattern. So we modify the example to use the correct type -- 'radial'.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The documentation for these functions were hidden (intentionally?) from luadoc
because of misspelt @class and @name tags. Fixed the spelling, so luadoc can do
its job.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Symbols (or, visual hints) used to indicate that a client is: 'ontop' or
'floating' or 'maximized_horizontal' or 'maximized_vertical', can now be
defined in the theme, or passed to awful.widget.tasklist() as the last, 'style'
argument (see docs).
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Most probably, the original author chose to use 'K' first, switched to
'myclock' later, and forgot to update remaining occurrences of 'K'.
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The default background color (None) means that the server will leave the
window's content untouched when an exposure happens. This should get rid of all
cases of "flashing window".
The real background will later be drawn while awesome is handling the expose
event.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Before this commit, a submenu was border_width pixels lower than its parent menu
entry. Fix this by not adding the border_width to the submenu's position.
We still have to add the border_width to the parent menu's width so that the
border of the submenu entry doesn't overlap the content of its parent menu (the
borders of the two menus do overlap!).
Signed-off-by: Uli Schlachter <psychon@znc.in>
Initializing the client property "floating_geometry" on the
property::geometry signal is problematic since this is emitted before
client_set_border_width(), causing the internal client geometry to get
stored and later passed to client:geometry() which assumes it includes
titlebar and borders.
Signed-off-by: Corey Thompson <cmtptr@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
If the first argument to cycle must be > 1 or else return nil
immediately.
Signed-off-by: Perry Hargrave <resixian@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
In the textbox' draw() callback we forgot to set the pango layout's width and
height. Whoops.
This was tested with the following code which makes it visible when the textbox
draws outside of its assigned space:
local w = wibox({ screen = 1 })
w.y = 10
w.x = 10
w.width = 150
w.height = 150
w.visible = true
local wi = wibox.widget.base.make_widget()
local t = wibox.widget.textbox()
t:set_markup("Foo <b>bar</b> <i>Foobar</i> und so weiter")
wi.draw = function(d, wibox, cr, width, height)
cr:move_to(24.5, 0)
cr:line_to(24.5, 150)
cr:move_to(0, 24.5)
cr:line_to(150, 24.5)
cr:move_to(124.5, 0)
cr:line_to(124.5, 150)
cr:move_to(0, 124.5)
cr:line_to(150, 124.5)
cr:set_line_width(1)
cr:stroke()
cr:translate(25, 25)
t.draw(t, wibox, cr, 100, 100)
end
w:set_widget(wi)
Signed-off-by: Uli Schlachter <psychon@znc.in>
Tagging sticky clients shouldn't hurt anything, but it helps a lot if the client
later becomes unsticky. I'd have no tags in that case.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of re-creating all the widgets for the list entries on each update, this
code now caches its widgets again and only creates new widgets when a new
client/tag appears.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:
#!/bin/ksh
git ls-tree -r HEAD | cut -f2 | while read f; do
egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
mv /tmp/foo $f
done
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>