Commit Graph

8547 Commits

Author SHA1 Message Date
Uli Schlachter f4e66bd24b Don't print warnings for non-existing xrdb values
If needed, the Lua code can print a warning instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-24 10:06:24 +02:00
Daniel Hahler b98ca2ec98 Merge pull request #1748 from Elv13/fix_maximize_again
Fix maximize again
2017-05-23 23:56:29 +02:00
Emmanuel Lepage Vallee 5d944e3c1a tests: Add client self-resizing support to the tests 2017-05-23 22:34:12 +02:00
Emmanuel Lepage Vallee ae7b173c54 tests: Add resizing support to the test client 2017-05-23 22:33:26 +02:00
Emmanuel Lepage Vallee 710039ed3f tests: Test more maximization corner cases 2017-05-23 22:33:26 +02:00
Emmanuel Lepage Vallee 0eab45520e tests: Add maximization support to the test client
Both a "before manage" and "later" mode.
2017-05-23 22:33:26 +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 Vallee 951386ec5c client: Handle maximize differently at startup
This way max_h+max_h wont happen by accident. This isn't pretty
but it will get the job done.

Fix #1599 #1559
Close #1715 #1712
2017-05-23 22:33:26 +02:00
Benoit de Chezelles be29ee6768 naughty: avoid notification flickering on replace (#1785)
Fixes https://github.com/awesomeWM/awesome/issues/1737.
2017-05-23 15:37:46 +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
Emmanuel Lepage Vallée 260002b632 Merge pull request #1780 from psychon/fix-setting-screen
Fix setting screen
2017-05-15 02:38:41 -04:00
Uli Schlachter 498510e810 Add a new disposition to _multi_screen.lua
Without the previous commit, this would make test-awful-client.lua fail.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-15 08:15:59 +02:00
Uli Schlachter 1332288f9d screen_client_moveto: Make sure client ends up on target screen
This function tried to move the client to its new screen based on
shifting around its current geometry. However, it assumed that the
client was actually visible on its current screen, which is not always
the case.

Fix this by just forcing the client into its new screen if our moving
approach does not work.

This also reverts commit d5e365804c which
is no longer necessary. This commit only hid the issue (partly).

Fixes: https://github.com/awesomeWM/awesome/issues/318
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-15 08:15:50 +02:00
Uli Schlachter c57208d1a8 client_resize(): Stop trying to force on screen
The code here made sure that clients were not moved outside of the root
window. However, that's not enough, because clients can still end up
inside the root window, but outside of anything that is visible in some
output. Thus, just remove this.

Related-to: https://github.com/awesomeWM/awesome/issues/318
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-15 08:15:38 +02:00
Daniel Hahler c9bfd934e7 beautiful.load_font: handle font height of 0 (#1782)
This might happen if no fonts are installed.  It now falls back to the
size from the font description.
2017-05-14 20:14:18 +02:00
Daniel Hahler 52fa619506 Merge pull request #1781 from psychon/fullscreen_test
Some changes to fullscreen tests
2017-05-14 19:53:09 +02:00
Uli Schlachter 2eef92a891 test-maximize: Improve error messages
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-14 10:10:03 +02:00
Emmanuel Lepage Vallee e7232c0dc2 test: Use the test client in test-maximize 2017-05-14 09:56:58 +02:00
Emmanuel Lepage Vallee 2da1900d85 tests: Add gravity to the test client 2017-05-14 09:56:54 +02: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
Uli Schlachter 3ed0be6d85 Add a test for gravity handling (#1760)
This adds a C program which tests if the window manager handles
gravities correctly. This program is loosely based on metacity's
test-gravity.c, but completely rewritten and this version does automatic
tests instead of allowing the user to perform testing by hand.

By having this as a self-contained C program, it is possible to compare
awesome's behaviour with the behaviour of other WMs.

In my testing, only metacity and awesome pass this test. This is not
that much of a big surprise since awesome was fixed in
https://github.com/awesomeWM/awesome/pull/505 to work correctly with
metacity's test-gravity.c. However, I am surprised that e.g. Fluxbox
gets this wrong.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:28:45 +02:00
Daniel Hahler 9d1d5d5461 Merge pull request #1762 from psychon/fix-menubar-traversal
Fix menubar traversal
2017-05-13 23:27:13 +02:00
Uli Schlachter a33527a46c Add signal property::size_hints to clients (#1768)
This signal is already documented, but so far it did not exist.

Fixes: https://github.com/awesomeWM/awesome/issues/1741
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:25:48 +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
Uli Schlachter 01e61079c3 Add & use a non-fatal kind of assert() (#1779)
Aborting the process is sometimes a bit harsh for a failed assertion.
This adds a non-fatal assert() macro called "check()" and uses it in
some places where we might be able to survive the error.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-13 23:22:15 +02:00
Emmanuel Lepage Vallée 3cfb577387 Merge pull request #1778 from Elv13/fix_1777
menu: Check if the client is still valid before accessing props
2017-05-12 08:24:00 -04: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
Emmanuel Lepage Vallée 348abc3ed8 Merge pull request #1775 from psychon/typo
Fix a tiny typo
2017-05-11 09:58:54 -04:00
Uli Schlachter 420d6551c6 Fix a tiny typo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-11 15:56:58 +02:00
Thomas G 5e431d2fb1 Update notification size in `naughty.replace_text` (#1756)
Fixes #1707
2017-05-07 18:01:35 +02:00
Uli Schlachter 07d0bcb713 Stabilize awful.tooltip code coverage (#1773)
For a while now we had our code coverage tools tell us that the coverage
for one line of code fluctuated. Sometimes it was being executed and
other times it was not. This is useless noise.

I think what is happening here is that the coverage depends on the order
of iteration over a table. Either the tooltip that is being created was
first made visible and then it text changed, or things happened in the
opposite order.

Fix this by doing this by explicitly changing the tooltip's text while
it is surely visible.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-07 18:00:22 +02:00
Uli Schlachter bcf70f3740 Drop our use of iconv (#1772)
We were only using this for tag names. This means we are assuming that
everything is UTF8, but tag names are provided in the local locale and
need to be translated into UTF8? That makes no sense, so just drop this.

Fixes: https://github.com/awesomeWM/awesome/issues/1753
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-07 17:59:53 +02:00
Uli Schlachter eba61df4ef Also track coverage information for C code
Fixes: https://github.com/awesomeWM/awesome/issues/1364
Closes: https://github.com/awesomeWM/awesome/pull/1766
2017-05-05 01:03:01 +02:00
Uli Schlachter 348df4ef7b Fix the LuaJIT Travis build (#1769)
There's been a new LuaJIT version three days ago.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-04 14:30:59 +02:00
Uli Schlachter 0dbe8a344d menubar.utils: Fix for invalid utf8 file names
The previous commit made this code handle invalid directories correctly.
However, it was still possible that we come across invalid file names
for which :get_path() returns nil and then we assumed this was a file
name.

Fix this by silently ignoring such files.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-01 13:26:17 +02:00
Uli Schlachter f958b6a023 menubar.utils: Don't switch between path and GFile
Before this commit, the code always used GFile instances, then used
get_path() for a recursive call and turned the path into a GFile
instance again. This is not only inefficient, but also causes issues
with directories with invalid utf8, because the get_path function
returns nil in this case.

Fix this by keeping things as a GFile all the time.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-01 13:23:05 +02:00
Uli Schlachter 50cfa6c111 Run menubar.utils.parse_dir in protected context
Fixes: https://github.com/awesomeWM/awesome/issues/1761
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-05-01 13:19:19 +02:00
Emmanuel Lepage Vallée 98a43581ba Merge pull request #1751 from Elv13/remove_wallpaper_asserts
wallpaper: Turn asserts into warnings
2017-04-24 04:07:36 -04:00
Emmanuel Lepage Vallee 74bb34ff00 wallpaper: Turn asserts into warning
Regression in v4.1. It causes the `rc.lua` (and the fallback) to
exit when the wallpaper is missing or something went wrong.

In <= 4.0, the wallpaper wasn't loaded, but Awesome didn't "crash".

There should be no asserts in the code called during the first
event loop iteration.
2017-04-24 03:10:03 -04:00
Uli Schlachter 7481a6e6b8 Fix recursive enterleave ignore (#1747)
Every call to client_ignore_enterleave_events() must be paired with a
following call to client_restore_enterleave_events(). In between these
two calls, no other calls to client_ignore_enterleave_events() is
allowed.

The code in banning_refresh() sometimes broke these rules. This can
happen because the code causes signals to be emitted and Lua code can do
basically anything.

Fix this by moving the calls into the called functions.

Fixes: https://github.com/awesomeWM/awesome/issues/1746
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-04-21 18:53:25 +02:00
Matt ddf9689767 Add timezone option for textclock widget (#1743)
Adds a third parameter "timezone" to the textclock widget that is
optional. Defaults to local timezone if nil.

Signed-off-by: Matt Harrison <matt@harrison.us.com>
2017-04-21 16:34:23 +02:00
Tim Roes 993ffef666 Add the ignore_suspend flag to naughty (#1729)
Possible use-case could be a do-not-disturb mode where notifications
should be suspended, but some notifications triggered directly by
a user interaction (e.g. change of keyboard layout, etc.) should
still be shown.

Fixes: https://github.com/awesomeWM/awesome/issues/1728
2017-04-20 22:31:17 +02:00
Daniel Hahler c6c8f62e2d doc: FAQ: fix/improve size_hints_honor section (#1740) 2017-04-19 10:03:47 +02:00
Daniel Hahler 46f8ad4250 Merge pull request #1693 from getzze/new_widget
Improve doc for creating new widget
2017-04-19 00:26:55 +02:00
Daniel Hahler f533d0bfd8 doc: fix filesystem.make_parent_directories (#1739) 2017-04-18 15:40:57 +02:00
getzze 59662bc971 wibox.widget.base: do not call set_children if children is nil 2017-04-18 15:00:39 +02:00