This commit adds a "continue" signal on transfer objects. This signal is
used to request the next chunk of data from Lua after the last one was
sent.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Large amounts of data have to be send in chunks via the INCR protocol.
This commit adds support for that protocol to selection transfers.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes :send{ data={"TARGETS", "UTF8_STRING"}, format="atom"}
work correctly. This was tested with xclip -o -target TARGETS.
With this commit, it becomes possible to implement the TARGETS target.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the following work on a selection acquire object:
o:connect_signal("request", function(_, _, t)
t:send{ data = "Hello World!\n" }
end)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This now creates a selection transfer object and requests Lua to reply
to the request via this object. However, so far no answer is possible.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This allows to voluntarily give up ownership of a selection. Because
selection acquire objects cannot be garbage-collected before they are
released, this also gets rid of the function destroying the window when
its selection acquire object is destroyed. Instead, the window is
immediately destroyed when no longer needed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
https://github.com/awesomeWM/awesome/issues/2596
Re-matched regex used elsewhere & updated test cases for "." in filename
Allowed for alternative extensions to be found even if specified
Reverted the change of behaviour but adjusted code for readability
Small readability change
Avoided delay searches that would never work
Untabify
Reverted possible [unlikely/undesired] behaviour changes
Untabify
The list of supported formats of the selection is queried by requesting
the target TARGETS. This target is a list of ATOMs and needs special
handling which is what this commit adds.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Incremental transfers are required to be supported. This commit adds
that necessary support to awesomeWM.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
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>
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>
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>
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>
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>
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>
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>
* 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.
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.
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>
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>
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>