1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/include/components/screen.hpp
Patrick Ziegler d5be8cad97
Add compiler warning for missing override specifier (#2341)
* build: Add -Wsuggest-override

We should always use the override specifier when overriding virtual
functions. This helps prevent errors when a subclass tries to create a
function with the same name as a virtual function in a super-class but
with a different purpose.

* clang-format

* Upload logs on failure

* Add override to unsupported.hpp

* cmake: Make -Wsuggest-override flag conditional
2021-01-04 10:38:43 +01:00

56 lines
1.1 KiB
C++

#pragma once
#include "common.hpp"
#include "components/types.hpp"
#include "events/signal_emitter.hpp"
#include "events/signal_fwd.hpp"
#include "x11/extensions/randr.hpp"
#include "x11/types.hpp"
#include "x11/window.hpp"
POLYBAR_NS
// fwd
class config;
class logger;
class connection;
class signal_emitter;
class screen : public xpp::event::sink<evt::randr_screen_change_notify> {
public:
using make_type = unique_ptr<screen>;
static make_type make();
explicit screen(connection& conn, signal_emitter& emitter, const logger& logger, const config& conf);
~screen();
struct size size() const {
return m_size;
}
xcb_window_t root() const {
return m_root;
}
protected:
void handle(const evt::randr_screen_change_notify& evt) override;
private:
connection& m_connection;
signal_emitter& m_sig;
const logger& m_log;
const config& m_conf;
xcb_window_t m_root;
xcb_window_t m_proxy{XCB_NONE};
vector<monitor_t> m_monitors;
struct size m_size {
0U, 0U
};
bool m_sigraised{false};
bool have_monitors_changed() const;
};
POLYBAR_NS_END