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>
X11 is a great protocol. When a window manager dies, it can make sure that
client windows don't get destroyed via the save-set. However, revert-to-parent
focus handling means that the focus now shifts to the parent which gets
destroyed and afterwards the focus is "none", which is a really bad state.
Fix this in two places:
First, when shutting down, we switch to PointerRoot mode. This makes sure that
the input focus follows the mouse pointer if no window manager is started.
Also make sure that we set the input focus the way we want it to be after start
up. This obviously cleans up any weird state which might exist before we manage
the input focus.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
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>
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>
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>
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>
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>
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>
We only need lgi for running, not for building. This means that our lgi
dependency is easily missed. This commit makes this dependency more explicit.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
* Add -O1 to make -wuninitialized work
* Remote -Wredundant-decls because it gave useless warnings
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
This just makes the code for ignoring screens on Xinerama apply to RANDR screens
as well. The code now also applies to protocol screens, but there is only ever a
single one of those, so nothing should change here.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The port to glib failed to actually watch the file descriptor for events and
thus awesome silently ignored all dbus messages. My bad.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit ports awesome from libev to the glib main loop. This means that
awesome has fewer dependencies, because we were already depending on glib before
and now no longer need glib.
However, the main reason for this change is that, thanks to lgi, we have glib
bindings for lua. This means that lua code can add all kinds of event sources to
the main loop (timeouts, fd watchers, SIGCHLD watchers, ....). Yay
Signed-off-by: Uli Schlachter <psychon@znc.in>