Commit Graph

1158 Commits

Author SHA1 Message Date
Poggles bd05219a72 Make awful.layout.inc() accept a screen number
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-19 19:49:07 +01:00
Uli Schlachter f859131bf3 wibox.widget.systray: Properly work when rotated (FS#1115)
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>
2013-02-16 22:14:08 +01:00
Uli Schlachter f86a9c896c gears.wallpaper: Create smaller image surface (FS#1087)
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>
2013-02-12 15:15:16 +01:00
Felix Bier e4be0017ff Incorrect calculation of unused size (FS#1108)
Signed-off-by: Felix Bier <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-11 16:10:48 +01:00
Uli Schlachter fca2f3e58d gears.color: Accept cairo patterns as arguments
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>
2013-02-11 14:26:05 +01:00
Thomas Jost cd5180f60f gears.wallpaper: Add wallpaper.fit
Signed-off-by: Thomas Jost <schnouki@schnouki.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-10 17:38:19 +01:00
Alexander Yakushev b0a056f50a menubar: Treat KP_Enter as pressing Enter (FS#1072)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-10 17:01:41 +01:00
Ignas Anikevicius (gns_ank) 9631ada0d2 Menubar utils fix the wm_name matching once more.
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>
2013-01-10 16:45:05 +01:00
Uli Schlachter 6608b0aa1c wibox.layout.align: Give middle widget full height
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>
2013-01-08 22:06:25 +01:00
uzsolt 23fe017bd4 fix locale problem (decimal separator isn't dot but comma)
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>
2013-01-06 12:08:02 +01:00
Lukáš Hrázký 02ea5f9b23 awful.widget.common: remove unsed function
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký dd29a41c4e tasklist: add a theme option for a plain task name
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>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký 66e52229f7 wibox.layout: add a new constraint layout
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>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký 4463f89b15 {tag,task}list: add update_function and base_widget constructor arguments
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>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký 8560de597c wibox.layout.align: make the middle widget really centered
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>
2013-01-05 23:05:30 +01:00
Lukáš Hrázký e38651bafb wibox.layout.align: don't take up all space in the other axis
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>
2013-01-05 21:05:45 +01:00
Lukáš Hrázký f6d9443c5d wibox.layout.flex: fix the fit function
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>
2013-01-05 21:04:48 +01:00
Lukáš Hrázký 9d333113dd wibox.layout: remove unnecessary wrapping of draw and fit functions
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:59:42 +01:00
Uli Schlachter 987c2b9b30 awful.screen.getbycoord(): Always return a valid screen
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>
2013-01-05 20:56:20 +01:00
Uli Schlachter 1fa23fef81 awful.tooltip: Don't place tooltips when text changes
The tooltip is now only placed when it is made visible, not while it is
invisible.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:54:38 +01:00
Uli Schlachter 3a25e78224 wibox.layout.rotate: Add some good constructor arguments
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:52:00 +01:00
Uli Schlachter ae69b2db03 wibox.layout.base: Use math.min/max
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-01-05 20:50:17 +01:00
Uli Schlachter 7d1a963352 awful.placement.no_offscreen: Fix border handling (FS#1065)
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>
2012-12-16 18:11:57 +01:00
Uli Schlachter fdfb7c5bb5 naughty: Fix docs a little
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-16 11:40:06 +01:00
Daniel 29b56fd051 Expose naughty.notifications again
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-16 11:36:39 +01:00
Uli Schlachter 823cd10be7 awful.widget.button: Fix name clash (FS#1064)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-15 10:08:23 +01:00
Uli Schlachter 487fb3f945 mouse.resize: Allow resize across screens (FS#1059)
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>
2012-12-14 19:38:30 +01:00
Björn Åström 6db7bdfcb9 Fix minimizedcurrenttags filter with sticky clients
Sticky clients showed up in the tasklist without being minimized when using the minimizedcurrenttags filter.
This patch fixes that.

Signed-off-by: Björn Åström <bjoast@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-13 18:01:40 +01:00
Uli Schlachter f6b43a1f1d Fix wibox.layout.rotate
This got broken in commit 90f7f55348.

Thanks to crazedpsyc for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-05 17:35:08 +01:00
Arvydas Sidorenko f57bd595dc Improved .desktop parsing (FS#1057)
When parsing .desktop, we care only about [Desktop Entry] group.
Everything else is ignored.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-01 16:25:59 +01:00
Arvydas Sidorenko 56170db631 Renamed string.gfind to string.gmatch
Lua 5.1: string.gfind renamed to string.gmatch
Lua 5.2: string.gfind removed

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-01 14:19:10 +01:00
Uli Schlachter 4c094a279d Fix various instances of global variables
The modules awful.menu and awful.util were placing variables in the global
environment which is a bad thing. Fix this by adding the right module name
prefixes to these variables.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-30 22:46:55 +01:00
Uli Schlachter e24c09e828 Update titlebar color when focus changes (FS#1056)
The current code relied on some widget to cause a redraw when the focus changes.
Obviously, this assumption is wrong.

Instead, the code now uses the proper "focus" and "unfocus" signals for setting
titlebar colors, but it also needs to set these colors when a new titlebar is
created (v1 of this patch forgot that). For this reason, update_colors has to be
saved for when a titlebar's colors are updated.

This commit also reverts the ugly redraw_hook hack from commit a1918b8306.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-29 16:52:19 +01:00
Uli Schlachter c50d62749b Fix errors from missing themes
This patch gets rid of lots of errors that happen when beautiful.init() is not
called in the config. Most of them were missing default values.

Thanks to panthar for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-27 22:55:42 +01:00
Uli Schlachter b7eb233aee imagebox: Use a different entry for saving the image
In 3.4, an imagebox' image is set via "box.image = foo". Since widgets are just
ordinary tables in 3.5, this will actually mess with the imagebox' image without
setting it correctly.

Fix this by renaming the entry to "_image".

A similar patch was applied to the textbox widget ages ago.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-27 17:24:54 +01:00
Uli Schlachter fbecd40c62 awful.menu.clients: Fix client icons
This was passing c.icon as the icon of a menu entry. However, this is just a
light userdata which has to be turned into an lgi cairo surface object. Luckily,
surface.load() does that for us.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-25 21:18:23 +01:00
Uli Schlachter fd1e751919 awful.menu: Handle themes without border_width
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-25 19:17:27 +01:00
Uli Schlachter fa6d996c41 widgets: Add some constructor arguments
This saves space when constructing widgets, because some common cases can now be
done in a single line of code.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-25 19:16:31 +01:00
Gregor Best 2badbed440 Menubar: silence find warnings
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-24 18:15:35 +01:00
Gregor Best d3a05e4822 Menubar: also look in /usr/local/share/applications
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-24 18:15:34 +01:00
Gregor Best 6b4d839fef Menubar: don't die if there's no item selected
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-24 18:15:34 +01:00
Ignas Anikevicius (gns_ank) 633e8f2f06 Menubar: Expose the wm_name attribute
This commit makes it possible to change the wm_name attribute, which
means that programs can be shown/hidden according to the wishes of the
user.

Possible usecase: A user is using Gnome and Awesome together, but sinc
wm_name by default is awesome, all the apps shipped with GNOME DE are
hidden by default. Changing wm_name attribute in this case would solve
the issue.

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-22 14:12:35 +01:00
Uli Schlachter 38c41a2f7a awful.client.toggletag: Use tag.getscreen()
Thanks to muni for reporting this bug.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-19 18:56:18 +01:00
Uli Schlachter d13b825c36 Fix warnings from LDoc
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-19 15:35:32 +01:00
Uli Schlachter 96e03cb45d Lots of random documentation fixes
This is mostly about mis-named parameters, but also other small things.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-19 14:09:10 +01:00
Uli Schlachter 5ea174782d Also make gears.object more object-y
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-19 13:40:37 +01:00
Uli Schlachter 90f7f55348 wibox: Make the functions a little more object-y
This replaces lots of function foo.bar(this, ...) with function foo:bar(...).
There should be no other changes in this commit.

The point is to make it easier for api documentation tools to figure out that
these are methods on objects.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-18 20:44:03 +01:00
Uli Schlachter ee46c9e5ae naughty: Correctly handle rowstride on icons
The notification spec allow sending icons as data with a dbus message. The
rowstride for this can be set which means there can be bytes after each row of
icon data which must be ignored.

Before this commit, naughty wasn't properly ignoring these garbage bytes which
resulted in weird notifications.

Thanks to dadrc for reporting that gmusicbrowser's notifications didn't work.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-17 21:37:40 +01:00
uzsolt 6a6e49accd fix awful.util.table.join if first arg is null (#1052)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-11 22:16:57 +01:00
Josh Komoroske 8e35e1a6a9 Fixed window gaps in the "fair" tiling mode.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-10 21:48:46 +01:00