mirror of
https://github.com/polybar/polybar.git
synced 2026-03-29 19:46:49 +00:00
Eventloop cleanup (#2577)
* eventloop: Use eventloop namespace in cpp files * changelog: Add missing deprecated hook message * Make eventloop and ipc classes non-copyable and non-movable * Remove functional.hpp * eventloop: Don't close handles in error cases Client should be responsible for closing handles. * eventloop: Address invalidation of handle references
This commit is contained in:
@ -32,11 +32,12 @@
|
||||
POLYBAR_NS
|
||||
|
||||
using namespace signals::ui;
|
||||
using namespace eventloop;
|
||||
|
||||
/**
|
||||
* Create instance
|
||||
*/
|
||||
bar::make_type bar::make(eventloop::eventloop& loop, bool only_initialize_values) {
|
||||
bar::make_type bar::make(loop& loop, bool only_initialize_values) {
|
||||
auto action_ctxt = make_unique<tags::action_context>();
|
||||
|
||||
// clang-format off
|
||||
@ -59,9 +60,9 @@ bar::make_type bar::make(eventloop::eventloop& loop, bool only_initialize_values
|
||||
*
|
||||
* TODO: Break out all tray handling
|
||||
*/
|
||||
bar::bar(connection& conn, signal_emitter& emitter, const config& config, const logger& logger,
|
||||
eventloop::eventloop& loop, unique_ptr<screen>&& screen, unique_ptr<tray_manager>&& tray_manager,
|
||||
unique_ptr<tags::dispatch>&& dispatch, unique_ptr<tags::action_context>&& action_ctxt, bool only_initialize_values)
|
||||
bar::bar(connection& conn, signal_emitter& emitter, const config& config, const logger& logger, loop& loop,
|
||||
unique_ptr<screen>&& screen, unique_ptr<tray_manager>&& tray_manager, unique_ptr<tags::dispatch>&& dispatch,
|
||||
unique_ptr<tags::action_context>&& action_ctxt, bool only_initialize_values)
|
||||
: m_connection(conn)
|
||||
, m_sig(emitter)
|
||||
, m_conf(config)
|
||||
@ -737,7 +738,7 @@ void bar::handle(const evt::button_press& evt) {
|
||||
* the configured interval and if in that time another click arrives, we
|
||||
* need to trigger a double click.
|
||||
*/
|
||||
const auto check_double = [this](eventloop::TimerHandle& handle, mousebtn btn, int pos) {
|
||||
const auto check_double = [this](TimerHandle& handle, mousebtn btn, int pos) {
|
||||
if (!handle.is_active()) {
|
||||
handle.start(m_opts.double_click_interval, 0, [=]() { trigger_click(btn, pos); });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user