Commit Graph

7304 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 299e155acc client: Extend request::tag instead of awful.tag.withcurrent
There was a regression when refactoring the API. It was no longer
possible to disable the automatic tag selection.

Due to recent changes, it was no longer possible to disable the
default tag selection handler. This commit extend the already
existing request::tag mechanism to let handlers select the tags.
2016-04-20 00:11:04 -04:00
Emmanuel Lepage Vallee 7cd76e0529 awful.rules: Add 'placement' property 2016-04-20 00:11:04 -04:00
Emmanuel Lepage Vallee b0aedcda67 awful.rules: Add `new_tag` property
Create a new dynamic tag for the client.
2016-04-20 00:11:04 -04:00
Emmanuel Lepage Vallee 090f2b83ac awful.rules: Avoid trying to set some properties
This avoid unwanted signals or properties being set twice.
2016-04-20 00:10:42 -04:00
Emmanuel Lepage Vallee ddf14a3ffc awful.rules: Refactor the code to avoid many race conditions.
Testing demonstrated that many rule properties were broken when used
together. This commit try to address this by forcing an execution order
that doesn't trigger the problems.

It is still possible to write broken rules, but it should not happen by
accident anymore. Users should not try to assign the client a tag on
screen 2 and also use screen=screen[1].
2016-04-20 00:08:28 -04:00
Emmanuel Lepage Vallee a2a5448442 awful.rules: Remove dead code
Also change the focus callback signature to match the others
2016-04-20 00:02:38 -04:00
Emmanuel Lepage Vallee 2a8cc08ca1 awful.rules: Make adding new properties easier.
This commit also add a 3 step process to apply rules.

Testing showed that many rules are currently broken because
of execution races.

Create a new dynamic tag for the client.
2016-04-20 00:02:01 -04:00
Emmanuel Lepage Vallee fe8beaeaac placement: Fix incorect use of the border_width
The code and tests assumed the border was equaly applied around
the geometry while the {x,y} pair of the geometry include the
border.
2016-04-18 23:56:23 -04:00
Emmanuel Lepage Vallee 798729ff11 tests: Test placement composition 2016-04-18 23:55:52 -04:00
Emmanuel Lepage Vallee bfc8f35fb9 placement: Support composition.
Multiple placement function can now be daisy chained like
in gears.matrix. This is useful for building rules.
2016-04-18 23:55:52 -04:00
Emmanuel Lepage Vallee 2b5d918a8d awful.placement: Add a memento system.
It is used by the ewmh methods.
2016-04-18 23:55:52 -04:00
Emmanuel Lepage Vallee fcd320c7f6 Make awful.rules mandatory
There was many unfixable race conditions that could only be
solved by better integrating the request:: system and
awful.rules. This has the side effect to make rules mandatory.
2016-04-18 23:55:52 -04:00
Emmanuel Lepage Vallee 30a527fcfd travis: Install GTK
So the tests can generate custom clients to suit their purpose.
2016-04-18 23:55:52 -04:00
Emmanuel Lepage Vallee 5ebe073cdc mouse: Correctly round floating points
Fix #835
2016-04-18 23:30:26 -04:00
Daniel Hahler 8387d8fecc .travis.yml: improve comments 2016-04-18 22:35:50 +02:00
Daniel Hahler e0d1814685 Merge pull request #812 from blueyed/travis-luajit-from-source
Travis: build luajit from source (2.0.4 as of now)
2016-04-18 22:22:27 +02:00
Emmanuel Lepage Vallée bc2ddfe82d Merge pull request #820 from Elv13/layout_tests
tests: Test all client layouts
2016-04-18 04:27:11 -04:00
Emmanuel Lepage Vallee bb47aa5861 tests: Test all client layouts 2016-04-18 04:20:23 -04:00
Emmanuel Lepage Vallee 7654abcedc layout.tile: Avoid negative geometries 2016-04-18 04:20:23 -04:00
Emmanuel Lepage Vallee b938a99e1e layout: Avoid creating negative geometries when adding gaps 2016-04-18 04:20:22 -04:00
Emmanuel Lepage Vallee 9991f9ccc8 geometry: Use the relevant rounding functions instead of integers
In the case where one want to put the cursor at the middle of the
workarea, it is logic to do:

   x=screen.workarea.x+screen.workasrea.width/2

However, this can cause floating points. This commit move the
burden back to the C-API so the Lua placement code doesn't have
to add a large number of rounding methods. Given 1 type of rounding
cover a vast majority of use cases for each types of coordinates,
the C-API can take care of it in peace. For the other corner cases,
it is still possible for the Lua code to do the rounding there, but
no longer necessary. The convenstions are:

 'x' and 'y': use round (move to the closest point)

 'width' and 'height': use ceil (to avoid involontary truncating)
2016-04-18 04:20:22 -04:00
Uli Schlachter d46e11f5e1 Add range-checking to lots of arguments in the C code
This change catches things like c:geometry { width = -42 }.

