Commit Graph

6877 Commits

Author SHA1 Message Date
Uli Schlachter 23d60b0659 gears.wallpaper: Remove some dead code
gears.surface now returns a fallback image surface that is good enough for what
this code tries to do here.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 17:39:52 +01:00
Uli Schlachter de6d9334d8 wibox.drawable: Handle gears.surface's new error handling
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 17:39:32 +01:00
Uli Schlachter 0a21931ffc awful.client.shape: Fix for API change in gears.surface
A nil-value is no longer simply passed through, so this has to do some "special
things" to work properly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 17:34:44 +01:00
Uli Schlachter a2c1106401 gears.surface: Also apply default when called with "nil"
Before this, calling one of the loading functions with a nil argument always
made it return the default 0x0 surface. With this change, the passed-in default
value is now properly applied.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 17:33:39 +01:00
Uli Schlachter e7a8df2920 naughty: Follow textbox API change
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 16:51:07 +01:00
Uli Schlachter b3ab06896d awful.widget.common: Follow :set_markup() API change
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 16:50:03 +01:00
Uli Schlachter 178204449c Textbox:set_markup(): Print errors to stderr
Instead of throwing a Lua error, the code now just prints an error message to
stderr on invalid markup. For callers which want to handle this case specially,
we add :set_markup_silently() which returns error messages.

Fixes: https://github.com/awesomeWM/awesome/issues/546
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 16:47:27 +01:00
Uli Schlachter 781f8d30bb test/run.sh: Handle updated beauitful.init call in default config
While setting up an environment to run the integration tests in, the run.sh
script uses sed to generate versions of several files that refer to the
not-installed version of files. One of these needs to replace the call to
beautiful.init().

Before commit 20c9723c5b, the corresponding line was:

  beautiful.init("@AWESOME_THEMES_PATH@/default/theme.lua")

Now this wants to find and replace the following:

  beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua")

To handle both versions, this commit adds some wildcards to the sed-expression
so that any line containing a call to beautiful.init is found and replaced.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 16:16:39 +01:00
Uli Schlachter 62495daa66 Merge branch 'naughty-version' of https://github.com/psychon/awesome 2016-01-17 16:01:18 +01:00
Uli Schlachter 3793c339ce Merge branch 'surface-errors' of https://github.com/psychon/awesome 2016-01-17 16:01:03 +01:00
Uli Schlachter fd8d35cb12 Merge branch 'async-spawn-optional-callbacks' of https://github.com/actionless/awesome 2016-01-17 16:00:39 +01:00
Uli Schlachter ab5f9d3d74 Merge branch 'handle_long_colors' of https://github.com/psychon/awesome 2016-01-17 16:00:19 +01:00
Uli Schlachter 2ab98f5e4a Merge branch 'rgb-xresources' of https://github.com/actionless/awesome 2016-01-17 16:00:11 +01:00
Uli Schlachter 1aed092fea Merge branch 'util-getdir' of https://github.com/psychon/awesome 2016-01-17 15:59:54 +01:00
Uli Schlachter 79d3dc003a gears.color: Add support for named colors
Oh hey, Pango exports an API that allows to query for named colors based on the
famous rgb.txt! Let's use that!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 14:27:29 +01:00
Uli Schlachter 0956aa01d9 Add support for short/long colors
This adds support to gears.color.parse_color to parse things like "#fff" (one
character per color component, without alpha) and "#ffff0000ffff0000" (four
characters per component, with alpha).

This makes sense on its own, but should also help with
https://github.com/awesomeWM/awesome/issues/585.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 14:16:40 +01:00
Emmanuel Lepage Vallee ab0e3b6112 tag: Refactor awful.tag.setproperty to call setters
*WARNING* This introduce a minor API break as awful.tag.setscreen
arguments are now swapped for consistency

This allow to introduce logic for each properties and improve
awful.tag.add and execute logic when setting properties.
2016-01-16 03:46:38 -05:00
Daniel Hahler 0d1c98a314 Merge pull request #618 from actionless/titlebar-optional-tooltips
feat(awful: titlebar): make tooltips optional
2016-01-15 21:36:30 +01:00
Daniel Hahler 68f44a9cbe Merge pull request #625 from actionless/fix-hotkeys-widget-multiscreen
fix(awful: hotkeys): caching on multiscreen setup
2016-01-15 21:31:58 +01:00
Uli Schlachter 1367968824 naughty: Don't try to parse our version number
The code here doesn't always work, so it's best to just don't mess with
awesome.version, but return it directly.

