Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ xcuserdata/
/CMakeSettings.json
/docs/antora/node_modules/
/docs/antora/build/
/.cache/
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ endif()
FetchContent_Declare(
asio
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
GIT_TAG asio-1-29-0
GIT_TAG asio-1-36-0
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(asio)
Expand Down
12 changes: 6 additions & 6 deletions lib/include/elements/view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace cycfi::elements
undo_stack_type _redo_stack;

io_context _io;
io_context::work _work;
asio::executor_work_guard<io_context::executor_type> _work;

using time_point = std::chrono::steady_clock::time_point;
using tracking_map = std::map<element*, time_point>;
Expand Down Expand Up @@ -241,7 +241,7 @@ namespace cycfi::elements
if (std::find(_content.begin(), _content.end(), e) != _content.end())
return;

io().post(
asio::post(io(),
[e, this, focus_top]
{
auto wants_focus = focus_top && e->wants_focus();
Expand Down Expand Up @@ -279,7 +279,7 @@ namespace cycfi::elements
// post a function that is called at idle time.
if (e)
{
io().post(
asio::post(io(),
[e, this]
{
auto i = std::find(_content.begin(), _content.end(), e);
Expand Down Expand Up @@ -316,7 +316,7 @@ namespace cycfi::elements
{
if (e && _content.back() != e)
{
io().post(
asio::post(io(),
[e, this]
{
auto i = std::find(_content.begin(), _content.end(), e);
Expand All @@ -337,7 +337,7 @@ namespace cycfi::elements
{
if (e && _content.front() != e)
{
io().post(
asio::post(io(),
[e, this]
{
auto i = std::find(_content.begin(), _content.end(), e);
Expand Down Expand Up @@ -393,7 +393,7 @@ namespace cycfi::elements
template <typename F>
inline void view::post(F f)
{
_io.post(f);
asio::post(_io, f);
}
}

Expand Down
12 changes: 6 additions & 6 deletions lib/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
view::view(extent size_)
: base_view(size_)
, _main_element(make_scaled_content())
, _work(_io)
, _work(asio::make_work_guard(_io))
{}

view::view(host_view_handle h)
: base_view(h)
, _main_element(make_scaled_content())
, _work(_io)
, _work(asio::make_work_guard(_io))
{}

view::view(window& win)
: base_view(win.host())
, _main_element(make_scaled_content())
, _work(_io)
, _work(asio::make_work_guard(_io))
{
on_change_limits = [&win](view_limits limits_)
{
Expand Down Expand Up @@ -142,7 +142,7 @@
void view::refresh()
{
// Allow refresh to be called from another thread
_io.post(
asio::post(_io,
[this]()
{
base_view::refresh();
Expand All @@ -153,7 +153,7 @@
void view::refresh(rect area)
{
// Allow refresh to be called from another thread
_io.post(
asio::post(_io,
[this, area]()
{
base_view::refresh(area);
Expand All @@ -173,7 +173,7 @@
if (_current_bounds.is_empty())
return;

_io.post(
asio::post(_io,
[this, &element, outward]()
{
with_context_do(
Expand Down
Loading