Commit Graph

10310 Commits

Author SHA1 Message Date
Uli Schlachter 8ad29950f5 selection_getter: Implement simple data transfers
This commit adds support for simple selection transfers. INCR support is
still missing. The API is that a selection getter object emit the "data"
signal when some data becomes available and "data_end" when all data was
received.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-07 17:56:26 +01:00
Uli Schlachter 010c51aa83 Implement constructing selection getter objects
So far they do not do match. The selection and target are specified and
a window is created for a transfer, but no transfer is actually started
yet.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-07 17:56:26 +01:00
Uli Schlachter e17912ec0c Prepare a selection getter interface
This prepares a new class for getting selection contents. No run-time
behaviour changes yet.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-07 15:16:48 +01:00
Uli Schlachter 75e67e1d33 Fix Luacheck warnings
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-06 14:31:57 +01:00
Uli Schlachter 83ffc2b0ce Add a test case for the selection watcher
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-06 14:31:57 +01:00
Uli Schlachter 1304373a19 selection watcher: Actually watch selections
When the selection that is watched by an active selection watcher
changes, then the signal "selection_changed" is emitted on the watcher.
This signal has one boolean argument that indicates if the selection is
owned. This means that this argument is false when the selection owner
went away and the selection now has no owner at all.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-06 10:27:59 +01:00
Uli Schlachter a24f35532c Implement selection watcher objects
These objects are created via e.g. selection_watcher("CLIPBOARD") to
track the CLIPBOARD selection. They start watching when their .active
property is set to true and stop when this property is unset again.

This commit implements the Lua side of that: A list of active watchers
is kept and updated when needed.

The next commit will add the X11-side of this so that these objects
actually do something.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-06 10:10:52 +01:00
Uli Schlachter 0295df81c1 Prepare a selection watcher interface
This commit adds the necessary method calls to setup the class and also
so that xfixes selection notify events can be handled. Currently, these
are empty functions, but later commits will fill them.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-06 09:30:16 +01:00
Uli Schlachter 2023ed187a Add xcb-xfixes as a new dependency and initialise it
This commit prepares changes in the following commits

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-06 09:21:26 +01:00
mergify[bot] a7474412da
Merge pull request #2630 from psychon/fix_background_foreground
background container: Actually set the foreground color
2019-02-01 15:04:11 +00:00
Uli Schlachter 6a463da636 background container: Actually set the foreground color
Commit ba75da7976 worked around a bug in LGI. However, it did so by
just dropping the code that set the foreground color. Instead, it should
have changed the code so that cr:set_source() is only called if the
background container has a foreground color configured instead of "just
always".

