Commit Graph

2077 Commits

Author SHA1 Message Date
actionless c9fbecd1e8 refactor(awful: widget: calendar_popup): s/_calendar_clicked/_calendar_clicked_on/ 2017-09-01 22:43:57 +02:00
actionless 23613bac05 fix(awful: widget: calendar_popup): hover was not working anymore if hiding popup by clicking on it 2017-09-01 22:43:07 +02:00
Yauhen Kirylau 9e4446060e feat(awful: widget: calendar_popup: attach): implement 'on_hover' option (#2008)
* feat(awful: widget: calendar_popup: attach): implement 'on_hover' option

* feat(awful: widget: calendar_popup): smarter handling of click and hover at the same time
2017-08-27 21:01:24 +02:00
Yauhen Kirylau fd66d12a4b feat(awful: widget: calendar_popup): implement 'margin' widget property (#2010) 2017-08-27 14:23:43 +02:00
Emmanuel Lepage Vallée ec08af4e76 clienticon: add a client setter (#2018)
It's required to work with the declarative syntax and be used
in the tasklist due to its limitations.
2017-08-27 14:23:06 +02:00
Daniel Hahler aa1ff23b19 Merge pull request #1992 from Veratil/string-funcs
Add two new gears.string functions: startswith, endswith.
2017-08-21 21:11:25 +02:00
Daniel Hahler 784472f212 doc: improve/fix doc for awful.rules (#2005) 2017-08-20 13:37:03 -04:00
Emmanuel Lepage Vallee 2303e31355 mouse: Fix a bad refactoring
The `wibox_under_mouse` property was renamed `current_wibox` but
a call wasn't updated.
2017-08-19 22:50:17 -04:00
SpiritCroc a20dd4ad61 KeyboardLayout widget: add EurKey (#2003) 2017-08-17 17:21:40 +02:00
Kevin Zander 5d0e9fd9e3 Add startswith and endswith function to gears.string, change awful.completion to use startswith over local function 2017-08-14 10:48:12 -05:00
Nick Diego Yamane bfe58d65f1 docs: fix some typos/leftovers (#1989)
Signed-off-by: Nick Yamane <nick.diego@gmail.com>
2017-08-14 16:06:44 +02:00
Uli Schlachter 8166e2ff8b Fix the example in the tooltip docs (#1980)
Reference: https://github.com/awesomeWM/awesome/pull/1978
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-13 12:23:40 +02:00
Daniel Hahler 31e25dc6a5 Cleanup usages/patching of awful.util.deprecate (#1966) 2017-08-10 12:18:54 +02:00
Florian Gamböck 0bd74b4f72 Append slash on true local directories
A slash must only be added if the current completion item starts with
`./` and is actually a directory.
2017-08-09 21:20:22 +02:00
Florian Gamböck 7c677e01cc Replace os.execute with gfs function 2017-08-09 21:20:22 +02:00
Florian Gamböck e8ad3a32f5 Add string helper function
This function returns true if a string starts with a given prefix.
2017-08-09 21:20:22 +02:00
Florian Gamböck 1802a44018 Import gears.filesystem
This is needed for some future filesystem checks.
2017-08-09 21:20:22 +02:00
José Romildo Malaquias 0def266c84 Add entry for menu font in theme (#1961) 2017-08-07 14:36:40 -04:00
Emmanuel Lepage Vallée 90e8b67d37 Merge pull request #1960 from psychon/fix-some-leaks
Fix some leaks
2017-08-07 14:36:08 -04:00
Daniel Hahler 828eefed79 awful.tooltip: border: do not default to border_width (#1955)
Several themes use `dpi(2)` which is quite thick, and it is better to
use the default of 0 here, instead of `beautiful.border_width`, which is
meant for borders on clients.
2017-08-05 16:07:47 +02:00
Uli Schlachter 0da790c026 awful.tooltip: Finish temporary image
For setting the shape of the tooltip, this code creates an image surface
describing the wanted shape. After this commit, this image surface is
finished when it is no longer needed. This results in most of the
image's memory to be freed immediately instead of only later when the
garbage collector collects the image surface.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:16:12 +02:00
Uli Schlachter 11216d8ca4 awful.mouse.snap: Finish temporary image
This function creates a temporary image surface to set the shape of a
wibox. After this commit, the image is now finished after use. This
results in most of the image's memory to be freed immediately instead of
waiting for the garbage collected to collect it.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:14:51 +02:00
Uli Schlachter efb8134815 awful.client.shape: Finish the shape image when done with it
This function queries the shape of a client and then does something with
it. This commit makes sure the image is finished afterwards, which means
that most of its memory is released immediately instead of waiting for
the garbage collector to collect it.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:13:22 +02:00
Uli Schlachter 60b5df1308 awful.tag: Apply a default layout to tags (#1952)
Related-to: https://github.com/awesomeWM/awesome/pull/1950
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-29 13:58:45 -04:00
Uli Schlachter acc012353d Make keyboardlayout widget more robust (#1941)
I am not sure what exactly goes on in the below bug report, so this will
just paper over the problem. I still think that this patch is a good
idea even when it is not a proper fix, since keyboard layouts are
complicated and so this code should be robust and hard to break.

Fixes: https://github.com/awesomeWM/awesome/issues/1933
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-25 18:17:32 +02:00
Uli Schlachter ee1dc78434 awful.tooltip: Set wibox.type = "tooltip"
Fixes: https://github.com/awesomeWM/awesome/issues/1938
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-24 07:52:55 +02:00
Jan Larres 458981710c Treat certain layouts as single client for gaps (#1914)
When gap_single_client is set to 'false', no gap is used when only one
client is shown in a tag. Since the max layout only ever shows one
client at a time it makes sense to apply this setting for this layout
regardless of the actual number of clients in that tag.

Additionally, if the 'master_fill_policy' property is set to
'master_width_factor', then use a gap even if there is only one client
visible and 'gap_single_client' is false.
2017-07-20 21:21:51 +02:00
mqus bd5f0dd3fc Fix calendar_popup.lua documentation
There were multiple things which stood out to me, as I was trying to setup a simple calendar popup for my textclock:
1.: The functions in https://awesomewm.org/doc/api/classes/awful.widget.calendar_popup.html#Functions were not named correctly (calendar vs calendar_popup) which (naturally) produced an error when used as awful.widget.calendar.month() .
2.: The example for calendar_popup.month() was obviously missing a line (where does the month_calendar come from?) . Resolved by copying the line from the attach-example
3.: The same examples also only refer to the function as calendar.month() which should be changed to awful.widget.calendar_popup.month()
2017-07-19 17:22:31 +02:00
Uli Schlachter d72893692e calendar_popup: Fix method name entries
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-09 18:59:17 +02:00
Uli Schlachter 9519d666a3 calendar_popup: Fix style documentation
Fixes: https://github.com/awesomeWM/awesome/issues/1899
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-07-09 18:36:04 +02:00
Daniel Hahler 4eddfacf51 lib/awful/completion.lua: handle missing SHELL environ var (#1897) 2017-07-03 19:26:10 +02:00
Daniel Hahler d4924988df rules: switchtotag: fix usage of awful.tag.viewmore (#1895)
This passes in the client's screen for now.

In the long run this should get fixed via
https://github.com/awesomeWM/awesome/issues/1883, but that is more
involved.

Fixes https://github.com/awesomeWM/awesome/issues/1886.
2017-07-02 11:26:41 +02:00
Daniel Hahler 6d5cf6cdbb Merge pull request #1736 from blueyed/completion-zsh-nullglob
awful.completion: zsh: fix command completion from PWD
2017-06-27 08:01:46 +02:00
Daniel Hahler 3e305a7272 minor: check textbox earlier, whitespace 2017-06-27 00:04:40 +02:00
Daniel Hahler 5dcd5969be awful.prompt: fix Shift-Tab
1. before this patch the "Shift" key(s) to get to Shift-Tab would reset
   ncomp already.
2. "Shift-Tab" will come in as "Tab" with mod.Shift typically.
3. cur_pos and ncomp have to get reset in case of going back to the
   original entry.
2017-06-27 00:04:40 +02:00
Daniel Hahler 4c792b49a9 awful.completion: handle first word as command always
This is necessary for `./*`, but should apply in general.
It was changed in 3986409e, but there is no argument for it in the
commit (message) really.
2017-06-26 22:45:11 +02:00
Daniel Hahler 2a69ffa374 awful.completion: zsh: fix command completion from PWD
Fixes https://github.com/awesomeWM/awesome/issues/1734.
2017-06-26 22:45:11 +02:00
Daniel Hahler 956ac3c50d awful.completion.shell: fix cur_pos return value 2017-06-26 22:45:11 +02:00
Daniel Hahler a6c36a4a2e awful.spawn: fix doc for spawn.easy_async{,_with_shell} (#1877)
Using `@function` in 547c0e4b was wrong.
2017-06-26 22:44:08 +02:00
Luke Bonham 547c0e4b83 awful.spawn: add easy_async_with_shell and fixed easy_async doc (#1541) 2017-06-26 21:15:58 +02:00
Daniel Hahler 9cd26cd274 doc: fix awful.completion.shell (#1866) 2017-06-26 20:40:56 +02:00
Emmanuel Lepage Vallée ba78882cb3 Merge pull request #1834 from Elv13/fix_896
layoutbox: Use a textbox as the fallback when no images are found
2017-06-21 03:16:28 -04:00
Emmanuel Lepage Vallee 10acd82968 layoutbox: Use a textbox as the fallback when no images are found
Fix #896
2017-06-20 18:22:23 -04:00
Emmanuel Lepage Vallée cded8b0837 Merge pull request #1857 from psychon/awful_tag_new
Fix #1853
2017-06-20 04:20:06 -04:00
Uli Schlachter 20d15b8be6 awful.tag.new: Handle too few given layouts
When awful.tag.new() got a list of layouts shorter than the list of
names, it would previously create tags with nil as their layout. This
commit changes this so that the first layout is repeated if necessary.

Related-to: https://github.com/awesomeWM/awesome/issues/1853
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-20 09:44:02 +02:00
Uli Schlachter de05ee6678 awful.layout: Apply layouts in a protected context
If an error occurs while a layout is being applied, arrange_lock could
get stuck at true, meaning that no more re-arranges will happen, thus
breaking the whole layout machinery.

Such errors could happen because the layout itself produces an error,
but also because a width is too large and c:geometry() throws an error.
Thus, this commit moves all of the actual "apply a layout"-code into a
protected context.

Fixes: https://github.com/awesomeWM/awesome/issues/1853
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-20 09:41:59 +02:00
Tim Roes f8a9b9891d Add missing awful.widget.common require (#1850) 2017-06-15 18:47:48 +02:00
SammysHP 44dbb24570 Fix documentation of activation filter
Previously the `force` hint was described incorrectly.
2017-06-14 11:34:56 +02:00
SammysHP ed230af953 Fix documentation 2017-06-14 10:42:50 +02:00
Yauhen Kirylau c5e830cd60 fix(awful: hotkeys_popup: keys): require all modules in init.lua 2017-06-12 20:39:46 -04:00
nahsi d368cee8aa hotkeys-popup: tmux hotkeys
Closes https://github.com/awesomeWM/awesome/pull/1830.
2017-06-12 23:03:43 +02:00
getzze 39efa6bbf9 awful: Add a calendar popup widget 2017-06-12 02:58:06 -04:00
Emmanuel Lepage Vallée 410e1a9969 Merge pull request #1835 from Elv13/fix_1795
doc: Fix a taglist copy/paste oversaw
2017-06-11 17:20:22 -04:00
Emmanuel Lepage Vallee 212cb84782 doc: Fix a taglist copy/paste oversaw
Fix #1795
2017-06-11 01:23:36 -04:00
Emmanuel Lepage Vallee 1839c4ecaa tag: Save history after the first iteration
Fix #1651
2017-06-10 23:52:13 -04:00
Emmanuel Lepage Vallee 9c77aa58c5 rules: Replace switchtotag implementation with awful.tag.viewmore.
Fix #1493
2017-06-10 23:50:27 -04:00
Simon Désaulniers ffead7dcda hotkeys_popup: keys for qutebrowser (#1829) 2017-06-11 00:10:42 +02:00
Emmanuel Lepage Vallée 7c44b05deb Merge pull request #1825 from psychon/magnifier-relayout
Re-arrange the magnifier layout on focus changes
2017-06-09 05:24:38 -04:00
Emmanuel Lepage Vallée 1a5d9d09fd wibar: Fix with width and height beautiful properties (#1826)
There was code that always set the values. The fallback was never
executed.

Fix #1824
2017-06-09 05:21:49 -04:00
Uli Schlachter 3bb8efd2db Re-arrange the magnifier layout on focus changes
Just re-arranging on every focus change would cause useless/needless
re-arranges (which have no effect except to waste CPU time). Thus, this
adds a special (undocumented) flag on layouts that makes sure that a
rearrange occurs when the focus changes.

Fixes: https://github.com/awesomeWM/awesome/issues/1799
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-09 10:13:14 +02:00
Uli Schlachter 9b991fb40b awful.menu: DPIfy the default menu size
Related-to: https://github.com/awesomeWM/awesome/issues/1807
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-08 17:12:15 +02:00
Caleb Maclennan ffca875633 Add aweful.util.pread() so API docs have deprication notice (#1502)
* Add awful.util.pread() so API docs have deprication notice

* Update util.lua

* Update util.lua

* Update util.lua
2017-06-06 00:55:11 +02:00
Daniel Hahler 105638e920 client: update_implicitly_floating on manage (#1803)
Ref: https://github.com/awesomeWM/awesome/pull/1748#issuecomment-304010490
2017-06-01 21:27:53 +02:00
BuildTools 37d2654d5d client: emit ewmh geometry requests as signals 2017-05-23 22:33:26 +02:00
Emmanuel Lepage Vallee 9bc46e4648 client: Honor the client maximization requests again
This implementes the FIXME added a few commits ago. A new
request::geometry handler turns client requests into normal
lua `c.maximized = true` property changes.
2017-05-23 22:33:26 +02:00
Emmanuel Lepage Vallee b570e6d347 client: Add request::geometry for client maximization
This way the correct logic can be implented in Lua
2017-05-23 22:33:26 +02:00
Emmanuel Lepage Vallée b6e6a04895 Merge pull request #1776 from psychon/emit_property_floating
Always emit property::floating when needed
2017-05-16 13:57:51 -04:00
Uli Schlachter 40e9393d94 awful.autofocus: Discriminate sticky clients (#1697)
A relatively common problem with awesome is with mixing sticky clients
and the focus history. Once a sticky client ever had the focus, it will
always get the focus after a tag switch. This is because the focus
history is global and the sticky client is always the most recently
focused and currently visible client in the list.

Work around this by discriminating sticky clients: First try to find a
client to focus, but ignore sticky clients. When this does not find
anything, try again, but this time also consider sticky clients.

(Basically the same issue exists with clients that are on multiple tags,
but I guess that one can be ignored.)

Fixes: https://github.com/awesomeWM/awesome/issues/733
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:32:28 +02:00
Uli Schlachter f22a69d54e Fix fullscreen clients with gravity != NorthWest (#1764)
Once upon a time, 4b9584fdb1 already fixed this problem: We have to
set the border width to zero before applying the new geometry to the
client, because changing the border width makes the client move
according to its gravity.

Then came e54387904b and made this code use awful.placement instead
of just fullscreening the client itself (without explaining why in the
commit message!). After this commit, the border width was just ignored
and left as-is. This was then fixed in 0bf8bb6a64 (no idea which
callback the commit message refers to, the old code was basically just
c.border_width=0, c:geometry(screen_geo)). However, now the border width
was again changed after the geometry and the bug that was fixed by
4b9584fdb1 was back.

This commit fixes this regression again by making sure that the border
width is set to zero before the geometry is set. This becomes slightly
more complicated, because now it is also awful.placement's job to
restore the old border width.

This is why this commit adds a new option to awful.placement so that it
sets the border width to zero after creating its memento of the old
border width.

Fixes: https://github.com/awesomeWM/awesome/issues/1607
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:31:14 +02:00
Quentin Minster 155c37e759 Fix single layout not appearing in the keyboardlayout widget (#1771)
Change indexing so that a keyboard map with a single group still gets
displayed in awful's keyboardlayout widget.

Signed-off-by: Quentin Minster <quentin@minster.io>
2017-05-13 23:25:09 +02:00
Emmanuel Lepage Vallee 0df1586f10 menu: Check if the client is still valid before accessing props
Fix #1777
2017-05-11 12:47:06 -04:00
Uli Schlachter e1bad41fc8 Always emit property::floating when needed
There are some cases where a client's floating state "silently" changes.
For example, a fullscreen client will be considered floating. However,
even though c.floating changes its value in this case, we did not emit
the property::floating signal.

Fix this by explicitly tracking the "implicitly floating" state. When
some property that influences this "implicitly floating" state changes,
we update it and if a client which was not explicitly assigned a
floating state observes a change in this value, property::floating is
emitted.

This was tested by running a terminal and two xeyes in a tag with a
tiling layout where awful.ewmh was patched so that clients do not change
their geometry when fullscreening or maximizing. It was observable that
after this patch e.g. the titlebar and the tasklist update to show the
floating state of the client which became implicitly floating due to
being maximized.

Fixes: https://github.com/awesomeWM/awesome/issues/1662
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-11 16:22:16 +02:00
Daniel Hahler e0eb0f14b3 Merge pull request #1699 from psychon/cache-dirs
Some fixes and changes to cache dirs
2017-04-18 14:40:22 +02:00
Daniel Hahler a87387d9f3 doc fixes for awful.mouse.resize, awful.rules, awful.util (#1717) 2017-04-10 21:57:12 +02:00
Uli Schlachter 4d0c9eb86e Rename filesystem.mkdir to make_directories
The longer name is a bit more self-explanatory. The plural is meant to
indicate that this recursively creates missing parent directories and
does not just try to create the single given target directory.

Since filesystem.mkdir() is part of the v4.1 release, a deprecation stub
is needed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:20:50 +02:00
Uli Schlachter 87e69e8677 Add a header to hotkeys_popup.keys.firefox to make LDoc happy
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:18:07 +02:00
Uli Schlachter f8678d39a4 Fix parameters docs in awful.hotkeys_popup.widget
This fixes broken API docs introduced in commit c183588ba1.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:15:03 +02:00
Uli Schlachter 4bbedebea4 awful.prompt: Use g.filesystem.make_parent_dir()
The changes should not actually make a difference. If creating the
directory fails, the error will now be different, but that should be
about it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-08 11:02:01 +02:00
Jonathan c183588ba1 Allow to add group rules to hotkeys_popup default instance 2017-04-03 17:49:50 +02:00
Uli Schlachter e1b4f17e64 awful.ewmh.add_activate_filter: Fix doc example
I didn't actually test this, but at least this now looks like valid Lua
code to me, so this is definitely an improvement.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-02 18:20:48 +02:00
Kevin Zander 74fb39afbd Remove deprecated calls in tests
Change deprecated util.table call in lib/awful/widget/clienticon.lua to gears.table call
2017-03-30 23:07:20 -05:00
Kevin Zander 6cb2e0fa82 Fix some deprecated calls in code and docs
Add missing newline in test runner
2017-03-30 21:26:50 -05:00
Emmanuel Lepage Vallée 7818fd3dba Merge pull request #1666 from awesomeWM/doc_tag_signal
doc: Add 2 missing tag singals
2017-03-19 17:21:42 -04:00
Emmanuel Lepage Vallée 9aa801cc97 doc: Add 2 missing tag singals 2017-03-19 16:28:38 -04:00
Emmanuel Lepage Vallée 32341b1091 doc: find_by_name: Fix the doc
Swap the parameters the next time the API break / deprecation season is open.

This is indeed confusing, as reported on IRC. The screen is *not* optional,
`awful.tag.find_by_name(name)` wont work
2017-03-19 16:06:22 -04:00
Emmanuel Lepage Vallée b73f9e963c Merge pull request #1613 from SammysHP/spawn-cursor
Add beautiful property to control busy cursor during spawn
2017-03-17 15:15:19 -04:00
Kevin Zander 7687275607 Move awful.util.deprecate and awful.util.deprecate_class to gears.debug
Change all awful.util function calls to gears.debug function calls
Update all old deprecate calls to have deprecated_in=4
2017-03-15 20:08:22 -05:00
Kevin Zander 45dadde0dd Move filesystem functions out of awful.util into new gears.filesystem
Update awful.util filesystem function calls to gears.filesystem function calls
Rename getdir to get_dir for consistency
2017-03-15 13:46:33 -05:00
Lego Stax 7c775e967c Fix 'no such file' errors for icons (#1655)
Fixes https://github.com/awesomeWM/awesome/issues/1650.

Signed-off-by: Lego Stax legostax@gmail.com
2017-03-15 17:29:53 +01:00
Emmanuel Lepage Vallée 4a42ed0d44 Merge pull request #1636 from psychon/client-icons2
Add support for multiple client icons
2017-03-11 18:59:09 -05:00
Kevin Zander 2f105eac86 Move string functions out of awful.util into new gears.string (#1584)
Update deprecated awful.util string function calls to gears.string calls
2017-03-11 18:57:32 -05:00
Christoph Mertz 2d91d49b30 awful.screen.focus_bydirecttion: fix setting screen focus (#1635)
This was broken in 9cb60b8 in PR #1597 (from myself).

focus() is not defined on the screen instance as method
but on the screen module as function.

Signed-off-by: Christoph Mertz <chris@nimel.de>

Fix #1644
2017-03-09 00:07:35 -05:00
Kevin Zander 0066257a59 Move ensure_pango_color out of awful.util into gears.color
Update deprecated awful.util.ensure_pango_color calls to gears.color.ensure_pango_color calls
2017-03-08 15:28:48 -06:00
Kevin Zander c3461b535c gears: Move awful.util.table to gears.table (#1641)
* Move table functions out of awful.util into new gears.table

* travis: Use v9999 prefix for full requests

Make sure no newly deprecated functions are used

* Move all `awful.util.table.*` calls to `gears.table.*` calls
Move table test functions from awful/util_spec to new gears/table_spec
Change awful.util.subsets call to gears.math.subsets in awful/key.lua
2017-03-08 15:18:33 -05:00
Emmanuel Lepage Vallée d3ca6aa301 Merge pull request #1637 from psychon/deprecation_warnings
Fix some deprecation warnings
2017-03-07 18:43:32 -05:00
Uli Schlachter 73944dac00 Add awful.widget.clienticon
This adds a new widget that displays the icon of a client. This widget
tries to use the best fitting of the available icons.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-07 22:45:49 +01:00
Uli Schlachter 675b05ff34 fixup! Fix code using awful.util.round 2017-03-06 17:28:31 +01:00
Uli Schlachter dde71265c5 fixup! Fix code using awful.util.cycle 2017-03-06 17:28:08 +01:00
Uli Schlachter ad113fa3aa Fix code using awful.util.cycle
This gets rid of lots of deprecation warnings.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-06 17:15:40 +01:00
Uli Schlachter 6f803cf3b3 Fix code using awful.util.round
This gets rid of lots of deprecation warnings

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-06 17:11:05 +01:00
Kevin Zander ad3782b08a Fix typo in awful.tag.setmwfact 2017-03-05 18:04:33 -06:00
actionless e0f9245abc fix(awful: hotkeys_popup: vim): fix hotkeys for scroll line up/down 2017-03-05 22:01:11 +01:00
Christoph Mertz 9cb60b8130 awful.screen: extract screen:get_next_in_direction() (#1597)
This extracts the code for finding the next screen
from focus_bydirection to a separate method on
the screen object.

The main reason was to use the finding code without
actually changing the screen focus but this should
incidentally make the code slightly easier to test
as well since both concerns can be tested in
isolation.

Signed-off-by: Christoph Mertz <chris@nimel.de>
2017-03-04 22:16:15 -05:00
Emmanuel Lepage Vallée dacf22aae7 Merge pull request #1618 from legostax/master
Added _hover & _click to client buttons
2017-03-04 22:13:21 -05:00
Emmanuel Lepage Vallée 971adec0d0 Merge pull request #1622 from Veratil/fix-new-luacheck
Fix Luacheck 0.19.0 release Travis breaks
2017-03-04 13:32:53 -05:00
Daniel Hahler 0bd29ae1e9 Merge pull request #1580 from psychon/only_on_screen
Add a only_on_screen container widget
2017-03-04 04:06:21 +01:00
Kevin Zander 3f6df8ddee Fix Luacheck 0.19.0 release Travis breaks 2017-03-03 16:41:12 -06:00
Uli Schlachter 2b2612314c Add a only_on_screen container widget
Fixes: https://github.com/awesomeWM/awesome/issues/1565
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-03-03 13:25:28 +01:00
Kevin Zander d8f57e4997 Move math functions out of awful.util into new gears.math 2017-03-02 18:15:59 -06:00
Lego Stax cb311a5d61 Updated to comply 2017-03-02 16:01:22 -07:00
Lego Stax 8ffe4460d0 Added _hover & _click to client buttons
Every client button type (e.g. minimize, maximize_inactive, maximize_active, close) has the option to show a different icon when the mouse hovers over it or a "button::press" signal is sent.
Signed-off-by: Lego Stax legostax@gmail.com
2017-03-02 14:49:14 -07:00
Kevin Zander edd9415df6 Add a deprecated_in variable to util.deprecate args table (#1586) 2017-03-01 23:02:49 +01:00
SammysHP 2f0d0e37da Add beautiful property to control busy cursor during spawn 2017-03-01 21:57:59 +01:00
Emmanuel Lepage Vallée 2f34e69cab Merge pull request #1605 from legostax/master
Added disable_task_name property
2017-03-01 14:42:38 -05:00
Emmanuel Lepage Vallée ef668bc028 ewmh.tag: Fix the transient_for clients without parent client tags (#1610)
ewmh.tag: Fix the transient_for clients without parent client tags

Fix #1594
2017-03-01 14:11:38 -05:00
Emmanuel Lepage Vallée 3b0269d5e9 Merge pull request #1600 from Drauthius/master
Corrected selected check in awful.tag.set_screen()
2017-02-27 16:48:08 -05:00
Emmanuel Lepage Vallee 4e161d4a0a doc: Fix the variable names
It was still wrong
2017-02-27 16:20:47 -05:00
Emmanuel Lepage Vallee f24e957c17 doc: Fix wibar documentation
I got it wrong in the PR that introduced the beautiful variables.

Too much find&replace...
2017-02-27 16:12:37 -05:00
Emmanuel Lepage Vallée 8210b11ab0 wibar: Add beautiful variables (#1602)
* wibar: Add beautiful variables

This was done a few weeks ago for the notifications. This was
requested on IRC a while ago to have different font for the wibars.

Now that shapes are supported, it also makes more sense for the
border.
2017-02-26 15:56:09 -05:00
Lego Stax b54cf0330b Added disable_task_name property
style.disable_task_name and beautiful.tasklist_disable_task_name.  Suppresses display of a given client's name, but preserves the setting of tasklist_plain_task_name
2017-02-25 17:21:36 -07:00
Drauthius 28709c282e Corrected selected check in awful.tag.set_screen()
Previously it would check if the awful.tag.selected function existed,
and not whether the tag was actually selected.
2017-02-25 16:07:36 +01:00
morethanoneanimal 1c71260389 Replace improperly used asserts with warnings.
Add awful.spawn noop function to hooks.lua test. Previously it was nil.
2017-02-21 00:31:33 +01:00
Daniel Hahler a4b06bca58 awful.prompt.run: improve deprecation warnings (#1577) 2017-02-18 19:39:19 +01:00
Daniel Hahler bd02ee8558 minor: code style and comment fixes 2017-02-16 10:40:54 +01:00
Daniel Hahler 52011a68e1 util.deprecate_class: use raw=true always (#1564)
Fixes

> W: awful: function margin is deprecated, see wibox.layout.margin has been renamed to wibox.container.margin.

to

> W: wibox.layout.margin has been renamed to wibox.container.margin.
2017-02-15 19:45:23 +01:00
Emmanuel Lepage Vallee a158c3adab wibar: Fix a race condition when adding new wibars
Fix #1523
2017-02-13 21:01:13 -05:00
actionless f8d12a855f feat(awful: widget: promptbox): accepts `fg` and `bg` as arguments; improve docstring 2017-02-12 17:59:19 +01:00
Yauhen Kirylau 148723f053 refactor(awful: hotkeys_popup): expose configuration options for a widget instance and use more object-oriented structure for the widget (#1533)
* refactor(awful: hotkeys_popup): expose configuration options for a widget instance and use more object-oriented structure for the widget

closes #1352
closes #1497

* doc(awful: hotkeys_popup): add @beautiful docstrings

* fix(awful: hotkeys_popup): add label_bg for misc labels; improve @beautiful docstrings
2017-02-10 19:50:10 +01:00
copycat-killer 7a728cec6b awful.widget.watch: return timer too 2017-02-08 14:53:40 +01:00
Emmanuel Lepage Vallee 69f292a31f doc: Add basic documentation for the custom rules properties.
In the lack of a better documentation.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 477df4a35b maximized/fullscreen: Use relative coords when restoring size.
Also apply a copy of the memento instead of mutating the
original.

Fixes #1320
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 6da20bb301 rules.placement: Add properties to honor padding and workarea 2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 5f693ead30 rules: Move tags into the same group as tag
Unrelated to this PR, but found while doing a review.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 0bf8bb6a64 fullscreen: Add a beautiful option to remove borders.
This was previously done in a callback, but wasn't really
clean and/or bug free. Borders could end up leaking on other
screens as proven by an integration test.

Fix #171
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 4ea6e133f8 placement: Add some missing `ignore_border_width` checks.
It was done in some places, but not all.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 3a0f139b9e maximize: Officially honor screen padding
Add an option too.

Fix #1459
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee 631e75a757 ewmh: Use the request:: API in the border_width / wa callback
And stop listening to property::geometry, it's no longer needed.

This also remove messing up the border without saving it
somewhere. The concept is sound, but not the implementation.
2017-02-07 11:13:15 -05:00
Emmanuel Lepage Vallee d5b681502a maximize: Stop mixing horizontal, vertical and both.
Before this commit, do this:

    c.maximize_hoizontal = true
    c.maximize = true
    c.maximize = false
    assert(c.maximize_hoizontal)

Would not work because the states were not preserved individually.
This commit fixes that. Awesome wont be confused about it's own
state anymore.

This may seem pointless, but when it come to undoing these
maximizations, it was ambiguous.
2017-02-07 11:12:42 -05:00
Emmanuel Lepage Vallee 3b1599bd99 maximize: Stop doing it in 2 operations.
Before 4.0, maximizing could only be done in 2 operations.

4.0 add an unified way, but kept doing 2 operations. The old
Lua EWMH code to serialize the 2 operations was dropped when
the codepath was simplified and replaced by a generic version
in awful.placement. However this version never implemented
combining multiple mementos into 1.

This commit unify the maximize C code, drop the ugly macro
template and actually fixes a couple more issues that were
caused because request::geometry was sent twice.
2017-02-07 11:12:40 -05:00
Emmanuel Lepage Vallee 51ddb5639e mouse: Handle `maximized` client like `fullscreen` ones.
There is already a way to prevent them from moving them, but the
next few commits will remove it. There is no reasons to handle
this differently from fullscreen clients.
2017-02-07 11:12:40 -05:00
Yauhen Kirylau c1cd968803 import vim hotkeys from user config, not hotkeys_popup module (#1432) 2017-02-07 13:50:52 +01:00
actionless 3cc613fa20 test(awful: hotkeys_popup): add a minimal test 2017-02-05 21:32:43 +01:00
Uli Schlachter 130acf1c00 Fix client shape handling
The functions awful.client.shape.update.bounding and .clip handle both
the client's shape and the shape set by Lua. However,
awful.client.shape.update.all only handles the shape set by Lua and
ignores the client's own shape. This can easily be noticed with xeyes.
When update.all ran last and you move around xeyes, the wallpaper behind
it is moved along, because it is not actually outside of the window.

Fix this by partly reverting 1a5f6b7ad2 and having update.all just
call the other two functions again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-04 07:20:56 +01:00
copycat-killer 1a5f6b7ad2 client: Allow clients to have shapes
Also fixes awful.client.shape docs

Closes #1507
2017-02-03 17:48:28 -05:00
Emmanuel Lepage Vallée cbd22eea50 Merge pull request #1475 from psychon/input-shape-support
Input shape support
2017-02-03 12:25:56 -05:00
Uli Schlachter aaea976108 layoutbox: Update when a tag's screen changes (#1505)
In theory it would be enough to only update the old and new screen of
the tag whose screen changed. However, we cannot easily get the old
screen, so just update all layoutboxes.

Fixes: https://github.com/awesomeWM/awesome/issues/1503
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-02 22:45:33 +01:00
getzze c0c083bf7d hotkeys_popup: add custom keys to existing groups (#1504) 2017-02-02 22:44:24 +01:00
Kevin Zander e1aacfaa22 awful.wibar: move wibar:remove() call outside of loop over all wiboxes (#1501)
Removing a wibar mid-loop will corrupt the indexing of the for loop and can
cause other wibars from being removed.
2017-02-02 22:42:20 +01:00
Emmanuel Lepage Vallée 5439c34723 Merge pull request #1513 from Elv13/merge_copycat
object/client.c: added position and size properties
2017-02-02 13:29:42 -05:00
Luke Bonham ff47b0d0c4 object/client.c: added position and size properties
added client signals connection

added comments doc
2017-02-02 13:09:03 -05:00
actionless 79a60b3009 fix(awful: key): clone table with user data
closes #1401

fix(tests: awesomerc): use `awful.key.execute` instead of local helper function
2017-01-30 18:19:24 +01:00
Emmanuel Lepage Vallée a1a5e18b62 Merge pull request #1483 from blueyed/rules-remove-duplicate-placement
rules: remove duplicate handling of placement props
2017-01-28 21:55:13 -05:00
Holger Schurig bf2c1993db doc: fix signals (#1455)
- rule reordering was mentioned twice in the NEWS
- fix all shown luadoc errors
- add missing descriptions for signals in module "awesome"
2017-01-28 15:03:56 +01:00
Daniel Hahler b43918613a rules: remove duplicate handling of placement props
Fixes https://github.com/awesomeWM/awesome/issues/1481.
2017-01-27 18:00:19 +01:00
Uli Schlachter df8346ceae Merge branch 'export-paths' of https://github.com/psychon/awesome 2017-01-27 17:36:55 +01:00
Uli Schlachter 47d69e7824 Update docs for shape_input
I grepped for shape_clip and edited places that needed editing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-26 11:15:28 +01:00
Alexander Gehrke e2edabb8b1 ewhm: fix some transient windows not being movable to other screens (#1406) (#1452) 2017-01-25 12:11:11 +01:00
Uli Schlachter 288e44596f Export build-time paths as entries on awesome
This removes some @EXPANSIONS@ from Lua files and removes a hack that
was needed. All is better now! :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-25 09:41:11 +01:00
Daniel Hahler 90bbcf1903 awful.tag: handle invalid client in delayed_call (#1372)
A short-lived client (e.g. `urxvt -e false`) might be invalid already
when the delayed callback is called.
2017-01-23 22:53:01 +01:00
Yauhen Kirylau f9975f763c Avoid cyclic dependency between awful and menubar (#1433) 2017-01-23 22:51:41 +01:00
Emmanuel Lepage Vallée 193c73353f Merge pull request #1426 from SammysHP/prompt-customization
prompt: Make awful.widget.prompt themeable
2017-01-23 07:27:58 -05:00
SammysHP 37f0b7e3bf prompt: Make awful.widget.prompt themeable
Adds new optional properties to the theme:
    prompt_fg
    prompt_bg
    prompt_fg_cursor
    prompt_bg_cursor
    prompt_font
2017-01-23 13:15:09 +01:00
SammysHP 9553f616c0 doc: fix typo (#1430) 2017-01-22 21:57:26 +01:00
Emmanuel Lepage Vallee 7faac6b59f doc: Fix awful.tag.attached_connect_signal 2017-01-22 09:31:56 -05:00
Emmanuel Lepage Vallée e0bce2936f Merge pull request #1329 from Elv13/prompt_refactor
Prompt documentation & fixes
2017-01-22 09:14:00 -05:00
Emmanuel Lepage Vallee 2229d7aeed doc: Fix a copy/paste error in the master_count doc 2017-01-22 09:00:53 -05:00
Emmanuel Lepage Vallee 1c4b991e33 doc: Better document the prompt hooks 2017-01-22 01:14:20 -05:00
Emmanuel Lepage Vallee a6161d1229 tests: Test the prompt highligher 2017-01-22 01:14:20 -05:00
Emmanuel Lepage Vallee 2472201b71 prompt: Add command highlighter support. 2017-01-20 01:09:30 -05:00
Emmanuel Lepage Vallee 39f0a1c95c doc: Document the prompt callbacks 2017-01-20 01:09:30 -05:00
Emmanuel Lepage Vallee 928f7b04b4 prompt: Add a key filter example 2017-01-20 01:09:30 -05:00
Emmanuel Lepage Vallee f6cce940a5 prompt: Add a Vi like prompt parser
Otherwise hooks that modify the command are not documented well
enough.
2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 4934697817 prompt: Add a more complete hook example 2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 42205220dd prompt: Move the keybindings section to the header
This is part of a longer series of commit to expand the
documentation.
2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 53d32d362a prompt: Unit test the example 2017-01-20 01:09:29 -05:00
Emmanuel Lepage Vallee 856244723c prompt: Restore the ability to use hooks without exiting
It was in an earlier version of the patchset but was lost at
some point.
2017-01-20 00:22:49 -05:00
Yauhen Kirylau bfb3534955 doc(awful: hotkeys_popup): change variable names to fix ldoc result and add one missing docstring (#1396) 2017-01-17 10:13:26 +01:00
Emmanuel Lepage Vallée a9e8cc3dab Merge pull request #1404 from Veratil/tasklist-spacing-fix
Tasklist spacing fix + taglist spacing doc addition
2017-01-16 23:39:53 -05:00
Kevin Zander 44e0ea5681 taglist_shape_border_width_focus and taglist_shape_border_color_focus are not put into the correct variables 2017-01-16 11:18:47 -06:00
Kevin Zander 74b5ac72da Fix incorrect variable lookup for theme.tasklist_bg_image_* 2017-01-16 02:39:01 -06:00
Kevin Zander 56a2e98896 Add doc for taglist_spacing 2017-01-16 01:12:12 -06:00
Kevin Zander c3b565faab Fix theme lookup of tasklist_spacing; fix doc typo 2017-01-16 01:11:42 -06:00
Yauhen Kirylau f69769f7ba fix(awful: hotkeys_popup): use new widget api in pagination (#1384) 2017-01-11 13:12:38 +01:00
Daniel Hahler 83a118e421 awful.util.{get_themes_dir,get_awesome_icon_dir}: support env
Look at environment variables AWESOME_THEMES_PATH and AWESOME_ICON_PATH,
which allows to override this in the integration test runner.
2017-01-08 20:34:13 +01:00
rob 703b11182c taglist: added volatile tag theme variables 2017-01-07 21:21:46 -07:00
Emmanuel Lepage Vallee cefa14d1bd layout: Fix the magnifier layout
It was broken since the dynamic screen support was merged.

Fix #1338
2017-01-04 04:56:54 -05:00
Daniel Hahler 4b9e8e232d Merge pull request #1341 from psychon/modeline
Lots of fun with vim modelines
2017-01-02 19:56:06 +01:00
Uli Schlachter 2b79165622 Add missing vim modelines in lib/
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-31 14:07:13 +01:00
Daniel Hahler af961e974c doc: improve client.dockable (#1336) 2016-12-31 00:40:17 +01:00
Uli Schlachter e7b4898a7e Fix typo: Remove double tasklist_tasklist_ (#1323) 2016-12-28 22:25:23 +01:00
Daniel Hahler d13f465374 awful.screen: add stacked arg to some functions (#1301)
Fixes https://github.com/awesomeWM/awesome/issues/1300
2016-12-28 12:41:59 +01:00
Uli Schlachter bdb7e90b74 Fix classmod in awful.widget.keyboardlayout (#1314)
Fixes: https://github.com/awesomeWM/awesome/issues/1313
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-27 21:38:20 +01:00
Emmanuel Lepage Vallee 2b462cb2e3 doc: Document the tag `master_fill_policy` 2016-12-21 11:41:30 -05:00
Emmanuel Lepage Vallée 8935ed2a30 Remove traces of the old URL (#1280)
**WARNING**: This breaks the API
2016-12-21 02:03:03 +01:00
Emmanuel Lepage Vallee 5ff29bb00e doc: Document how to open a document using `awful.spawn` 2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallee 1efbb57049 doc: Add a little awful.spawn async tutorial 2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallee 7f1933f99c doc: Document when spawning with a shell is needed 2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallee b9dbc79308 doc: Add more `awful.spawn` documentation
It was lacking
2016-12-16 12:38:33 -05:00
Emmanuel Lepage Vallée 65ec764416 Merge pull request #1267 from Elv13/fix_rules_screen_mismatch
Fix more rules screen mismatch
2016-12-12 13:07:18 -05:00
Emmanuel Lepage Vallee 4b61dbba82 rules.tags: Behave like rules.tag
One did try to match tag by name and the other didn't.

While at it, also ensure that the screen is consistent.
2016-12-12 11:49:11 -05:00
Emmanuel Lepage Vallée f22c067efd Merge pull request #1265 from Elv13/improve_deprecation
Improve deprecation messages
2016-12-12 10:26:39 -05:00
Emmanuel Lepage Vallee c96aa9866e rules.tag: Prevent a screen mismatch
As c:tags() doesn't (cannot) check for screen mismatch, then it
has to be done.

This is a follow up of 6f7019b2d0, see #1236.
2016-12-11 22:50:00 -05:00
Emmanuel Lepage Vallee 828d6f2cd9 utils: Better class deprecation warnings
Fix #1228
2016-12-11 14:54:12 -05:00
Emmanuel Lepage Vallee e239492696 utils: Add optional awful.util.deprecate options.
For now, only a `raw` option is implemented.
2016-12-11 14:51:33 -05:00
Emmanuel Lepage Vallee 52fbf49309 prompt: Fix indentation
There was tabs mixed with spaces
2016-12-11 14:39:08 -05:00
Emmanuel Lepage Vallee 73afe0e954 doc: Add a prompt example. 2016-12-11 14:35:20 -05:00
Emmanuel Lepage Vallee 0e1c193450 prompt: Make exe_callback optional
The menubar already bypass it using keypress listener. Having an
empty callback is ugly.

Fixes #1180
2016-12-11 14:19:25 -05:00
Emmanuel Lepage Vallee 1eeaf6b9c9 doc: Add a missing awful.rule field 2016-12-11 00:10:39 -05:00
Emmanuel Lepage Vallee 5aa38f6fe5 doc: Add a missing ewmh handler documentation 2016-12-11 00:10:39 -05:00
Emmanuel Lepage Vallée 548b15e883 doc: Document the client layouts. (#1247)
This commit doesn't add any useful documentation, but adds
previously hidden documentation variables. It can be the basis
of a better layout documentation.

Fix #1246
2016-12-10 02:24:22 +01:00
Uli Schlachter 9a5092226a awful.wibox.stretch: Spell out full replacement
The function that is documented as awful.wibox.stretch is deprecated,
because it was removed (that's not a deprecation, is it?!?). For the
replacement, we used "@see stretch". However, LDoc was randomly
resolving this reference to awful.wibar.stretch (good) or
awful.wibox.stretch (bad; the see points to the element where it
appears).

Fix this by spelling out the "full name" of the function in the @see.

Related-to: https://github.com/awesomeWM/awesome/issues/834
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-09 18:03:03 +01:00
Uli Schlachter 480b8b6477 Remove @see tag.swap on awful.tag.object.swap
The only other swap function is awful.tag.swap and that one is
deprecated. Thus, it should not be linked to.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-09 18:00:40 +01:00
Emmanuel Lepage Vallée 883b5934c0 Merge pull request #1236 from Elv13/fix_new_tag_rule
rules.new_tag: Fix when the tag screen doesn't match the client
2016-12-01 19:53:17 -05:00
Michael Beaumont 4cb11b8754 Fix awful.tag.add ignoring props.index (#1245) 2016-12-01 22:04:57 +01:00
Uli Schlachter f9cdc98c73 Fix spawn callbacks
Spawn callbacks were never invoked when no startup-notification-rules were
given. This commit fixes the code so that "startup done" callbacks are also
called when no rules were given.

Fixes: https://github.com/awesomeWM/awesome/issues/1218
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-01 15:32:21 +01:00
MoreThanOneAnimal 51bbb53b30 Add references to gears.color in documentation. 2016-11-28 20:07:29 -08:00
Emmanuel Lepage Vallee 6f7019b2d0 rules.new_tag: Fix when the tag screen doesn't match the client
Also add the documented `props` argument to the high priority
rules.
2016-11-27 04:57:35 -05:00
Daniel Hahler fc13b1b4eb doc: s/Wether/Whether/ 2016-11-22 02:40:15 +01:00
Daniel Hahler 71259748d2 Minor doc and code style fixes
Closes https://github.com/awesomeWM/awesome/pull/1215.
2016-11-21 22:38:40 +01:00
Daniel Hahler aeab2a70e9 Fix whitespace warnings reported by luacheck (#1229) 2016-11-21 22:38:23 +01:00
actionless 3fea2db8c5 feat(awful: hotkeys_popup): add possibility to create new widget instance 2016-11-21 13:44:20 +01:00
MoreThanOneAnimal 61d4f4310a Use unmodified command for the command history.
Closes awesomeWM/awesome#1104.
2016-11-15 23:25:31 -08:00
Emmanuel Lepage Vallee 2d5a1798af doc: Document tasklist_plain_task_name
It was missing.
2016-11-15 16:33:20 -05:00
Daniel Hahler d0dc447dd5 Emit screen::arrange signal outside of arrange_lock (#1191)
This will handle changes in the layout recursively, e.g. when changing
the border_width of clients.

Ref: https://github.com/awesomeWM/awesome/issues/171#issuecomment-256146578
2016-10-26 16:20:34 +02:00
Uli Schlachter d07fc822a1 Fix awful.tag.object.get_gap_single_client (#1190)
The usual "a or b"-trick to simulate C's ?:-operator does not work when
"false" is a valid value. Fix the code to handle this correctly and add
a short unit test which would have caught this problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-26 01:43:45 +02:00
Uli Schlachter c1b6b204d6 awful.util.file_readable: Use Gio (#1187)
Instead of doing Linux-specific magic with error codes and trying to
read the first byte of a file, just use Gio to check if a file exists
and is readable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-25 00:23:18 +02:00
Uli Schlachter 70d4961a3e awful.spawn: Separate rules from callbacks (#1186)
When adding callbacks as a `callback` entry in a property, the callback
is run by `awful.rules`, because it does `c.callback =
result_of_function`. This is obviously not intended. Also, this causes
the callbacks to run twice, because the code already handled this
`callback` property specially.

Fix this by just not merging callbacks with the normal rules at all.

Fixes: https://github.com/awesomeWM/awesome/issues/1159
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-25 00:22:36 +02:00
Emmanuel Lepage Vallee 07f3a178fa prompt: Fix 2 deprecation warnings
An oversaw in a previous commit introduced deprecation warnings
on the default config.
2016-10-12 01:53:53 -04:00
Emmanuel Lepage Vallée de121975bf Merge pull request #1165 from psychon/fix-deprecation-warning
Corner layout: Fix deprecation warning
2016-10-10 18:01:32 -04:00
Uli Schlachter c9f085f439 Fix a broken deprecation warning (#1164)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-10 21:00:20 +02:00
Uli Schlachter 19fe233982 Corner layout: Fix deprecation warning
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-10 20:59:49 +02:00
Uli Schlachter fd3daf54b3 keyboardlayout: Don't break if parsing the layout fails (#1154)
Fixes: https://github.com/awesomeWM/awesome/issues/1108
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:41 +02:00
Uli Schlachter 259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Daniel Hahler 05d962f778 Merge pull request #1147 from psychon/remove_weak_tables
Remove some weak tables
2016-10-07 22:00:23 +02:00
Emmanuel Lepage Vallée c79e49b985 Merge pull request #1124 from Elv13/prompt_args_refactor
Prompt args refactor
2016-10-06 15:17:11 -04:00
Uli Schlachter ab789e57a9 awful.tag: Save all "generic" tag properties as real props
Instead of using magic with a weak table, the code now saves this data
as a property under the tag object. This avoids all kinds of leaks, for
example caused by t.foo = t.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 21:16:33 +02:00
Uli Schlachter bf97cb6bfe awful.tag: Save dynamic_cache as a tag property
Instead of using magic with a weak table, the code now saves this cache
as a property under the tag object.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 21:03:34 +02:00
Uli Schlachter 4ef63d9416 awful.screen: Save last mouse position as screen property
Instead of using a weak table to save the last mouse position, this is
now saved directly as a property under the screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 21:00:47 +02:00
Uli Schlachter 3d048dca04 awful.client: Save client properties under c.data
Instead of using a weak table with some magic to save properties of a
client, the code now uses the c.data table provided by the C code
instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:55:28 +02:00
Uli Schlachter 22d1375e5f awful.client: Remove persistent_properties_loaded
Instead of having an extra weak table to save a boolean per client, this
now sets a property directly on the client.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:52:01 +02:00
Uli Schlachter 843d0bdcf5 wibox.drawable: Add visibility tracking callback
This new function is called whenever the visibility of the drawable
changes. Later commits can use this for explicitly tracking the lifetime
of drawables instead of using magic weak tables.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-04 21:18:18 +02:00
Emmanuel Lepage Vallee ef50f75551 prompt: Add a key release callback.
A possible use case is to highlight something when a key is
pressed and un-highlight it when the key is released.
2016-10-04 00:51:45 -04:00
Emmanuel Lepage Vallee 11644f4582 prompt: Deprecate 8 parameters. 2016-10-04 00:51:45 -04:00
Emmanuel Lepage Vallee c00c14ade3 doc: Improve the prompt documentation
It was still pre-ldoc
2016-10-04 00:43:05 -04:00
Emmanuel Lepage Vallee e5ebcc1e4c prompt: Allow each argument to be passed to the "args"
This is the first step in deprecating them. A function with so
many optional arguments is just bad design.

The next few commits will rewrite the documentation and deprecate
the old arguments.
2016-10-04 00:43:05 -04:00
Emmanuel Lepage Vallee d52c1e7f7a client: Add focus stealing filters.
For a while, it was often suggested on IRC to replace the default
request::activate handler to implement custom focus stealing policies.

While it is working, it isn't user friendly. This commit add a simple
mechanism to add such policies.
2016-10-04 00:42:25 -04:00
Daniel Hahler d513e2c4fc doc fixes for awful.{client,screen,tag} (#1134)
This adds a tparam alias "@screen" for "@tparam screen" (when used to
document e.g. arguments for callbacks), and "@screen_or_idx" when a
function accepts a "screen" or "number".
2016-10-02 16:03:11 +02:00
Uli Schlachter da6012da3e Fix memory leak in the default config on screen removal
The default config had tables like mywibox and mywibox[s] was the wibox
that is visible on screen s. When a screen is removed, nothing cleans up
these tables and so the screen and the wibox could not be garbage
collected. The same applies to the layoutbox, taglist etc.

This commit removes the global mywibox table and instead saves it as a
property on the screen. This way, the screen is not explicitly
referenced and when it is removed, the screen, its wibox and all of its
widgets become unreachable and can be garbage collected.

This commit also updates the docs and the tests that referenced things
(mostly the wibox) via mywibox[s] to now use s.mywibox.

Fixes: https://github.com/awesomeWM/awesome/issues/1125
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-30 22:46:51 +02:00
Emmanuel Lepage Vallee bbb3d14822 doc: Document the tasklist variables. 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 9e8c4a71e3 doc: Document taglist theme variables 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 6e829ce104 tasklist: Add shape support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 520bd02416 tasklist: Add spacing support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 967fc87a92 taglist: Add shape support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee da47357ae7 widget.common: Add shape support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 00ee99851b taglist: Add spacing support 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 280973c9cb doc: Document all client layout theme properties. 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 85334faffd doc: Remove invalid tasklist documentation 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee 1b9f44c62d doc: Document the titlebar theme variables. 2016-09-26 00:40:20 -04:00
Emmanuel Lepage Vallee abd2a271af doc: Document menu variables. 2016-09-26 00:40:19 -04:00
Emmanuel Lepage Vallee bb96f94845 tasklist: Add some documentation 2016-09-25 22:47:35 -04:00
Emmanuel Lepage Vallee 2b6ff1b3ca taglist: Add more documentation 2016-09-25 22:47:35 -04:00
Uli Schlachter 803264a488 Fix magnifier layout when focus is on another screen
The magnifier layout wants to ignore floating clients. Before 82342f0 this was
done by calling awful.client.floating.get(focus). If "focus" was nil, this might
have checked the floating status of a wrong client (if some other client was
focused, and the code in magnifier set focus=nil before). This issue can easily
be missed and might exist since forever. After 82342f, floating status is
checked via "focus.floating" and this now causes an "attempt to index nil value"
error instead. Much easier to notice.

Fix this by adding the missing nil check and while touching the code, merge this
with the previous "if" and correct another error (the wrong thing happened if we
had #cls=0).

Fixes: https://github.com/awesomeWM/awesome/issues/1103
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Daniel Hahler 204e2ffada Merge pull request #1099 from Elv13/fix_1091
Closes https://github.com/awesomeWM/awesome/pull/1099.
Fixes https://github.com/awesomeWM/awesome/issues/1091.
2016-09-21 22:16:21 +02:00
Emmanuel Lepage Vallee 1c177cabce awesomerc: Explicitly select a default screen
A client is supposed to go to a screen when:

 * It has been started using `awful.spawn` with explicit instructions [1]
 * An `awful.rules` rule **or any of its callbacks** set the screen [2]
 * When something handle `request::screen` and/or `request::tag` in some
   custom ways. [3]
 * Some clients can request a screen and mean it (like MythTV/Kodi/XBMC and
   some multi-window DAW) [4]

A client is supposed to go to the focused screen when none of the above are
true [5].

Other constraints:

 * The screen need to be set only once, anything will will emit
   `property::screen` many time and cause side effects.
 * There has to be a single entry point to the algorithm, no multiple
   "manage" handler.
 * Awesome internals must use the `request::` signal API and not force
   their decision outside of request handlers.
 * Restarting Awesome must not change the client screen

Commit 2178744 fix use case number [1] and [2]. It actually fix [4] too, but
it is an accident and I am not sure we care about [4] anyway. Use case [1]
and [2], however, are very important.

Fix #1091
2016-09-21 22:15:09 +02:00
Emmanuel Lepage Vallee e8649d0a29 screen: Add a function to get the client preferred screen 2016-09-15 16:50:10 -04:00
Emmanuel Lepage Vallee 0fbb02f95c ewmh: Remove dead code
The geometry storage has been moved into awful.placement. This
code was never executed as data[] was never populated.

There is some behavior that is indeed lost, but it is unlikely
someone will ever notice (it has been broken for 6 months).
The previous code attempted to handle scrren changes while
maximized. The new code organization shift this responsability
to awful.placement. However, it doesn't yet fully implement the
previous logic.
2016-09-15 16:22:46 -04:00
Emmanuel Lepage Vallée f02b73b0ee Merge pull request #1066 from Akulen/fix_gap_ignore
awful.tag: Add `gap_single_client` property and user changeable defau…
2016-09-15 16:01:19 -04:00
Hisham bcab5c71a7 Compatibility tweak for minimize and 3.5 themes
Awesome 3.5.9 accepts `_active`/`_inactive` names for `beautiful`
minimize keys (such as "titlebar_minimize_button_focus_inactive").
Some themes rely on those, meaning that when they loaded under
the current Git, the minimize button went missing. This adds a
fallback, to improve compatibility with the existing themes.
2016-09-15 11:21:49 -03:00
Akulen 5844bd0ade awful.tag: moved defaults to a local variable 2016-09-14 23:22:11 +02:00
Akulen 8ee3611848 awful.tag: Add `gap_single_client` property and user changeable defaults. 2016-09-11 13:34:17 +02:00
Emmanuel Lepage Vallée 39aace50e9 Merge pull request #1084 from Elv13/use_screen_props
Use screen props
2016-09-11 04:40:35 -04:00
Emmanuel Lepage Vallée 67e82047b0 Merge pull request #1081 from Elv13/fix_screen_memory_leak
screen: Fix a memory leak.
2016-09-11 04:39:26 -04:00
Emmanuel Lepage Vallee 50da373903 tile: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee ecdcd01dba magnifier: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee 1ede1acc9d hotkey_popup: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee 98b561e806 mouse/drag_to_tag: Do not use the deprecated geometry access 2016-09-11 02:09:56 -04:00
Emmanuel Lepage Vallee e89a72acd5 mouse/snap: Do not use the deprecated geometry access 2016-09-11 02:09:49 -04:00
Emmanuel Lepage Vallee 8c2d85523f screen: Do not use the deprecated geometry access 2016-09-11 02:09:44 -04:00
Emmanuel Lepage Vallee f1e61092cd ewmh: Do not use the deprecated geometry access 2016-09-11 02:09:36 -04:00
Emmanuel Lepage Vallee 9b96b4b448 resize: Use the right mouse cursor
Fix #1018
2016-09-10 23:56:10 -04:00
Emmanuel Lepage Vallee e66120913f screen: Fix a memory leak.
Found while investigating #1079
2016-09-10 23:54:45 -04:00
Emmanuel Lepage Vallee 21787444e4 client: Simplify screen selection decision tree.
This commit remove the `awful.tag` "manage" hook. The relevant
code has been moved to ewmh.lua request::tag handler. The handler
is called either by a volontary screen change or by a forced one.

It also require the awful.rules to be executed. This is done by
default and the user would have to explicitly disable that
behavior. From now on, disabling the rules require the user to
handle tag selection.

Fixes #1028 #1052
2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee abb36c3697 tag: Restore the history on the right screen when deleting. 2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee 180e70f6d6 tag: Fix off by one when deleting.
If a tag has been deleted, then the number of tags is decremented,
the code still used the old count.
2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee 2af0553b67 tag: Fix :delete() when there is no clients
The logic was broken. It prevented tags from being deleted.

This also make sure the boolean return value is always set.
2016-09-04 02:52:16 -04:00
Emmanuel Lepage Vallee d2988d1aab tag: Fix index when screen count change.
There was still a problem that caused the "old" tags to be
inserted in the wrong position when "saved" from a screen being
removed.

Also, this use a :get_tags(true) to save an uneeded sorting pass.
2016-09-04 02:52:15 -04:00
Akulen 1be737be3a awful.widget.tasklist: Add an align option (#1065) 2016-09-02 18:14:43 +02:00
Emmanuel Lepage Vallée 83e0423e89 tooltip: Stop using a fallback font (#1061)
Let the default font be used, just as everywhere else.
2016-08-30 12:57:40 +02:00
Emmanuel Lepage Vallee 01db39f5bb screen: Use math.huge instead of 9999 2016-08-22 17:27:48 -04:00
Emmanuel Lepage Vallee bbfa6006f3 tag: Fix index calculation.
The index was updated on an unordered table. As the elements
order did not match the relative indices once they have been
changed, further calls to set_index produced garbage.

The default taglist didn't notice because it use screen.tags
table index instead of the tag index. A debug using

echo 'for _,t in ipairs(mouse.screen.tags) do
  print("INDEX:", _, t.index, t.name) end' | awesome-client

Would have shown two or more elements with the same index. To
debug issues related to tag indices, this bash script can be
enabled:

while true; do
  echo 'for _,t in ipairs(mouse.screen.tags) do
  assert( _==t.index) end' | awesome-client
  sleep 0.5
done
2016-08-22 17:27:48 -04:00
Emmanuel Lepage Vallée ba2750cf91 Merge pull request #929 from Elv13/geometry_overhaul_p3.03
Geometry overhaul part 3.03 (final part for 3.6)
2016-08-20 16:40:36 -04:00
Emmanuel Lepage Vallee 2088ca26e8 tooltip: Support generic properties in constructor 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee bc3cbc44c9 tooltip: Add position mode 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 141b191921 tooltip: Add shape support 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 8468d06350 placement: Port next_to_mouse to the new API 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ea52b199c6 tooltip: Add align support 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ade3fabaa9 tooltip: Make the 'visible' property dynamic 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 2910a007df tooltip: Turn into a class
As done with everything else
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 211907def2 placement: Add `next_to`
This commit add the last placement function imported from the
Radical module.

It allows to place a wibox/client next to another object. It tries
to find the best fit. It also support wibox widgets.

This is intended for tooltips and menus, but can also be used in
`awful.rules` to place the new client as close as possible to the
focused one without overlap.
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee ce5cdb49ed mouse: Add the current_widget_geometry property
Apparently, __index cannot return multiple values, so the previous
code wasn't working.
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 732b170cb0 doc: Fix the awful.widget.button documentation
It was missing the macros.
2016-08-20 15:41:12 -04:00
Emmanuel Lepage Vallee 19d4a3f602 placement.under_mouse: Fix a rounding error.
When object size contains odd numbers, the result was +1px off.
2016-08-12 17:02:33 -04:00
Emmanuel Lepage Vallée e3c24c8e09 Revert "screen: Fix potential nil index" (#1037)
This reverts commit facf676b13.

Using capi.client.focus.screen to decide which screen is focused breaks
a multiscreen setup. At least makes it extremely annoying to use.

In particular, if you have a focused client on screen 1, move the mouse
to screen 2 and launch a new client, the new client appears in screen 1,
since screen.focused reports that current focused screen is 1, not 2
because of the focused client.

Close #1035
Fix #1029
2016-08-11 19:03:17 +02:00
cmertz f5f8998d0c use c:jump_to instead of client.jumpto 2016-08-10 13:02:02 +02:00
Emmanuel Lepage Vallee 220dc4c5e5 doc: Document titlebar arguments.
It was reported as incomplete on IRC.
2016-08-01 15:35:00 -04:00
Emmanuel Lepage Vallee facf676b13 screen: Fix potential nil index
This looks like a copy-paste error.
2016-08-01 15:29:02 -04:00
Emmanuel Lepage Vallee f20053bb33 awful.mouse: Fix 4 invalid function names 2016-07-30 15:49:46 -04:00
Emmanuel Lepage Vallée e472339011 Merge pull request #1013 from psychon/screen_area_signals
Screen area signals
2016-07-27 21:34:53 -04:00
Emmanuel Lepage Vallée 739ab8adc2 Merge pull request #1017 from juw/master
Change move and resize cursors
2016-07-27 21:33:35 -04:00
cmertz 4389297b58 restore client.border_width after fullscreen 2016-07-27 09:54:42 +02:00
Julian Wollrath ed34df119a Change move and resize cursors 2016-07-26 15:13:42 +02:00
Uli Schlachter 6e8b4f99f8 awful.layout: Move clients if a screen is moved
Fixes: https://github.com/awesomeWM/awesome/issues/976
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-24 16:36:03 +02:00
Uli Schlachter e6ddffda38 Fix awful.util.pread() return value (#1005)
The deprecation wrapper that we still have for this function didn't return
anything. However, awful.util.pread() used to return strings. This breaks
script.

Work around this by returning an empty string. That way code will still break,
but at least it should not error out.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-17 15:29:15 +02:00
Emmanuel Lepage Vallée 34cc04ec97 Merge pull request #972 from Elv13/prompt_fix
prompt: Fix hooks when number or caps lock are set
2016-07-16 22:59:54 -04:00
Emmanuel Lepage Vallee a87d75246f prompt: Fix hooks when number or caps lock are set 2016-07-16 22:39:06 -04:00
Uli Schlachter 2cfa117a14 Remove awful.{spawn.,}pread (#184)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-16 17:59:47 +02:00
Emmanuel Lepage Vallee 31e2a19f65 key: Make the ignore_modifiers table public
The prompt need to re-use it and Mod2 could be useful to toggle
between 2 different Awesome modes.
2016-07-09 20:01:17 +02:00
Uli Schlachter 2e13c120e8 Make rules with 'tag = "3"' work with multiple screens (#992)
The default config creates the same set of tags for all screens ("1" to "9"). An
awful.rules-rule with e.g. screen = 2, tag = "3" should obviously tag matching
clients with tag "3" of the second screen.

However, the implementation used the first matching tag in the list of all tags
and thus the client ended up tagged with tag "3" from screen 1. Fix this by
calling find_by_name() with the screen that the client is assigned to.

The existing implementation of awful.rules guarantees that any
"screen"-properties are applied before the code touched by this commit is run,
thus this should always work.

This commit does not add a test catching this because we are currently quite bad
at testing multi-screen scenarios and I don't want to invent the necessary
machinery right now.

Fixes: https://github.com/awesomeWM/awesome/issues/988
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-09 19:17:35 +02:00
Uli Schlachter 1a5680e57a Fix the titlebar minimize button (#995)
Commit 0318c61328 added an image for the minimize button which was
missing before. However, only the default theme and xresources where fixed to
contain the path to the image.

This commit adds the path to all themes.

Also, minimized clients aren't visible, just as closed (=killed) clients aren't
visible. Thus, we don't need an "active" version of this image.

This commit makes us handle the image for the minimize button just like we
handle the close button: There is no difference between "active" and "inactive"
and the file path in the theme doesn't get any path suffix.

Fixes: https://github.com/awesomeWM/awesome/issues/387
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-09 19:06:13 +02:00
Emmanuel Lepage Vallee 722879bcf7 mouse.resize: Handle when there is no selected tag
This should be very rare, but _is_ possible.
2016-06-27 02:44:07 -04:00
Emmanuel Lepage Vallee 4e6283e5ad layout: Avoid uneeded redraw
Reflowing the screen layout when floating clients changes is not
necessary.

This lower the CPU usage when dragging floating clients.
2016-06-27 02:44:07 -04:00
Emmanuel Lepage Vallée f5cfc03e49 tag: Fix restoring invalid tags from history (#963)
If:

 1) An app is open in a tag
 2) A new tag is created
 3) The app is closed in the first tag
 4) The first tag is deleted
 5) The new tag is deleted

Then this history would try to restore an inactive tag without
a screen. Bad things will then happen.
2016-06-12 13:09:09 +02:00
Emmanuel Lepage Vallée d4dc579105 resize: restore the fleur cursor and add a beautiful option (#957)
Fixes #956
2016-06-10 23:53:55 +02:00
Uli Schlachter 2d511e2ab5 gears.object.properties: Implement read-only properties
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-08 20:28:31 +02:00
Uli Schlachter cdf16d4660 awful.mouse: Implement read-only properties
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-08 20:28:30 +02:00
Daniel Hahler d9cd0a4f0e Merge pull request #948 from psychon/deprecate-add-signal
Deprecate add_signal
2016-06-07 22:58:14 +02:00
Emmanuel Lepage Vallee a057718d4d mouse: Fix moving clients between screens
Reported on IRC. I am not sure why swap() is not enough, but the
old code removed before the mouse refactor did this, so apparently
it is necessary.

The fix has been reported to work by spyroboy on IRC, thanks!
2016-06-06 00:23:48 -04:00
Uli Schlachter b84b03f15d Fix client snapping (#951)
First some reminder on how client geometries works (in X11, awesome just copied
that!):

- The position (x,y) defines where the border of the client begins
- This means that the content starts at (x+border_width,y+border_width)
- However, the size is the size of the client without border
- Thus, the client covers the rectangle from (x,y) to (x+2*bw,y+2*bw)

The client snapping code got this wrong. It only deals with rectangles and thus
for things to work as expected, the width/height have to be increased by two
times the border width. When snapping a client against other visible clients,
the geometry of the client to snap against wasn't calculated correctly.

This was apparently noticed at one point and worked around by decreasing the
position by two times the border width. While this is terribly wrong, it
actually makes things work correctly when snapping to the right or bottom edge
of a client, but breaks for the other edges.

Fix this by just calculating things correctly.

This is based on a patch from jk411.

Fixes: https://github.com/awesomeWM/awesome/issues/928
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-05 22:00:11 +02:00
Uli Schlachter 0857f6f1b5 Lua: Remove calls to add_signal()
The requirement to call add_signal() was added to catch typos. However, this
requirement became increasingly annoying with property::<name> signals and e.g.
gears.object allowing arbitrary properties to be changed.

All of this ended up in a single commit because tests/examples fails if I first
let add_signal() emit a deprecation warning.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 18:23:48 +02:00
Daniel Hahler 51ce375f01 tooltip: improve doc, call self.timer_function with self (#381) 2016-06-03 00:40:02 +02:00
Emmanuel Lepage Vallee 36bb9b4476 menu: Fix regression
There was already a bug, as self.active_child.visible
was used instead of self.active_child.wibox.visible

This caused some confusion that this attribute was a widget.
It wasn't.
2016-05-31 14:32:07 -04:00
Emmanuel Lepage Vallee 584a48db2f titlebar: Use _private 2016-05-30 23:09:50 -04:00
Emmanuel Lepage Vallee c0eabf9d8f widget: Move 'visible' into _private 2016-05-30 18:00:59 -04:00
Emmanuel Lepage Vallee f9c9e11d11 graph: Move to wibox.widget 2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee 6493cbee76 progressbar: Move to `wibox.widget` 2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee ae0d306114 textclock: Move to wibox.widget
It doesn't depend on `awful`, so it doesn't belong in `awful`.
2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee d85588babe wibox: Create a container module
Previously, the "containers" were placed in layout or widget.

They all have similar APIs and usage, so lets bring them together.
2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee 990beef9d0 util: Add a class deprecation function. 2016-05-30 17:51:18 -04:00
Emmanuel Lepage Vallee 3f0d218f72 util.table.crush: Optionally use rawset 2016-05-30 17:51:18 -04:00
Emmanuel Lepage Vallee dbcb850de9 wibar: Restore previous behavior
The behavior was changed during the rewrite. This was a mistake
as it was assumed (wrongly) that nobody used this function with
wiboxes other than "wibars" (awful.wibox).

Fixes #917
2016-05-19 13:27:46 -04:00
Emmanuel Lepage Vallee cc5e78ff55 wibar: Improve constructor documentation 2016-05-19 01:27:05 -04:00
Emmanuel Lepage Vallee f26fa5e099 wibox: Add more constructor arguments
Fixes #916
2016-05-19 01:27:05 -04:00
actionless 938de72ba7 fix(awful: wibar): visible arg was ignored 2016-05-19 00:21:22 +02:00
Emmanuel Lepage Vallee 6e6c4c3a5d tag: Avoid a race condition when deleting tags.
Since the screen removal patchset, the tags properties were
cleaned too early. This caused code connecting to "property::activated"
to be called with the tag already partially deleted. For code depending
on those properties, such as radical.impl.taglist, this caused errors.
2016-05-18 15:46:09 -04:00
Emmanuel Lepage Vallee bb5ee50de9 layoutbox: Revert 25f4f24791
Apparently, there is such thing as not leaking enough...

Also try to clear the widgets from mywibox. This seem to help.

Time will tell.

Fixes #914, unfixes #808
2016-05-18 01:45:21 -04:00
Emmanuel Lepage Vallee aa46b96369 gears.geometry: Add area_remove 2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee 1ce92bb550 get_rect_by_dir: Move to `gears.geometry`
Begin to break down `awful.util`
2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee 1a05d53cab screen: Use `gears.geometry` 2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee 4b395bea81 mouse: Port wibox.move to the placement API 2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 38185b161a wibar: Add a remove function 2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee dafd29f2a3 awful.wibox: Rename to awful.wibar
Why:

 * Two different (but related) concepts had the same name
 * Users were confused for years on IRC
 * The wibar name was already in use in some doc to avoid confusion
2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 7d390a91f1 awful.wibox: Import some wibox documentation. 2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 833ad952f6 awful.wibox: Port to the placement API 2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 50c97ed167 placement: Add a callback to detach the placement function 2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 21c9766aa6 placement: Fix under_mouse
The function stopped actually setting the geometry...

This was missed by tests because of an oversaw elsewhere.
2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 45ff7efce5 placement: Support 'attach' in composited placement functions 2016-05-15 17:17:11 -04:00
Emmanuel Lepage Vallee e78a07574b placement: Do not forward the args in get_parent_geometry
The args are for 'd', not the parent.
2016-05-15 17:17:11 -04:00
Emmanuel Lepage Vallee c490ca3803 placement: Fix margin support
This was only partially implemented. The margins were substracted from
the area too early in the pipeline. Now, they are added when getting
the size and substracted when setting it. This way, the margins will
"survive" when a placement function set an absolute value in one of
the field. Previously, this caused one (or more) of the margins to
be lost.
2016-05-15 17:17:11 -04:00
Emmanuel Lepage Vallee 43ef623dc6 client: Add x, y, width and height properties 2016-05-15 17:15:55 -04:00
Emmanuel Lepage Vallee 25f4f24791 layoutbox: Fix a leak with Lua 5.1 and luajit
Fixes #808
2016-05-15 17:15:55 -04:00
Emmanuel Lepage Vallée f9fa8538b9 Merge pull request #909 from psychon/screen-getbycoord
Fix awful.screen.getbycoord
2016-05-15 16:02:03 -04:00
Uli Schlachter 7d792cea7d Merge branch 'allow-to-disable-history-tracking' of https://github.com/awesomewm/awesome 2016-05-15 16:47:57 +02:00
Uli Schlachter ae738db58a Fix awful.screen.getbycoord when no screens exist
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-15 14:43:25 +02:00
Uli Schlachter 13bce88fa0 Fix awful.screen.getbycoord() for top-left corner of a screen
The problem was that get_square_distance() made the screen one pixel larger to
the bottom/right than it really was. Thus, the (x+0,y+0)-pixel of a screen that
was below or to the right of some other screen had distance zero to both of
these screens.

This commit fixes the screen size computation and adds a small unit test for
getbycoord() and get_square_distance().

Reported by Elv13 here:
https://github.com/awesomeWM/awesome/pull/878#issuecomment-219272864

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-15 14:40:00 +02:00
Daniel Hahler 11f3c7b8af awful.client.history: allow to disable history tracking
Based on the code from Uli Schlachter at
https://github.com/awesomeWM/awesome/issues/572#issuecomment-160080378.

Fixes https://github.com/awesomeWM/awesome/issues/572.
2016-05-14 17:42:01 +02:00
Emmanuel Lepage Vallee ca02ec1bbe widget.button: Release the button when the mouse leave
This isn't correct, but it avoid a bug where the button stay
pressed forever if the mouse leave while it's pressed.
2016-05-10 16:06:46 -04:00
Uli Schlachter c62da0dcc7 Merge branch 'fake-screen2' of https://github.com/psychon/awesome 2016-05-09 18:40:50 +02:00
Uli Schlachter 4c9280d2bb Merge branch 'no-screens' of https://github.com/psychon/awesome 2016-05-09 18:40:35 +02:00
Uli Schlachter 5b1f8cd35c Emit more signals when removing a screen's tags
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 15:01:05 +02:00
Uli Schlachter 975aac5c0c awful.tag: Delete a screen's tag on removal
Any clients with these tags end up somewhere random (the first tag on the first
remaining screen). This certainly can be improved in the future, but at least
this is a start.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter 851e0065fe awful.tag.object.delete: Delete a tag's data
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter a641d88d4e awful.tag.object.delete: Add option to force deletion
When this force-argument is not given, the code will refuse to delete a tag
which has a non-sticky client. With this force argument, the client will just be
moved to the fallback tag.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter 962a73c18c awful.tag.object.delete: Remove dead code
The case fallback_tag == nil was already checked some lines above.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter b0038c8ddb awful.autofocus: Skip invalid screens
This code uses delayed calls to lazily update things. Thanks to this, it can try
to update a screen long after it was removed. Fix this by just doing nothing on
invalid screens.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter bc9b3ca751 tasklist: Stop updating after a screen was invalidated
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Uli Schlachter 5390913f5a taglist: Stop updating after a screen was invalidated
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 14:52:31 +02:00
Emmanuel Lepage Vallée 504018343b Merge pull request #873 from Elv13/geometry_overhaul_p3.01
Geometry overhaul p3.01
2016-05-05 16:23:11 -04:00
Emmanuel Lepage Vallee 3945f13fc4 placement: Fix an semi-infinite loop when attaching to geometries
It would add a new connection each time and eventually get very
slow.

An regression test will be published later.
2016-05-04 23:47:44 -04:00
Emmanuel Lepage Vallee 58ecc69af8 mouse: Add 'current_widget' 2016-05-04 17:25:05 -04:00
Emmanuel Lepage Vallee cf0a4b42b4 mouse: Add `current_widgets` 2016-05-04 17:25:05 -04:00
Emmanuel Lepage Vallee c1fc222d89 mouse: Fix `current_wibox` 2016-05-04 17:25:05 -04:00
Daniel Hahler 7bd9cd7fd1 doc: fix usage of "mouse.move" as a string (#871)
Ref: https://github.com/awesomeWM/awesome/issues/834#issuecomment-216141389.
2016-05-03 12:06:50 +02:00
Daniel Hahler 6b6cbf4a1f Merge pull request #828 from psychon/screen-scan2
Stop restarting on RandR changes
2016-05-01 17:00:05 +02:00
Uli Schlachter 9a42ae87cf awful.wibox: Handle screen removal
When a screen is removed, awful.wibox now hides all wiboxes that it created for
this screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:12:04 +02:00
Uli Schlachter ac81a8df1f c.to_selected_tags(): Handle screenless clients
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-01 10:09:26 +02:00
Emmanuel Lepage Vallée dbd0931343 Merge pull request #844 from Elv13/geometry_overhaul_p2
Geometry overhaul part 2.5
2016-04-30 23:29:29 -04:00
Emmanuel Lepage Vallee 3dab42e6a2 mouse: Restore support for layouts with their own mousegrabber 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee cd632e4a84 mouse.dragtotag: Fix and port to the new move API
It wasn't really working as it would in other WM. It might have
been a feature, but I got the behavior in line with KDE and Gnome.
2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee a62e749216 mouse.snap: Add some configuration options 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee e31563b056 mouse.move: Return the corner 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee a39b93f2e3 mouse: Add is_*_mouse_button_pressed helper properties. 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee e78ad709e7 doc: Move request:: handler to their own documentation section 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 47fffb5eee mouse: Add current_client property
It is called wibox instead of drawin because from the user
point of view, it will be a wibox anyway.
2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee fc2d359722 doc: Add a coords example
This forced the `coords()` documentation to be moved to Lua.
Keeping it in the C file caused yet another example CMake hack.
2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 800b8c7d4a doc: Merge awful.mouse and mouse documentation pages
Just like client, tag and screen, this is to avoid new users some
confusing implementation details.
2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 0b6cd90dce mouse: Implement the Lua custom property handler 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee f0546b900d tests: Improve the placement compositing tests 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 07e1b975a7 mouse.snap: Use a composed placement function 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 1802e9e2fe awful.placement: Add a `scale` function 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 80ee4e9f5d awful.mouse.snap: Add a visual cue 2016-04-30 04:27:34 -04:00