Commit Graph

9077 Commits

Author SHA1 Message Date
Uli Schlachter be728324ef tests/examples: Change ENV handling
Instead of messing with CMake's environment and having that implicitly
inherited when running a process, explicitly set $SOURCE_DIRECTORY where
required.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-06 16:50:46 +02:00
Emmanuel Lepage Vallée e889caba91
build: Auto-add example tests outputs. (#2339)
This commit allow the file to be auto added when it doesn't exist. This
save the useless process of writing it by hand.
2018-08-06 09:30:59 -04:00
Uli Schlachter 73b519d38b Fix STRICT_TESTS (#2338)
STRICT_TESTS was introduced in commit c22b93963. Some people have setups
where e.g. fontconfig produces warnings. These warnings made the tests
under tests/examples/ fail. The above commit changes things so that
these warnings are ignored by default, unless STRICT_TESTS is enabled.

Commit b5ca8bf937 broke this by making example test failures fatal
again.

Fix this by appending "|| true" to the command to run in case strict
tests are disabled. Thus, all failures from tests/examples/runner.sh get
ignored.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-06 09:05:51 -04:00
Emmanuel Lepage Vallée dd7161ee0a
build: Fix a regression when adding new example tests. (#2337)
If the example had a text output, it would cause an error

Regression from b5ca8bf93
2018-08-06 09:05:31 -04:00
Emmanuel Lepage Vallée aab582c0a0
Merge pull request #2329 from Elv13/fix_minimize_activate
Fix 3rd party toolbar unminimization and the default rc.lua focusable issue
2018-08-03 18:07:50 -04:00
Uli Schlachter 15a508f022 Merge branch 'examples_tests_during_build' of https://github.com/psychon/awesome 2018-08-03 14:30:25 +02:00
Uli Schlachter 477af1b145 test runner: Move running to a shell script
Instead of running the example tests directly from CMake and checking
the results via CMake, the tests are now run through a shell script.

So far, there are too many variables involved for me to easily figure
out how to run this shell script in the building phase instead of the
configuring phase, but at least this commit moves the "actual running"
out of CMake, bringing us a step closer to that goal.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-31 17:50:41 +02:00
mergify[bot] b9e981ba63
Merge pull request #2327 from laszloth/master
Add a beautiful option to remove borders when maximized
2018-07-30 06:39:38 +00:00
Emmanuel Lepage Vallee e0d1b404c5 rc.lua: Use request::activate instead of client.focus.
For a long time, it was deemed overkill and made rc.lua less readable
without the documentation.

However it is now clear that it's handling of unfocusable clients and
general bypassing of both `awful.client.focus.filter` and
`awful.ewmh.activate` filters causes bugs. Fixing them individually
in each instance of `rc.lua` `client.focus = c` would add so much code
that all the clarity provided by not using request::activate would be
burried in boilerplate code.

Fix #2328
2018-07-29 18:22:48 -04:00
Emmanuel Lepage Vallee 091adca070 activate: Merge the old hardcoded focus filter with awful.ewmh one.
This code was attached to mouse::enter in `rc.lua` instead of being part
of the unified request::activate architecture.

There is currently no way to detach this focus filter because it is
generally correct.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 26e4856821 activate: Raise unfocusable clients.
I am sure there is corner cases where this is considered wrong, but it
allows to simplify rc.lua handling of such clients.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 69e9cc4cbd request::activate: Unminimize clients
Fixes #927
2018-07-29 18:22:22 -04:00
mergify[bot] 0d994c0603
Merge pull request #2312 from psychon/travis-Werror
Another attempt at making -Werror work on Travis
2018-07-29 21:10:07 +00:00
Emmanuel Lepage Vallée 321eb30ea4
Merge pull request #2313 from Elv13/update_shims
Update the shims to be able to emulate the default rc.lua (look&feel) without errors.
2018-07-29 15:33:54 -04:00
Emmanuel Lepage Vallee 6240ec113f tests: Implement keybindings, keygrabber and fake_inputs 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee 3adad38c0a tests: Make the capi.screen shim more robust
Also add some private properties to be consumed by the template for a
better rendered documentation example image.
2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee 2c8c274193 tests: Add the capi.object miss handle support to the capi.mouse shim 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee 1df44210c8 tests: Add many missing client properties so the tilebar loads correctly 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee ff9f78ef7e tests: Add the cursor and focus colors to the generated images theme. 2018-07-29 10:46:27 -04:00
Emmanuel Lepage Vallee bf6ab0ba4c tests: Mock the keyboard layout API enough to stop getting errors.
It IS NOT correct, the point is to be able to load the keyboard widget
with errors.
2018-07-29 10:46:24 -04:00
Emmanuel Lepage Vallee f1245f083c tests: Add a basic `key` shim 2018-07-29 10:45:40 -04:00
Emmanuel Lepage Vallee 3c79f1c8d5 awful.key: Add more fields to the description
There is currently no centralized way to manage active keybindings so
the description data case be used to fill part of that role until an
official API is added.
2018-07-29 10:45:40 -04:00
Emmanuel Lepage Vallee 980c47d775 tests: Mock capi.keygrabger
It will now run "static code" when the module is loaded, so need
to exist.
2018-07-29 10:45:40 -04:00
Laszlo Toth 647756fd15 Add a beautiful option to remove borders when maximized
No intended change in previous behavior, so it's disabled by default.
2018-07-28 16:06:57 +02:00
Uli Schlachter b5ca8bf937 example tests: Save expected test output in a txt file
This commit adds a .txt file next to each example test that generates a
text output. This text file contains the expected output and it is an
error if the actual output does not match the expected output. This
means that we no longer have to run the example tests before we can
expand all the @foo@ expressions that occur.

While touching this, I also fixed some typos and unexpected newlines in
the tests' output.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-27 08:56:18 +02:00
mergify[bot] 7469e992ff
Merge pull request #2067 from blueyed/doc-fixes
Small batch of doc fixes
2018-07-26 21:53:48 +00:00
Uli Schlachter 0060d1149b .travis.yml: Enable -Werror
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-26 09:12:45 +02:00
Uli Schlachter 7db0188cb2 CMake: Use check_symbol_exists instead of check_function_exists
The documentation for the CheckFunctionExists module says that it is
better to use CheckSymbolExists and lists some reasons. For our purpose,
the reason is that check_function_exists is incompatible with -Werror.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-26 09:12:40 +02:00
Uli Schlachter ef110361dc Reduce code duplication with luaA_*_call_handler (#2321)
The functions luaA_class_call_handler() and luaA_mouse_call_handler()
are basically identical. Fix this code duplication by moving this to
luaA_call_handler() in lualib.h.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-25 18:31:02 -04:00
Daniel Hahler 3876b18240 doc: Add missing C-object documentation and fix some papercuts.
Ref: https://github.com/awesomeWM/awesome/issues/1373
2018-07-25 18:26:11 -04:00
Emmanuel Lepage Vallée 40a55a3d2f
client: Add client_set_startup_id definition (#2318)
Fixes #2309
2018-07-25 18:03:09 -04:00
mergify[bot] e7251011ac
Merge pull request #2314 from Elv13/add_example_generator_options
Add example generator options
2018-07-25 07:15:18 +00:00
Daniel Hahler def50af439
Mergify: do not use strict mode (#2319)
It has the drawback of having intermediate merge commits for when
Mergify merges master before because of this, and then does not
squash-merge or rebases it when merging.
2018-07-25 00:38:13 +02:00
mergify[bot] 522fd2b5cd
Merge pull request #2311 from psychon/example-tests-images
Example tests: Make it explicit what kind of output is expected
2018-07-24 21:50:11 +00:00
Emmanuel Lepage Vallee 4e8d907044 tests: Restore support for newlines in examples
Since last year luacheck change, trailing spaces are no longer
allowed. This caused all documentaiton examples that used them
as a way to mark newlines to look plain wrong.

This commit add an explicit flag to make longer examples more
readable.
2018-07-24 17:22:41 -04:00
Emmanuel Lepage Vallee c340c14cf2 tests: Improve the CMakeLists.txt
* Add a FOLLOW_SYMLINKS so Awesome 3rd party module can share the
  awesome test infrastructure by adding themselves as symlinks in
  `lib/`, `tests/` and `tests/examples` and otherwise use AwesomeWM
  Travis config.

* Add an option to add examples to the C documentation. Previously only
  Lua functions could be documented using this framework.
2018-07-24 17:22:41 -04:00
Uli Schlachter e1a90ecf5b tests/examples: Explicitly mark tests generating text
This is similar to the previous commit, but for text output that is
produced by some test.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-24 14:27:41 +02:00
Uli Schlachter 654eecd40d tests/examples: Explicitly mark tests generating an image
This allows to figure out if a test will generate an image without
having to run it. The long term plan for this is to run the tests during
compiling ("make") and not during configuring ("cmake"). Since the list
of files to e.g. install needs to be known during configuring, this
commit is a necessary step in that direction.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-24 14:12:44 +02:00
Uli Schlachter efe23dc7d2 tests/examples: Drop support for PNG output images
No currently existing test produces a PNG image, so why do we even check
for such an output file?

I did 'rm -rf build && make -j9 && cp -r build /tmp', then applied this
patch, and then did another 'rm -rf build && make -j9'. According to
diff, the resulting directories are basically the same (except for lots
of timestamps and some non-determinism in CMake).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-24 13:49:43 +02:00
mergify[bot] 0958a44781
Merge pull request #2306 from psychon/fix-2299
Fix function pointer casts in client.c
2018-07-23 09:57:42 +00:00
mergify-bot 59a6502790 Merge branch 'master' into 'fix-2299' 2018-07-23 11:50:14 +02:00
Emmanuel Lepage Vallée 7e17bcd026
client: Make startup_id writable (#2275)
And document how to use it on Linux to fix broken startup_id
2018-07-23 04:04:07 -04:00
Uli Schlachter 3553838443 Fix function pointer casts in client.c
The getters for properties already get the object as their second
argument, so there is no need to get the object again from Lua.

Fixes: https://github.com/awesomeWM/awesome/issues/2299
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-23 03:48:19 -04:00
Yauhen Kirylau 94d3918d14 fix(awful: widget: only_on_screen): update for screen API changes from #2293 (#2304) 2018-07-22 18:33:59 -04:00
Uli Schlachter 6c27f4295b client_manage(): Check that reparenting works (#2298)
When a new client appears, we reparent its window into a window of our
choice so that we can add decorations. However, windows can be difficult
making the reparenting fail. For example, some snapshots of GTK+ set a
parent-relative background, which means that its parent windows have to
have the same depth as the window itself. This makes reparenting fail if
transparency is used/supported.

Make the failure mode... different, by checking if reparenting
succeeded. If it failed, we print an error message and unmanage the
window immediately. This means that those GTK+ windows just do not
appear at all, instead of behaving weirdly.

This idea of this patch came from i3.

Related-to: https://github.com/awesomeWM/awesome/issues/2279
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-22 16:05:11 -04:00
Uli Schlachter 3e24303f15 tile: Apply size hints correctly (#2305)
Layouts work with the client's geometry in "space on screen that is
assigned to this client". This means that the geometry should include
decoration (titlebar and borders) and useless gaps.

Everything else (especially the C code) works with client's geometry in
"space that the client can draw on". This means that the titlebar,
borders and the useless gaps are not included into this size.

Thus, when applying size hints, the tile layout has to convert between
these two representations. Otherwise, size hints are applied incorrectly
and to a wrong geometry.

Fixes: https://github.com/awesomeWM/awesome/issues/1418
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-21 20:53:30 +02:00
mergify[bot] abf847961e
Merge pull request #2294 from blueyed/kill
awesome.kill: allow negative PIDs (and 0) to support process groups
2018-07-20 14:32:14 +00:00
mergify-bot b3d2e0388e Merge branch 'master' into 'kill' 2018-07-20 16:20:24 +02:00
mergify[bot] f1c8743e52
Merge pull request #2303 from sigprof/remove-systray_cleanup
Remove systray_cleanup() from drawin_systray_kickout() (#2301)
2018-07-20 13:27:06 +00:00
Sergey Vlasov 41e66c16f8 Remove systray_cleanup() from drawin_systray_kickout() (#2301)
The systray_cleanup() function gives up the _NET_SYSTEM_TRAY_Sn
selection ownership and should be called only when Awesome exits.
Calling systray_cleanup() from drawin_systray_kickout() is not correct,
because drawin_systray_kickout() is called when the system tray window
needs to be hidden, including the case when the last tray icon was
removed and the tray became empty.

Fixes: https://github.com/awesomeWM/awesome/issues/2301
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-07-20 14:11:09 +03:00