Fixes: https://github.com/awesomeWM/awesome/pull/2609#issuecomment-459580395
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-01 15:28:29 +01:00
Uli Schlachter 5f2cdabc01 textclock: Produce reproducible output (#2622)
When $SOURCE_DIRECTORY is set, we are most likely currently running the
examples test, i.e. generating images. These images end up in the
documentation.

To make the images reproducable, i.e. independent from the current time,
this commit makes the textclock honor $SOURCE_DATE_EPOCH if
$SOURCE_DIRECTORY is set.

See commit 9d7eaf02 for some more details.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-31 20:34:41 +01:00
mergify[bot] 0b4a84ccf3
Merge pull request #2628 from warptozero/pr-rules-shape
awful.rules: Fix shape function not being set as client property
2019-01-30 15:01:39 +00:00
warptozero eca5c869fa
awful.rules: Fix shape function not being set as client property 2019-01-30 07:44:00 +01:00
Uli Schlachter b5abd53cbf Use reproducible timestamps in more doc examples (#2626)
This adds require("_date") to some example tests that use the current
date via os.date. This allows reproducibility by replacing os.date()
with a function that uses a static date from $SOURCE_DATE_EPOCH. See
commit 9d7eaf0 for more details.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-29 19:36:40 +01:00
mergify[bot] cdd6e360f5
Merge pull request #2609 from psychon/shape_outside
Change the way the shape is done in the background container
2019-01-29 18:21:24 +00:00
Daniel Hahler a4fe84a8c2
ci: mergify: update for Travis, remove Codacy (#2627)
* ci: mergify: remove Codacy from required checks

It might be hanging, and is not really valuable enough currently to
require a rebuild etc.

* ci: mergify: rename check for Travis CI

It was moved from travis-ci.org to travis-ci.com.
2019-01-29 12:53:24 +01:00
Emmanuel Lepage Vallée 0a999c4192 Change the badge URL from travis-ci.org to travis-ci.com (#2625) 2019-01-29 11:24:31 +01:00
mergify[bot] 7ba3a9fba8
Merge pull request #2620 from psychon/fix_some_news
Fix some typos in the NEWS
2019-01-28 18:39:47 +00:00
Uli Schlachter 84eb175ccd background container: Deprecate shape_clip property
The previous commit removed the implementation of this property.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-28 14:55:53 +01:00
Uli Schlachter a80323d2d0 Fix some typos in the NEWS
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-28 08:47:20 +01:00
mergify[bot] 5da5d36178
Merge pull request #2619 from awesomeWM/Elv13-patch-1
doc: Fix a copy+paste mistake
2019-01-28 06:53:24 +00:00
Emmanuel Lepage Vallée 8b5d79792b
doc: Fix a copy+paste mistake
The current `awful.widget.layoutlist` is a fork of the so far uncommitted `naughty.widget.actionlist`. It was created because some of the support code for the new `naughty` implementation needed "easier to merge" usage examples. The `layoutlist` was chosen because it was both a low hanging fruit and genuinely useful.
2019-01-27 22:01:10 -05:00
mergify[bot] febbbb69a5
Merge pull request #2617 from psychon/more_enterleave_events
Honor *some* Enter/Leave events with detail==Inferior
2019-01-27 17:48:09 +00:00
Uli Schlachter 1166acd73c Honor *some* Enter/Leave events with detail==Inferior
Commit 19086d70fa made AwesomeWM ignore all Enter/Leave events with
detail==Inferior. However, when leaving a titlebar by moving the cursor
into the actual client window, the corresponding event actually has
detail==Inferior. The same is true for the opposite direction: Leaving a
client window by entering the titlebar.

Thus, this commit fixes the code to handle theses cases again.

This was tested with the following in rc.lua (and with a systray icon
and a client with titlebars).

screen[1].mywibox:connect_signal("mouse::enter", function() print("enter mywibox") end)
screen[1].mywibox:connect_signal("mouse::leave", function() print("leave mywibox") end)
client.connect_signal("mouse::enter", function() print("enter client") end)
client.connect_signal("mouse::leave", function() print("leave client") end)
client.connect_signal("manage", function(c)
    local d = c:titlebar_top()
    d:connect_signal("mouse::enter", function() print("enter titlebar") end)
    d:connect_signal("mouse::leave", function() print("leave titlebar") end)
end)

Fixes: https://github.com/awesomeWM/awesome/pull/2611#issuecomment-457892746
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-27 16:21:31 +01:00
Uli Schlachter ba75da7976 Work around a bug in LGI
cairo_get_source() is not bound correctly, leading to use-after-free
bugs. Cairo catches this and crashes.

Work around this by preserving the current source in a different way.
Instead of using cairo_get_source() and later cairo_set_source(), this
commit wraps everything that changes the current source between
cairo_save() and cairo_restore(). Thus, cairo saves the current source
for us without us having to grab an explicit reference.

Works-around: https://github.com/pavouk/lgi/issues/210
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-27 11:42:51 +01:00
Uli Schlachter 67cf1469f0 Change the way the shape is done in the background container
Previously, the background container "just" used the shape and drew a
line around it. This means that half the line will be inside of the
shape and half of it will be outside. Thus, this hides the actual shape
that is used.

This commit changes that so that the line is added outside of the shape.
It does this via some tricks:

- In :before_draw_children(), :push_group() is used to redirect drawing
  of the child widget to a temporary surface.
- In :after_draw_children(), the border is added to this group.
  + For this, another temporary surface is created. It will be used as a
    mask.
  + The inside of the shape on this mask is cleared, everything else is
    filled. Thus, the mask now contains everything "not content".
  + Everything inside the mask is filled with the background color.
- Also in :after_draw_children(), the group is drawn to the actual
  target surface.
  + Again, this needs a mask.
  + This time, we draw the shape to the mask with twice the border width.
    Thus, half of this line will be outside of the shape.
  + Then, the shape itself is also filled so that the mask contains the
    shape and the border.
  + This mask is then used to copy the right parts of the temporary
    surface were the child widget and border was drawn to the actual
    target surface that will be visible on screen.

This approach has some upsides. Because we no longer have "half the
border" above content, colors with some transparency work fine for the
border. Also, this should avoid issues with anti-aliasing, because e.g.
the border is not just drawn with the border width, but also further out
to everything else so that the background cannot "bleed through".

Fixes: https://github.com/awesomeWM/awesome/issues/2516
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-27 11:42:36 +01:00
Emmanuel Lepage Vallée 56fa91162f
Merge pull request #2503 from Elv13/43_news
Update the NEWS for 4.3
2019-01-26 13:28:09 -05:00
Emmanuel Lepage Vallée 9bfd6a22cc
Merge pull request #2611 from psychon/systray_wibox_enterleave
Ignore all Enter/Leave events with detail==Inferior
2019-01-26 13:18:20 -05:00
Emmanuel Lepage Vallee 22b6e80cad Update the NEWS for 4.3 2019-01-26 13:16:22 -05:00
Emmanuel Lepage Vallee 2cb5a0f0e1 codename: Change for "Too long" 2019-01-26 13:16:21 -05:00
Emmanuel Lepage Vallée d25abddeb7
Merge pull request #2610 from Elv13/arcchat_fixes
Fix the arcchart rounded edges
2019-01-26 13:04:54 -05:00
Uli Schlachter 4c53f9cbc6 spec/beautiful: Don't print noise (#2612)
This gets rid of the following output when running the unit tests:

2019-01-26 18:31:44 E: awesome: beautiful: error loading theme: got an empty table
2019-01-26 18:31:44 E: awesome: beautiful: error loading theme: got an empty table from: ./spec/beautiful/tests/Bad_1.lua
2019-01-26 18:31:44 E: awesome: beautiful: error loading theme: got a function from: ./spec/beautiful/tests/Bad_2.lua
2019-01-26 18:31:44 E: awesome: beautiful: error loading theme: got a number from: ./spec/beautiful/tests/Bad_3.lua
2019-01-26 18:31:44 E: awesome: beautiful: error loading theme: got a nil from: ./spec/beautiful/tests/Bad_4.lua
2019-01-26 18:31:44 E: awesome: Error during a protected call: ./spec/beautiful/tests/Bad_5.lua:2: attempt to index local 'var' (a nil value)
stack traceback:
	./spec/beautiful/tests/Bad_5.lua:2: in main chunk
	[C]: in function 'dofile'
	[C]: in function 'xpcall'
	lib/gears/protected_call.lua:36: in function <lib/gears/protected_call.lua:35>
	(...tail calls...)
	lib/beautiful/init.lua:224: in function 'init'
	spec/beautiful/init_spec.lua:56: in function <spec/beautiful/init_spec.lua:25>
	[C]: in function 'xpcall'
	/usr/share/lua/5.2/busted/core.lua:178: in function 'safe'
	/usr/share/lua/5.2/busted/init.lua:40: in function 'executor'
	...
	/usr/share/lua/5.2/busted/core.lua:312: in function 'execute'
	/usr/share/lua/5.2/busted/block.lua:155: in function 'execute'
	/usr/share/lua/5.2/busted/init.lua:7: in function 'executor'
	/usr/share/lua/5.2/busted/core.lua:312: in function </usr/share/lua/5.2/busted/core.lua:312>
	[C]: in function 'xpcall'
	/usr/share/lua/5.2/busted/core.lua:178: in function 'safe'
	/usr/share/lua/5.2/busted/core.lua:312: in function 'execute'
	/usr/share/lua/5.2/busted/execute.lua:58: in function 'execute'
	/usr/share/lua/5.2/busted/runner.lua:174: in function </usr/share/lua/5.2/busted/runner.lua:11>
	/usr/bin/busted:3: in main chunk
	[C]: in ?
2019-01-26 18:31:44 E: awesome: beautiful: error loading theme: got a nil from: ./spec/beautiful/tests/Bad_5.lua
2019-01-26 18:31:44 E: awesome: Error during a protected call: cannot open ./spec/beautiful/tests/NO_FILE: No such file or directory
stack traceback:
	[C]: in function 'dofile'
	[C]: in function 'xpcall'
	lib/gears/protected_call.lua:36: in function <lib/gears/protected_call.lua:35>
	(...tail calls...)
	lib/beautiful/init.lua:224: in function 'init'
	spec/beautiful/init_spec.lua:57: in function <spec/beautiful/init_spec.lua:25>
	[C]: in function 'xpcall'
	/usr/share/lua/5.2/busted/core.lua:178: in function 'safe'
	/usr/share/lua/5.2/busted/init.lua:40: in function 'executor'
	/usr/share/lua/5.2/busted/core.lua:312: in function </usr/share/lua/5.2/busted/core.lua:312>
	...
	/usr/share/lua/5.2/busted/core.lua:312: in function 'execute'
	/usr/share/lua/5.2/busted/block.lua:155: in function 'execute'
	/usr/share/lua/5.2/busted/init.lua:7: in function 'executor'
	/usr/share/lua/5.2/busted/core.lua:312: in function </usr/share/lua/5.2/busted/core.lua:312>
	[C]: in function 'xpcall'
	/usr/share/lua/5.2/busted/core.lua:178: in function 'safe'
	/usr/share/lua/5.2/busted/core.lua:312: in function 'execute'
	/usr/share/lua/5.2/busted/execute.lua:58: in function 'execute'
	/usr/share/lua/5.2/busted/runner.lua:174: in function </usr/share/lua/5.2/busted/runner.lua:11>
	/usr/bin/busted:3: in main chunk
	[C]: in ?
2019-01-26 18:31:44 E: awesome: beautiful: error loading theme: got a nil from: ./spec/beautiful/tests/NO_FILE

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-26 12:54:31 -05:00
Uli Schlachter 19086d70fa Ignore all Enter/Leave events with detail==Inferior
These events are generated when the mouse pointer moves between our
window and one of its child windows. For our purposes, this never counts
as an enter or leave, so just ignore these events completely.

Fixes: https://github.com/awesomeWM/awesome/issues/2560
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-26 18:26:35 +01:00
Emmanuel Lepage Vallée f735a60b95
Merge pull request #2511 from Elv13/xmas_2k18_5
Add the layoutlist
2019-01-26 12:22:03 -05:00
Sorky bf62695f76 awful.menu: Move code from rc.lua to awful.menu
Fixes: #2524
2019-01-26 12:19:05 -05:00
Emmanuel Lepage Vallee dbb552097c arcchart: Also compute the sum when the limits are provided.
The result was used even when it wasn't computed.
2019-01-26 12:13:13 -05:00
Emmanuel Lepage Vallee 090f80d173 arcchart: Place the rounded edge in the right side of the arc. 2019-01-26 12:13:13 -05:00
Emmanuel Lepage Vallee 9efcf9df87 shape.arc: Prevent an angle underflow when rounded edges are enabled.
Fixes #2604
2019-01-26 12:13:13 -05:00
Emmanuel Lepage Vallee 4524a7880d tests: Test the layoutlist 2019-01-26 01:34:59 -05:00
Emmanuel Lepage Vallee 8b60c05118 widget: Add a layoutlist widget
Like taglist and tasklist, but for layouts
2019-01-26 01:34:59 -05:00
mergify[bot] e8bf75ef3c
Merge pull request #2592 from Sorky/patch-1
beautiful.init: Fix return values and improve doco. fixes: #2588
2019-01-25 15:41:15 +00:00
Sorky 366be2105a beautiful.init: Fix return values and improve doco. fixes: #2588 #2592
squashing updates from review by blueyed

Added busted tests

Fixed test files EOF

Remove Travis warning
2019-01-25 22:56:41 +11:00
Emmanuel Lepage Vallée 7e7733c6d1
Merge pull request #2521 from Elv13/modifiers
awesome: Add a `modifiers` field.
2019-01-24 23:59:54 -05:00
Emmanuel Lepage Vallée c87e7aad56
Merge pull request #2510 from Elv13/xmas_2k18_4
Add the popup widget take 2 (only relevant commits)
2019-01-24 23:24:22 -05:00
mergify[bot] b0bfcea1a1
Merge pull request #2607 from Sorky/patch-4
menubar.utils.lua - remove "function is_format_supported" by making i…
2019-01-24 20:03:20 +00:00
Emmanuel Lepage Vallee e3c1ecfd40 docs: Better document how widgets work
Ref: #1373
2019-01-24 10:58:45 -05:00
Emmanuel Lepage Vallee 6c1f9ec651 tests: Test the awful.popup 2019-01-24 10:58:45 -05:00
Emmanuel Lepage Vallee 031c773658 popup: Add a popup module to awful
This module is half way between the tooltip and the raw wibox.

It supports the following features:

 * Auto resize to its widget size
 * Support parent objects and placement

Fix #1683
2019-01-24 10:58:45 -05:00
Emmanuel Lepage Vallée 7f0e2e6bbf
Merge pull request #2509 from Elv13/xmas_2k18_3
Fix some tag.layouts corner cases
2019-01-24 08:50:41 -05:00