Fixes: https://github.com/awesomeWM/awesome/issues/569
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 20:12:19 +01:00
Uli Schlachter 82f74aa895 a_dbus_convert_value(): Be less strict about wrong strings
The code doesn't check the type of any of the values that it converts. However,
string elements are silently skipped if they cannot be converted.

The proper fix would be to make this code check types. For now, it will be ok to
"convert" non-strings to an empty string.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 20:08:34 +01:00
Uli Schlachter 76b1d348a1 imagebox: Remove dead code
Since some commits, surface.load() handles printing an error message for us.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 18:53:09 +01:00
Uli Schlachter 9d97a98b4d naughty: Remove dead code
Since some commits, surface.load_uncached() handles errors itself and thus we
don't have to print an error message here any more.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 18:53:09 +01:00
Uli Schlachter 4d562306d2 taglist: Remove dead code
The image "library" is long gone.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 18:43:56 +01:00
Uli Schlachter 86f2d05382 awful.menu: Remove useless surface() call
The imagebox calls surface() for us.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 18:43:10 +01:00
Uli Schlachter 58ecd92b8e Add better error handling to gears.surface
Previously, a Lua error was thrown when loading a file failed. Most callers are
not prepared for this and the result is less than optimal.

This commit makes the functions print the errors and return nil instead. For
callers that want to handle errors themselves, "_silent" variants of the
functions are introduced which just return errors to the caller.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 18:38:51 +01:00
Uli Schlachter 2e58a9c6eb awesome.load_image(): Return errors instead of "throwing" them
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 18:38:51 +01:00
Uli Schlachter 43896f68ca drawable.surface: Return nil if there is a surface
Before this commit, it would return a NULL pointer as a lightuserdata.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 18:38:51 +01:00
Uli Schlachter 8b3087dc4e Unmap the systray immediately when it becomes empty
The new widget layout code was created because we needed to support partial
redraws (only redraw the parts that were changed). Thanks to this, the code also
skips drawing widgets of size 0x0. Thus, when the systray becomes empty, it's
:draw() callback isn't invoked and thus our systray container window stays
visible.

Fix this by making the C code unconditionally hide the systray when it becomes
empty. There's nothing to display anyway.

Fixes https://github.com/awesomeWM/awesome/issues/624

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-15 17:21:26 +01:00
actionless f19b38d45b fix(awful: hotkeys): caching on multiscreen setup 2016-01-14 17:57:55 +01:00
Tristan B. Kildaire 55b90cbd30 awesomerc.lua: spelling fix in comment
Closes https://github.com/awesomeWM/awesome/pull/619.
2016-01-12 00:35:29 +01:00
Uli Schlachter 430f4fab15 Leave titlebars early
When a client is unmanaged, we know emit mouse::leave on its titlebar before the
client object is invalidated, so that Lua can still work with it. Before, this
event was emitted only when we got a LeaveNotify from the X11 server.

