Commit Graph

1480 Commits

Author SHA1 Message Date
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