SpinButton brings about stuck - gtkmm

I’m using the gtkmm with windows10/MSYS2.
As you can see the picture, SpinButton’s value could change the two way. One thing is push the button, and the other thing is from outside - network, something. When I push the button, it worked. But from network, it stucked a few seconds or minutes.

This is my part of code.

/// MainWindow
///

void MainWindow::Init()
{
  left_box_.RegisterSlotDirectionValueChanged(sigc::mem_fun(*this, &MainWindow::onDirectionValueChanged));
  control_worker_.RegisterSlotDirectionChanged(sigc::mem_fun(left_box_, &LeftBox::OnDirectionChanged));
}

void MainWindow::onDirectionValueChanged(int value)
{
  control_worker_.SetOffsetDirection(value);
}

/// LeftBox
///

class LeftBox : public Gtk::Box
{
  Glib::RefPtr<Gtk::Adjustment> adjust_SpinButtonDirection_ { Gtk::Adjustment::create(6.0, 1.0, 12.0, 1.0, 1.0, 0.0) };
  Gtk::SpinButton spinbutton_Direction_ { adjust_SpinButtonDirection_ };
  sigc::signal<void(int)>   signal_direction_;
};

void LeftBox::Init()
{
  spinbutton_Direction_.signal_value_changed().connect(sigc::mem_fun(*this, &LeftBox::onSpinButtonDirectionValueChanged));
}

void LeftBox::onSpinButtonDirectionValueChanged()
{
  signal_direction_.emit(spinbutton_Direction_.get_value_as_int());
}

sigc::connection LeftBox::RegisterSlotDirectionValueChanged(const sigc::slot<void(int)> &slot)
{
  return signal_direction_.connect(slot);
}


void LeftBox::OnDirectionChanged(int direction)
{
  std::lock_guard<std::mutex>   local_lock(mutex_direction_);

  spinbutton_Direction_.set_value(static_cast<double>(direction));
}

/// ControlWorker
///

sigc::connection ControlWorker::RegisterSlotDirectionChanged(const sigc::slot<void(int)> &slot)
{
  return signal_offset_.connect(slot);
}

void ControlWorker::requestDistanceFromOut(uint8_t direction)
{
  signal_offset_.emit(direction);
}

Simply, click the button? OK. spinbutton.set_value() ? NOT OK. I don’t know why.
Would you please let me know why?

gtk4.0 / gtkmm4.0 / gcc.exe (Rev8, Built by MSYS2 project) 10.3.0
Everything about build tools and libraries are updated latest version.

Stuck means, UI is stoped and not updated anymore. Or

GLib-ERROR **: 11:21:47.627: …/glib-2.70.0/glib/gmem.c:365: overflow allocating 18446744072277895851*4 bytes

or

Pango:ERROR:../pango-1.48.10/pango/pango-layout.c:4295:pango_layout_check_lines: assertion failed: (!layout->log_attrs)
Bail out! Pango:ERROR:../pango-1.48.10/pango/pango-layout.c:4295:pango_layout_check_lines: assertion failed: (!layout->log_attrs)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.