From fb639235541c526d5bd84f5874752aaf394ce164 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Sun, 7 Jul 2024 21:14:01 +0300 Subject: [PATCH 1/4] release 0.2.104 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index c012433..a1e4103 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libruisapp (0.2.104) unstable; urgency=medium + + * update + + -- Ivan Gagis Sun, 07 Jul 2024 21:14:01 +0300 + libruisapp (0.2.103) unstable; urgency=medium * wyaland: touch events, untested From 0a1bf2b8c7bf3d35e6f79f8212e6fc4f973f059c Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Sun, 7 Jul 2024 21:16:26 +0300 Subject: [PATCH 2/4] ci tweak --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e37e0c..33b111f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: matrix: include: - {os: debian, codename: bookworm, image_owner: , package_type: deb} - - {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [arm,docker]} + - {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [arm32,docker]} - {os: debian, codename: bookworm, image_owner: arm64v8/, package_type: deb, labels: [arm64,docker]} runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }} container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }} From c9d0eb0e808a8eeddc37dcec1ae548703f4e1d38 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Tue, 9 Jul 2024 15:44:38 +0300 Subject: [PATCH 3/4] update --- examples/basic/src/main.cpp | 4 +-- src/ruisapp/glue/linux/glue_wayland.cxx | 2 +- tests/app/src/main.cpp | 40 ++++++++++++------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/examples/basic/src/main.cpp b/examples/basic/src/main.cpp index 62a52db..668d208 100644 --- a/examples/basic/src/main.cpp +++ b/examples/basic/src/main.cpp @@ -1,7 +1,7 @@ #include -#include -#include +#include +#include class Application : public ruisapp::application{ diff --git a/src/ruisapp/glue/linux/glue_wayland.cxx b/src/ruisapp/glue/linux/glue_wayland.cxx index 431b084..2f57b26 100644 --- a/src/ruisapp/glue/linux/glue_wayland.cxx +++ b/src/ruisapp/glue/linux/glue_wayland.cxx @@ -25,7 +25,7 @@ along with this program. If not, see . #include #include #include -#include +#include #include #include #include diff --git a/tests/app/src/main.cpp b/tests/app/src/main.cpp index 3f2e2e8..2fc7e41 100644 --- a/tests/app/src/main.cpp +++ b/tests/app/src/main.cpp @@ -8,30 +8,30 @@ #include -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #ifdef assert # undef assert From eb4f8770107426d4785054de012fb73f11d3416f Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Thu, 18 Jul 2024 14:58:50 +0300 Subject: [PATCH 4/4] render after update --- src/ruisapp/glue/linux/glue_wayland.cxx | 13 ++++++++++--- src/ruisapp/glue/linux/glue_xorg.cxx | 10 +++++++--- src/ruisapp/glue/macosx/glue.mm | 8 +++++--- src/ruisapp/glue/windows/glue.cxx | 9 +++++---- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/ruisapp/glue/linux/glue_wayland.cxx b/src/ruisapp/glue/linux/glue_wayland.cxx index 2f57b26..a2be514 100644 --- a/src/ruisapp/glue/linux/glue_wayland.cxx +++ b/src/ruisapp/glue/linux/glue_wayland.cxx @@ -2385,8 +2385,10 @@ int main(int argc, const char** argv) while (!ww.quit_flag.load()) { // std::cout << "loop" << std::endl; + // prepare wayland queue for waiting for events while (wl_display_prepare_read(ww.display.disp) != 0) { - // there are events in wayland queue + // there are events in wayland queue, dispatch them, as we need empty queue + // when we start waiting for events on the queue if (wl_display_dispatch_pending(ww.display.disp) < 0) { throw std::runtime_error(utki::cat("wl_display_dispatch_pending() failed: ", strerror(errno))); } @@ -2410,7 +2412,13 @@ int main(int argc, const char** argv) wait_set.change(ww.waitable, {opros::ready::read}, &ww.waitable); } - wait_set.wait(app.gui.update()); + // sequence: + // - update updateables + // - render + // - wait for events/next cycle + auto to_wait_ms = app.gui.update(); + render(app); + wait_set.wait(to_wait_ms); // std::cout << "waited" << std::endl; @@ -2467,7 +2475,6 @@ int main(int argc, const char** argv) } } } - render(app); } return 0; diff --git a/src/ruisapp/glue/linux/glue_xorg.cxx b/src/ruisapp/glue/linux/glue_xorg.cxx index 45bb548..65b16c8 100644 --- a/src/ruisapp/glue/linux/glue_xorg.cxx +++ b/src/ruisapp/glue/linux/glue_xorg.cxx @@ -1339,7 +1339,13 @@ int main(int argc, const char** argv) render(*app); while (!ww.quit_flag.load()) { - wait_set.wait(app->gui.update()); + // sequence: + // - update updateables + // - render + // - wait for events/next cycle + auto to_wait_ms = app->gui.update(); + render(*app); + wait_set.wait(to_wait_ms); auto triggered_events = wait_set.get_triggered(); @@ -1492,8 +1498,6 @@ int main(int argc, const char** argv) if (new_win_dims.is_positive_or_zero()) { update_window_rect(*app, ruis::rect(0, new_win_dims)); } - - render(*app); } wait_set.remove(ww.ui_queue); diff --git a/src/ruisapp/glue/macosx/glue.mm b/src/ruisapp/glue/macosx/glue.mm index a8fe7f0..baed762 100644 --- a/src/ruisapp/glue/macosx/glue.mm +++ b/src/ruisapp/glue/macosx/glue.mm @@ -729,10 +729,12 @@ int main(int argc, const char** argv){ } do{ - render(ruisapp::inst()); - + // sequence: + // - update updateables + // - render + // - wait for events/next cycle uint32_t millis = ruisapp::inst().gui.update(); - + render(ruisapp::inst()); NSEvent *event = [ww.applicationObjectId nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate dateWithTimeIntervalSinceNow:(double(millis) / 1000.0)] diff --git a/src/ruisapp/glue/windows/glue.cxx b/src/ruisapp/glue/windows/glue.cxx index b42aead..22252f2 100644 --- a/src/ruisapp/glue/windows/glue.cxx +++ b/src/ruisapp/glue/windows/glue.cxx @@ -738,9 +738,12 @@ void winmain(int argc, const char** argv) ShowWindow(ww.hwnd, SW_SHOW); while (!ww.quitFlag) { + // sequence: + // - update updateables + // - render + // - wait for events/next cycle uint32_t timeout = app->gui.update(); - // TRACE(<< "timeout = " << timeout << std::endl) - + render(*app); DWORD status = MsgWaitForMultipleObjectsEx(0, nullptr, timeout, QS_ALLINPUT, MWMO_INPUTAVAILABLE); // TRACE(<< "msg" << std::endl) @@ -758,8 +761,6 @@ void winmain(int argc, const char** argv) DispatchMessage(&msg); } } - - render(*app); // TRACE(<< "loop" << std::endl) } }