Commit Graph

6819 Commits

Author SHA1 Message Date
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 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
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
Daniel Hahler 9031a81396 doc fixes to awful.menu.clients 2015-12-12 20:12:08 +01:00
Dario Gjorgjevski c5ad6069d4 Add an optional filter to `awful.menu.clients` 2015-12-12 20:12:08 +01:00
Daniel Hahler ae5d4b5512 Merge pull request #571 from psychon/scrolling_layout
Add a scroll layout
2015-12-12 20:01:32 +01:00
Daniel Hahler 833b10eb9b Merge pull request #593 from psychon/editorconfig
Vim modelines and editorconfig
2015-12-12 19:13:53 +01:00
Daniel Hahler 981987764e Merge pull request #586 from psychon/widget_funcs
Widgets: set_width / set_height
2015-12-12 19:13:28 +01:00
Daniel Hahler 69da6ee0db Merge pull request #576 from psychon/spawn_exit_code
At exit code support to spawn
2015-12-12 19:10:48 +01:00
Uli Schlachter feb7b36728 Add an EditorConfig file
I didn't (and couldn't) actually test this in any way, but hopefully this makes
it easier to edit awesome's source without vim.

Thanks to Daniel Hahler for telling me about this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:48:42 +01:00
Uli Schlachter 63653bed76 Add the right vim modeline to all lua files
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:42:33 +01:00