Helps-a-bit-with: https://github.com/awesomeWM/awesome/pull/820 (fixes X errors)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-18 04:20:22 -04:00
Emmanuel Lepage Vallee 39c031241f Add number range checking.
Add the "number" equivalent functions for the integers one
introduced by the last commit.
2016-04-18 04:20:22 -04:00
Daniel Hahler 58068ff538 Merge pull request #831 from psychon/naughty-no-screen
naughty: Print notification content in "no screen" warning
2016-04-18 00:36:17 +02:00
Daniel Hahler 8cfdc0c593 Merge pull request #833 from psychon/cmake-output
More cmake output
2016-04-18 00:34:51 +02:00
Emmanuel Lepage Vallée 3fe85a8f05 Merge pull request #830 from aroig/gh/deprecation-warning
fix deprecation warning
2016-04-17 16:44:21 -04:00
Abdo Roig-Maranges 3c3e2daeb2 fix deprecation warning 2016-04-17 16:35:08 +02:00
Uli Schlachter 7d866318c4 Packaging: Print some information about supported packages
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-17 16:12:08 +02:00
Uli Schlachter 96370e32a3 Use a_find_program() instead of find_program()
a_find_program() prints some status, making it easier to see what was found and
was not.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-17 16:10:18 +02:00
Uli Schlachter 76266abcfa naughty: Print notification content in "no screen" warning
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-17 15:21:02 +02:00
Uli Schlachter 163c15979e Add range-checking Lua stack -> C value converters
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-17 13:48:24 +02:00
Uli Schlachter 2cf4ea5cd4 xutil.h: Add defines for valid coordinates and sizes
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-17 13:48:24 +02:00
Uli Schlachter 3e75e800ad Fix build warning
Commit c543f59696 introduced the following warnings:

objects/screen.c:307:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
objects/screen.c:307:1: warning: no previous prototype for ‘screen_scan_randr_monitors’ [-Wmissing-prototypes]

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-15 19:38:09 +02:00
Uli Schlachter bf652914dd Merge branch 'rules-screen' of https://github.com/psychon/awesome 2016-04-15 19:35:23 +02:00
Uli Schlachter cd55c57937 Merge branch 'root-size' of https://github.com/psychon/awesome 2016-04-15 19:35:12 +02:00
Uli Schlachter 723a4ee13b Merge branch 'master' of https://github.com/kiryl/awesome 2016-04-15 19:34:08 +02:00
Emmanuel Lepage Vallée e2cd174c1a Merge pull request #827 from Elv13/fix_path
build: Be more careful about the use of ..
2016-04-15 03:38:25 -04:00
Emmanuel Lepage Vallee af6586a723 build: Be more careful about the use of .. 2016-04-14 21:31:19 -04:00
Kirill A. Shutemov 70d095df06 screen: detect monitor configuration change
Xorg server from git[1] generates ConfigNotify event when monitor
configuration changes.

We handle the event, but only trigger required awesome_restart() if
screen size is changed. It's not what happens in case of monitor
configuration change.

Let's relax the condition and call awesome_restart() in response to all
ConfigNotify events to root window.

I'm not entirely sure that it wouldn't lead to superfluous restarts, but
I don't see an option.

[1] dbe8d03c42f0 ("randr: Send ConfigNotify when manual monitor list changes")

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2016-04-13 12:17:40 +03:00
Kirill A. Shutemov c543f59696 screen: XRandR 1.5 support
XRandR 1.5 adds support for the new monitor objects.

'Monitor' is a rectangular subset of the screen which represents a
coherent collection of pixels presented to the user. Each Monitor is be
associated with a list of outputs (which may be empty).

The patch below matches 1:1 screens in AwesomeWM with XRandR's Monitors.
This way I get one screen across my 4K monitor, which is represented by
two CRTCs.

Background info: http://keithp.com/blogs/MST-monitors/

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2016-04-13 02:31:37 +03:00
Uli Schlachter 79e16cf950 awful.rules.execute: Make for loop easier to read
Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
2016-04-12 09:33:39 +02:00
Uli Schlachter fb8c70b07d awful.rules: Fix switchtotag with tag names
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:32:32 +02:00
Uli Schlachter 9efc5ca409 test-urgent.lua: Test "tag by name" rules
With this commit, the code added previously to awful.rules is now also tested.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:31:46 +02:00
Uli Schlachter 3f0483003c Default config: Use strings for tag names
Tag names really are strings. Numbers just work accidentally since the C code
uses luaL_checklstring() to access the tag name and this function silently
converts numbers to strings.

This also has a nice documentation effect, making it easier for people to figure
out that they can change the name of a tag. Plus, with this the changes done by
previous commits make more sense (specifying an awful.rules-rule that identifies
a tag by name).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:31:46 +02:00
Uli Schlachter 65fa565cef Update awful.rules tag-related examples
Fixes: https://github.com/awesomeWM/awesome/issues/799
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:31:46 +02:00
Uli Schlachter 9cc28a8da5 awful.rules: Allow specifying tags by name
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:31:46 +02:00
Uli Schlachter 7d5e80a8ee Add awful.tag.find_by_name
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:30:52 +02:00
Uli Schlachter 53bebfde02 awful.rules: Add support for screen names
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:27:37 +02:00
Uli Schlachter 2fe9a6dfdf awful.rules: Fix a typo in the docs
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-12 09:26:21 +02:00
Emmanuel Lepage Vallée ae96ed0827 Merge pull request #790 from Elv13/client_properties
Client, tag and screen API cleanup.
2016-04-11 23:58:22 -04:00