Commit Graph

1515 Commits

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