Fixes: #620
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-10 19:27:55 +01:00
actionless e74eb9775b feat(awful: titlebar): make tooltips optional 2016-01-06 17:09:55 +01:00
actionless 7546c236db feat(spawn, lib: awful: spawn: with_line_callback): make callbacks optional 2016-01-03 15:38:06 +01:00
Uli Schlachter 720cd879f3 Add timestamps to messages on stderr (#602)
Closes https://github.com/awesomeWM/awesome/pull/606.
Fixes https://github.com/awesomeWM/awesome/issues/602.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-31 15:38:17 +01:00
Kimball Thurston fc8c91c075 Fix focus handling with multiple awesome instances
When there are multiple X11 screens (i.e. :0.0 and :0.1) for zaphod mode
style X setups, this triggers a refresh of focus when the instance
running on a particular root receives the mouse

Fixes https://github.com/awesomeWM/awesome/issues/599.
2015-12-31 15:37:38 +01:00
Uli Schlachter 5e6a893207 Replace various calls to warn() with luaA_warn()
luaA_warn() prints a Lua backtrace and thus generates more useful output. warn()
should only be used in awesome-internal places (e.g. receiving an error from the
X11 server).

Closes https://github.com/awesomeWM/awesome/pull/608.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-31 15:35:13 +01:00
Uli Schlachter 5cbd4402d9 awful.autofocus: Handle sticky clients (#603)
Closes https://github.com/awesomeWM/awesome/pull/610.
Fixes https://github.com/awesomeWM/awesome/issues/603.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-31 15:33:51 +01:00
Emmanuel Lepage Vallee bd8e2d2ca8 typo: replace 'wibox' with 'context' where relevant
Closes https://github.com/awesomeWM/awesome/pull/613.
2015-12-31 15:33:22 +01:00
Daniel Hahler 9fec4f71bc Merge pull request #605 from psychon/api-doc
Fix API documentation broken in eb8577a424
2015-12-23 18:14:07 +01:00
Daniel Hahler 908950376e Merge pull request #609 from psychon/icons
Fix client icons
2015-12-23 18:10:18 +01:00
Uli Schlachter b2be471faf Fix icons
Since commit ea94f7f7e6, the code has a preferred icon size and it tries to
find the closest matching icon. However, the default size of 0 and thus this
never returned any icon at all (no icon matches better than an icon of size
0x0).

Fix this by saying "every icon is better than no icon at all".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-23 14:19:18 +01:00
Uli Schlachter daff5cd58b Refactor _NET_WM_ICON parsing
This shouldn't change the logic here, but hopefully makes it easier to
understand.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-23 14:16:24 +01:00
Uli Schlachter 16994f3b12 Fix API documentation broken in eb8577a424
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-22 18:31:48 +01:00
Uli Schlachter 4ad516c63a Remove some unused fields from globalconf
These fields were only ever written to since commit 19137a55c3.
This commit removes the fields and the code that sets them.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-22 17:25:45 +01:00
Uli Schlachter b70af4cf2b Fix regrabbing of keys on layout change
In commit 532ec0cd, we started grabbing keys on the client window directly
instead of its parent window (the frame window). This commit fixes one place
which was overlooked back then.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-22 17:24:01 +01:00
Daniel Hahler 0eac1ee91e Travis: use travis_retry with `apt-get update`
Ref: https://travis-ci.org/awesomeWM/awesome/jobs/96732636
2015-12-17 00:22:23 +01:00
Uli Schlachter a86d1137ee Select button press/release events on drawins
Some words about X11 event handling: Every X11 client can select input on any
window. For this, inside the X11 server each window has for each client a
bitmask for the kind of events that this client is interested in. When a mouse
button is pressed inside of a window, a corresponding event is generated for
that window and sent to all X11 clients which asked for
XCB_EVENT_MASK_BUTTON_PRESS. When no client is interested in this event, the
event is propagated to the parent window and the same procedure is done again
here. This continues up until the root window is reached.

Some words about the event masks that awesome uses: For clients, we ask for
button press events on the frame window that we reparent the client window into
so that we get any kind of press on the titlebar (and also events inside of the
client window if the client itself doesn't care for click events?). We are also
interested in button presses / releases on the root window. However, before this
commit, we didn't actually ask for button events on drawins (e.g. the wibox).
This worked fine, because no one asked for these events and the event propagated
to the root window where it was then sent to awesome.

However, newer Qt versions do something weird and the above broke. I don't
actually know what is going on. I know about the above propagation rules, but
looking at protocol traces of what Qt does, awesome should still get the button
events. During startup, Qt asks for button events on its own windows. After a
hotplug event, it asks the same again, but now also includes the root window.
So... how can Qt asking for button events on the root window cause awesome not
to get them? I have no idea.

(And yes, I guess that Qt asking for mouse events on the root window is a bug,
but I have no idea how exactly this happens nor about any other side effects of
it).

This commit makes us ask for button events on our drawins so that the server
will send them to us. This is the right thing to do anyway and it was reported
to have some positive effects.

Ref: https://github.com/awesomeWM/awesome/issues/415
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-13 18:10:29 +01:00
Daniel Hahler 15a242d195 Merge pull request #578 from lukash/client_icon_size
Add an option to set the preferred client icon size
2015-12-13 15:41:13 +01:00
Daniel Hahler f7fcee76df Merge pull request #594 from blueyed/pr-552
Add an optional filter to `awful.menu.clients`
2015-12-12 21:19:32 +01:00