From 4fca0c89b4318f619957e16958ebb1d8253b677a Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 9 Dec 2016 09:40:46 +0100 Subject: [PATCH] refactor: Object construction --- include/components/bar.hpp | 3 ++- include/components/command_line.hpp | 3 ++- include/components/config.hpp | 3 ++- include/components/controller.hpp | 22 +++++++++++++++------- include/components/eventloop.hpp | 3 ++- include/components/eventloop_fwd.hpp | 18 ------------------ include/components/ipc.hpp | 3 ++- include/components/logger.hpp | 3 ++- include/components/renderer.hpp | 3 ++- include/components/screen.hpp | 3 ++- include/events/signal_emitter.hpp | 3 ++- include/modules/meta/base.hpp | 2 +- include/modules/meta/base.inl | 8 +++++--- include/modules/xbacklight.hpp | 2 +- include/modules/xkeyboard.hpp | 2 +- include/modules/xwindow.hpp | 2 +- include/modules/xworkspaces.hpp | 2 +- include/x11/connection.hpp | 3 ++- include/x11/fonts.hpp | 3 ++- include/x11/tray_manager.hpp | 3 ++- src/components/bar.cpp | 2 +- src/components/command_line.cpp | 2 +- src/components/config.cpp | 6 +++--- src/components/controller.cpp | 22 ++++++++++------------ src/components/eventloop.cpp | 2 +- src/components/ipc.cpp | 2 +- src/components/logger.cpp | 2 +- src/components/renderer.cpp | 2 +- src/components/screen.cpp | 2 +- src/events/signal_emitter.cpp | 3 +-- src/main.cpp | 6 +++--- src/modules/xbacklight.cpp | 4 ++-- src/modules/xkeyboard.cpp | 4 ++-- src/modules/xwindow.cpp | 4 ++-- src/modules/xworkspaces.cpp | 4 ++-- src/x11/connection.cpp | 2 +- src/x11/fonts.cpp | 2 +- src/x11/randr.cpp | 2 +- src/x11/tray_manager.cpp | 2 +- 39 files changed, 85 insertions(+), 84 deletions(-) delete mode 100644 include/components/eventloop_fwd.hpp diff --git a/include/components/bar.hpp b/include/components/bar.hpp index 6e36570a..aaedd311 100644 --- a/include/components/bar.hpp +++ b/include/components/bar.hpp @@ -25,7 +25,8 @@ class renderer; class bar : public xpp::event::sink { public: - static unique_ptr make(); + using make_type = unique_ptr; + static make_type make(); explicit bar(connection& conn, signal_emitter& emitter, const config& config, const logger& logger, unique_ptr screen, unique_ptr tray_manager); diff --git a/include/components/command_line.hpp b/include/components/command_line.hpp index 05e519d9..c2e203e6 100644 --- a/include/components/command_line.hpp +++ b/include/components/command_line.hpp @@ -36,7 +36,8 @@ namespace command_line { class parser { public: - static unique_ptr make(string scriptname, const options& opts); + using make_type = unique_ptr; + static make_type make(string scriptname, const options& opts); explicit parser(const string& synopsis, const options& opts) : m_synopsis(synopsis), m_opts(opts) {} diff --git a/include/components/config.hpp b/include/components/config.hpp index 5a7fd9aa..10ca9a4d 100644 --- a/include/components/config.hpp +++ b/include/components/config.hpp @@ -26,7 +26,8 @@ class config { using valuemap_t = std::unordered_map; using sectionmap_t = std::unordered_map; - static const config& make(); + using make_type = const config&; + static make_type make(); explicit config(const logger& logger, const xresource_manager& xrm) : m_logger(logger), m_xrm(xrm) {} diff --git a/include/components/controller.hpp b/include/components/controller.hpp index e59f7044..5668a2d5 100644 --- a/include/components/controller.hpp +++ b/include/components/controller.hpp @@ -4,18 +4,12 @@ #include "common.hpp" #include "components/bar.hpp" -#include "components/config.hpp" -#include "components/eventloop.hpp" #include "components/ipc.hpp" -#include "components/logger.hpp" #include "components/types.hpp" #include "config.hpp" #include "events/signal_emitter.hpp" #include "events/signal_fwd.hpp" #include "events/signal_receiver.hpp" -#include "utils/command.hpp" -#include "utils/inotify.hpp" -#include "x11/connection.hpp" #include "x11/types.hpp" POLYBAR_NS @@ -23,7 +17,20 @@ POLYBAR_NS // fwd decl {{{ class bar; +class config; +class connection; +class eventloop; +class logger; struct bar_settings; +namespace inotify_util { + class inotify_watch; + using watch_t = unique_ptr; +} +namespace command_util { + class command; +} +using command = command_util::command; +using command_t = unique_ptr; // }}} @@ -37,7 +44,8 @@ class controller : public signal_receiver { public: - static unique_ptr make(watch_t&& confwatch, bool enable_ipc = false, bool writeback = false); + using make_type = unique_ptr; + static make_type make(string&& path_confwatch, bool enable_ipc = false, bool writeback = false); explicit controller(connection& conn, signal_emitter& emitter, const logger& logger, const config& config, unique_ptr eventloop, unique_ptr bar, unique_ptr ipc, watch_t confwatch, bool writeback); diff --git a/include/components/eventloop.hpp b/include/components/eventloop.hpp index 50a25850..ab892e1a 100644 --- a/include/components/eventloop.hpp +++ b/include/components/eventloop.hpp @@ -54,7 +54,8 @@ class eventloop : public signal_receiver; public: - static unique_ptr make(); + using make_type = unique_ptr; + static make_type make(); explicit eventloop(signal_emitter& emitter, const logger& logger, const config& config); ~eventloop(); diff --git a/include/components/eventloop_fwd.hpp b/include/components/eventloop_fwd.hpp deleted file mode 100644 index 1558cec6..00000000 --- a/include/components/eventloop_fwd.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "common.hpp" - -POLYBAR_NS - -enum class event_type; -struct event; -struct quit_event; -struct update_event; -struct input_event; - -class eventloop { - public: - using entry_t = event; -}; - -POLYBAR_NS_END diff --git a/include/components/ipc.hpp b/include/components/ipc.hpp index 78ef8f9e..d8aae2a4 100644 --- a/include/components/ipc.hpp +++ b/include/components/ipc.hpp @@ -33,7 +33,8 @@ struct ipc_action { */ class ipc { public: - static unique_ptr make(); + using make_type = unique_ptr; + static make_type make(); explicit ipc(signal_emitter& emitter, const logger& logger) : m_sig(emitter), m_log(logger) {} ~ipc(); diff --git a/include/components/logger.hpp b/include/components/logger.hpp index 6539dd16..d712f680 100644 --- a/include/components/logger.hpp +++ b/include/components/logger.hpp @@ -20,7 +20,8 @@ loglevel parse_loglevel_name(const string& name); class logger { public: - static const logger& make(loglevel level = loglevel::NONE); + using make_type = const logger&; + static make_type make(loglevel level = loglevel::NONE); explicit logger(loglevel level); explicit logger(string level_name) : logger(parse_loglevel_name(level_name)) {} diff --git a/include/components/renderer.hpp b/include/components/renderer.hpp index 65027761..659d600c 100644 --- a/include/components/renderer.hpp +++ b/include/components/renderer.hpp @@ -25,7 +25,8 @@ class renderer public: enum class gc : uint8_t { BG, FG, OL, UL, BT, BB, BL, BR }; - static unique_ptr make(const bar_settings& bar, vector&& fonts); + using make_type = unique_ptr; + static make_type make(const bar_settings& bar, vector&& fonts); explicit renderer(connection& conn, signal_emitter& emitter, const logger& logger, unique_ptr font_manager, const bar_settings& bar, const vector& fonts); diff --git a/include/components/screen.hpp b/include/components/screen.hpp index 07014f86..03ecc668 100644 --- a/include/components/screen.hpp +++ b/include/components/screen.hpp @@ -18,7 +18,8 @@ class signal_emitter; class screen : public xpp::event::sink { public: - static unique_ptr make(); + using make_type = unique_ptr; + static make_type make(); explicit screen(connection& conn, signal_emitter& emitter, const logger& logger, const config& conf); ~screen(); diff --git a/include/events/signal_emitter.hpp b/include/events/signal_emitter.hpp index 816dc002..85fbbf1c 100644 --- a/include/events/signal_emitter.hpp +++ b/include/events/signal_emitter.hpp @@ -18,7 +18,8 @@ extern signal_receivers_t g_signal_receivers; */ class signal_emitter { public: - static signal_emitter& make(); + using make_type = signal_emitter&; + static make_type make(); explicit signal_emitter() = default; virtual ~signal_emitter() {} diff --git a/include/modules/meta/base.hpp b/include/modules/meta/base.hpp index d62e318e..fe2de341 100644 --- a/include/modules/meta/base.hpp +++ b/include/modules/meta/base.hpp @@ -123,7 +123,7 @@ namespace modules { template class module : public module_interface { public: - module(const bar_settings bar, const logger& logger, const config& config, string name); + module(const bar_settings bar, string name); ~module() noexcept; void set_update_cb(callback<>&& cb); diff --git a/include/modules/meta/base.inl b/include/modules/meta/base.inl index 98a27d55..d06e8247 100644 --- a/include/modules/meta/base.inl +++ b/include/modules/meta/base.inl @@ -1,4 +1,6 @@ #include "components/builder.hpp" +#include "components/logger.hpp" +#include "components/config.hpp" POLYBAR_NS @@ -6,10 +8,10 @@ namespace modules { // module public {{{ template - module::module(const bar_settings bar, const logger& logger, const config& config, string name) + module::module(const bar_settings bar, string name) : m_bar(bar) - , m_log(logger) - , m_conf(config) + , m_log(logger::make()) + , m_conf(config::make()) , m_name("module/" + name) , m_builder(make_unique(bar)) , m_formatter(make_unique(m_conf, m_name)) {} diff --git a/include/modules/xbacklight.hpp b/include/modules/xbacklight.hpp index f4e183aa..a50406da 100644 --- a/include/modules/xbacklight.hpp +++ b/include/modules/xbacklight.hpp @@ -25,7 +25,7 @@ namespace modules { */ class xbacklight_module : public static_module, public xpp::event::sink { public: - explicit xbacklight_module(const bar_settings& bar, const logger& logger, const config& config, string name); + explicit xbacklight_module(const bar_settings& bar, string name); void setup(); void teardown(); diff --git a/include/modules/xkeyboard.hpp b/include/modules/xkeyboard.hpp index e82e86a1..7f6c9fc7 100644 --- a/include/modules/xkeyboard.hpp +++ b/include/modules/xkeyboard.hpp @@ -19,7 +19,7 @@ namespace modules { class xkeyboard_module : public static_module, public xpp::event::sink { public: - explicit xkeyboard_module(const bar_settings& bar, const logger& logger, const config& config, string name); + explicit xkeyboard_module(const bar_settings& bar, string name); void setup(); void teardown(); diff --git a/include/modules/xwindow.hpp b/include/modules/xwindow.hpp index 6ab4afab..bccfb085 100644 --- a/include/modules/xwindow.hpp +++ b/include/modules/xwindow.hpp @@ -32,7 +32,7 @@ namespace modules { */ class xwindow_module : public static_module, public xpp::event::sink { public: - explicit xwindow_module(const bar_settings&, const logger&, const config&, string); + explicit xwindow_module(const bar_settings&, string); void setup(); void teardown(); diff --git a/include/modules/xworkspaces.hpp b/include/modules/xworkspaces.hpp index b74f3faf..7d68212f 100644 --- a/include/modules/xworkspaces.hpp +++ b/include/modules/xworkspaces.hpp @@ -49,7 +49,7 @@ namespace modules { */ class xworkspaces_module : public static_module, public xpp::event::sink { public: - explicit xworkspaces_module(const bar_settings& bar, const logger& logger, const config& config, string name); + explicit xworkspaces_module(const bar_settings& bar, string name); void setup(); void teardown(); diff --git a/include/x11/connection.hpp b/include/x11/connection.hpp index 8b49aa50..c018f926 100644 --- a/include/x11/connection.hpp +++ b/include/x11/connection.hpp @@ -20,7 +20,8 @@ using xpp_connection = xpp::connection; class connection : public xpp_connection { public: - static connection& make(); + using make_type = connection&; + static make_type make(); explicit connection(xcb_connection_t* conn) : connection(conn, 0) {} explicit connection(xcb_connection_t* conn, int connection_fd) diff --git a/include/x11/fonts.hpp b/include/x11/fonts.hpp index 2c3a2d9c..1ff24a51 100644 --- a/include/x11/fonts.hpp +++ b/include/x11/fonts.hpp @@ -39,7 +39,8 @@ using font_t = unique_ptr; class font_manager { public: - static unique_ptr make(); + using make_type = unique_ptr; + static make_type make(); explicit font_manager(connection& conn, const logger& logger); ~font_manager(); diff --git a/include/x11/tray_manager.hpp b/include/x11/tray_manager.hpp index be9c55ca..a5838f5a 100644 --- a/include/x11/tray_manager.hpp +++ b/include/x11/tray_manager.hpp @@ -65,7 +65,8 @@ class tray_manager : public xpp::event::sink, public signal_receiver { public: - static unique_ptr make(); + using make_type = unique_ptr; + static make_type make(); explicit tray_manager(connection& conn, signal_emitter& emitter, const logger& logger); diff --git a/src/components/bar.cpp b/src/components/bar.cpp index 1b2c065f..88f8b931 100644 --- a/src/components/bar.cpp +++ b/src/components/bar.cpp @@ -35,7 +35,7 @@ using namespace wm_util; /** * Create instance */ -unique_ptr bar::make() { +bar::make_type bar::make() { // clang-format off return factory_util::unique( connection::make(), diff --git a/src/components/command_line.cpp b/src/components/command_line.cpp index d3a3690d..b8ccb55b 100644 --- a/src/components/command_line.cpp +++ b/src/components/command_line.cpp @@ -10,7 +10,7 @@ POLYBAR_NS /** * Create instance */ -unique_ptr cliparser::make(string scriptname, const clioptions& opts) { +cliparser::make_type cliparser::make(string scriptname, const clioptions& opts) { return factory_util::unique("Usage: " + scriptname + " bar_name [OPTION...]", opts); } diff --git a/src/components/config.cpp b/src/components/config.cpp index 11e794fc..edff42a7 100644 --- a/src/components/config.cpp +++ b/src/components/config.cpp @@ -13,9 +13,9 @@ POLYBAR_NS /** * Create instance */ -const config& config::make() { - shared_ptr instance = factory_util::singleton(logger::make(), xresource_manager::make()); - return static_cast(*instance); +config::make_type config::make() { + auto instance = factory_util::singleton(logger::make(), xresource_manager::make()); + return static_cast(*instance); } /** diff --git a/src/components/controller.cpp b/src/components/controller.cpp index 462ff3d1..242fca10 100644 --- a/src/components/controller.cpp +++ b/src/components/controller.cpp @@ -7,9 +7,12 @@ #include "components/logger.hpp" #include "events/signal.hpp" #include "modules/meta/factory.hpp" +#include "utils/command.hpp" #include "utils/factory.hpp" +#include "utils/inotify.hpp" #include "utils/process.hpp" #include "utils/string.hpp" +#include "x11/connection.hpp" #include "x11/xutils.hpp" POLYBAR_NS @@ -19,13 +22,7 @@ using namespace modules; /** * Create instance */ -unique_ptr controller::make(watch_t&& confwatch, bool enable_ipc, bool writeback) { - unique_ptr ipc; - - if (enable_ipc) { - ipc = ipc::make(); - } - +controller::make_type controller::make(string&& path_confwatch, bool enable_ipc, bool writeback) { // clang-format off return factory_util::unique( connection::make(), @@ -34,8 +31,8 @@ unique_ptr controller::make(watch_t&& confwatch, bool enable_ipc, bo config::make(), eventloop::make(), bar::make(), - move(ipc), - move(confwatch), + enable_ipc ? ipc::make() : ipc::make_type{}, + !path_confwatch.empty() ? inotify_util::make_watch(path_confwatch) : watch_t{}, writeback); // clang-format on } @@ -124,7 +121,7 @@ void controller::setup() { throw application_error("Inter-process messaging needs to be enabled"); } - unique_ptr module{make_module(move(type), m_bar->settings(), m_log, m_conf, module_name)}; + unique_ptr module{make_module(move(type), m_bar->settings(), module_name)}; module->set_update_cb([&] { if (m_eventloop && m_running) { @@ -340,7 +337,7 @@ bool controller::on(const sig_ev::process_update& evt) { try { if (!m_writeback) { - m_bar->parse(contents, evt()); + m_bar->parse(move(contents), evt()); } else { std::cout << contents << std::endl; } @@ -362,7 +359,7 @@ bool controller::on(const sig_ev::process_input& evt) { m_log.info("Executing shell command: %s", input); - m_command = command_util::make_command(input); + m_command = command_util::make_command(move(input)); m_command->exec(); m_command.reset(); } catch (const application_error& err) { @@ -404,6 +401,7 @@ bool controller::on(const sig_ipc::process_action& evt) { m_log.err("Cannot enqueue empty ipc action"); } else { m_log.info("Enqueuing ipc action: %s", action); + m_eventloop->enqueue(eventloop::make_input_data(move(action))); m_eventloop->enqueue(eventloop::make_input_evt()); } return true; diff --git a/src/components/eventloop.cpp b/src/components/eventloop.cpp index 01e25790..239dbf36 100644 --- a/src/components/eventloop.cpp +++ b/src/components/eventloop.cpp @@ -17,7 +17,7 @@ POLYBAR_NS /** * Create instance */ -unique_ptr eventloop::make() { +eventloop::make_type eventloop::make() { return factory_util::unique(signal_emitter::make(), logger::make(), config::make()); } diff --git a/src/components/ipc.cpp b/src/components/ipc.cpp index 856f84c9..7c576f0f 100644 --- a/src/components/ipc.cpp +++ b/src/components/ipc.cpp @@ -18,7 +18,7 @@ using namespace signals::ipc; /** * Create instance */ -unique_ptr ipc::make() { +ipc::make_type ipc::make() { return factory_util::unique(signal_emitter::make(), logger::make()); } diff --git a/src/components/logger.cpp b/src/components/logger.cpp index 6a8a6536..80989fa5 100644 --- a/src/components/logger.cpp +++ b/src/components/logger.cpp @@ -10,7 +10,7 @@ POLYBAR_NS /** * Create instance */ -const logger& logger::make(loglevel level) { +logger::make_type logger::make(loglevel level) { auto instance = factory_util::singleton(level); return static_cast(*instance); } diff --git a/src/components/renderer.cpp b/src/components/renderer.cpp index 6bd00bf8..66c5eb95 100644 --- a/src/components/renderer.cpp +++ b/src/components/renderer.cpp @@ -18,7 +18,7 @@ POLYBAR_NS /** * Create instance */ -unique_ptr renderer::make(const bar_settings& bar, vector&& fonts) { +renderer::make_type renderer::make(const bar_settings& bar, vector&& fonts) { // clang-format off return factory_util::unique( connection::make(), diff --git a/src/components/screen.cpp b/src/components/screen.cpp index 7e66fe78..c0e86463 100644 --- a/src/components/screen.cpp +++ b/src/components/screen.cpp @@ -19,7 +19,7 @@ using namespace signals::eventloop; /** * Create instance */ -unique_ptr screen::make() { +screen::make_type screen::make() { return factory_util::unique( connection::make(), signal_emitter::make(), logger::make(), config::make()); } diff --git a/src/events/signal_emitter.cpp b/src/events/signal_emitter.cpp index bf5e6090..c45d7ec1 100644 --- a/src/events/signal_emitter.cpp +++ b/src/events/signal_emitter.cpp @@ -1,5 +1,4 @@ #include "events/signal_emitter.hpp" -#include "events/signal_receiver.hpp" POLYBAR_NS @@ -8,7 +7,7 @@ signal_receivers_t g_signal_receivers; /** * Create instance */ -signal_emitter& signal_emitter::make() { +signal_emitter::make_type signal_emitter::make() { auto instance = factory_util::singleton(); return static_cast(*instance); } diff --git a/src/main.cpp b/src/main.cpp index c21f3ecd..04133523 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -117,17 +117,17 @@ int main(int argc, char** argv) { // Create controller and run application //================================================== unique_ptr ctrl; + string path_confwatch; bool enable_ipc{false}; - watch_t confwatch; if (!cli->has("print-wmname")) { enable_ipc = conf.get(conf.bar_section(), "enable-ipc", false); } if (!cli->has("print-wmname") && cli->has("reload")) { - inotify_util::make_watch(conf.filepath()); + path_confwatch = conf.filepath(); } - ctrl = controller::make(move(confwatch), enable_ipc, cli->has("stdout")); + ctrl = controller::make(move(path_confwatch), enable_ipc, cli->has("stdout")); if (cli->has("print-wmname")) { cout << ctrl->opts().wmname << endl; diff --git a/src/modules/xbacklight.cpp b/src/modules/xbacklight.cpp index 8e5a4610..371b3122 100644 --- a/src/modules/xbacklight.cpp +++ b/src/modules/xbacklight.cpp @@ -19,8 +19,8 @@ namespace modules { /** * Construct module */ - xbacklight_module::xbacklight_module(const bar_settings& bar, const logger& logger, const config& config, string name) - : static_module(bar, logger, config, name) + xbacklight_module::xbacklight_module(const bar_settings& bar, string name) + : static_module(bar, move(name)) , m_connection(connection::make()) {} /** diff --git a/src/modules/xkeyboard.cpp b/src/modules/xkeyboard.cpp index 826c1d49..41815c4c 100644 --- a/src/modules/xkeyboard.cpp +++ b/src/modules/xkeyboard.cpp @@ -17,8 +17,8 @@ namespace modules { /** * Construct module */ - xkeyboard_module::xkeyboard_module(const bar_settings& bar, const logger& logger, const config& config, string name) - : static_module(bar, logger, config, name), m_connection(connection::make()) {} + xkeyboard_module::xkeyboard_module(const bar_settings& bar, string name) + : static_module(bar, move(name)), m_connection(connection::make()) {} /** * Bootstrap the module diff --git a/src/modules/xwindow.cpp b/src/modules/xwindow.cpp index 27d55c89..8633a590 100644 --- a/src/modules/xwindow.cpp +++ b/src/modules/xwindow.cpp @@ -64,8 +64,8 @@ namespace modules { /** * Construct module */ - xwindow_module::xwindow_module(const bar_settings& bar, const logger& logger, const config& config, string name) - : static_module(bar, logger, config, name), m_connection(connection::make()) {} + xwindow_module::xwindow_module(const bar_settings& bar, string name) + : static_module(bar, name), m_connection(connection::make()) {} /** * Bootstrap the module diff --git a/src/modules/xworkspaces.cpp b/src/modules/xworkspaces.cpp index e5679a88..b1df7ffe 100644 --- a/src/modules/xworkspaces.cpp +++ b/src/modules/xworkspaces.cpp @@ -21,8 +21,8 @@ namespace modules { * Construct module */ xworkspaces_module::xworkspaces_module( - const bar_settings& bar, const logger& logger, const config& config, string name) - : static_module(bar, logger, config, name) + const bar_settings& bar, string name) + : static_module(bar, move(name)) , m_connection(connection::make()) {} /** diff --git a/src/x11/connection.cpp b/src/x11/connection.cpp index e8dd95d9..349fa42c 100644 --- a/src/x11/connection.cpp +++ b/src/x11/connection.cpp @@ -11,7 +11,7 @@ POLYBAR_NS /** * Create instance */ -connection& connection::make() { +connection::make_type connection::make() { auto instance = factory_util::singleton(xutils::get_connection(), xutils::get_connection_fd()); return static_cast(*instance); } diff --git a/src/x11/fonts.cpp b/src/x11/fonts.cpp index f7f6e2c9..a84fb2ac 100644 --- a/src/x11/fonts.cpp +++ b/src/x11/fonts.cpp @@ -14,7 +14,7 @@ POLYBAR_NS /** * Create instance */ -unique_ptr font_manager::make() { +font_manager::make_type font_manager::make() { return factory_util::unique(connection::make(), logger::make()); } diff --git a/src/x11/randr.cpp b/src/x11/randr.cpp index 2a0abbca..a10e87d2 100644 --- a/src/x11/randr.cpp +++ b/src/x11/randr.cpp @@ -61,7 +61,7 @@ namespace randr_util { } auto crtc = conn.get_crtc_info(info->crtc); string name{info.name().begin(), info.name().end()}; - monitors.emplace_back(make_monitor(*it, name, crtc->width, crtc->height, crtc->x, crtc->y)); + monitors.emplace_back(make_monitor(*it, move(name), crtc->width, crtc->height, crtc->x, crtc->y)); } catch (const xpp::randr::error::bad_crtc&) { } catch (const xpp::randr::error::bad_output&) { } diff --git a/src/x11/tray_manager.cpp b/src/x11/tray_manager.cpp index e2b0680b..270a83d3 100644 --- a/src/x11/tray_manager.cpp +++ b/src/x11/tray_manager.cpp @@ -46,7 +46,7 @@ using namespace wm_util; /** * Create instance */ -unique_ptr tray_manager::make() { +tray_manager::make_type tray_manager::make() { return factory_util::unique(connection::make(), signal_emitter::make(), logger::make()); }