Remove screen realloc argument
Replaced with explicit reset function
This commit is contained in:
parent
d296d67953
commit
aadd4ce1c8
@ -108,7 +108,8 @@ class connection : public detail::connection_base<connection&, XPP_EXTENSION_LIS
|
||||
|
||||
static void pack_values(uint32_t mask, const void* src, std::array<uint32_t, 32>& dest);
|
||||
|
||||
xcb_screen_t* screen(bool realloc = false);
|
||||
void reset_screen();
|
||||
xcb_screen_t* screen();
|
||||
|
||||
string id(xcb_window_t w) const;
|
||||
|
||||
|
@ -98,7 +98,8 @@ void screen::handle(const evt::randr_screen_change_notify& evt) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto screen = m_connection.screen(true);
|
||||
m_connection.reset_screen();
|
||||
auto screen = m_connection.screen();
|
||||
auto changed = false;
|
||||
|
||||
// We need to reload if the screen size changed as well
|
||||
|
@ -79,13 +79,15 @@ string connection::id(xcb_window_t w) const {
|
||||
return sstream() << "0x" << std::hex << std::setw(7) << std::setfill('0') << w;
|
||||
}
|
||||
|
||||
void connection::reset_screen() {
|
||||
m_screen = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pointer to the default xcb screen
|
||||
*
|
||||
* TODO remove realloc param. Create explicit realloc function
|
||||
*/
|
||||
xcb_screen_t* connection::screen(bool realloc) {
|
||||
if (m_screen == nullptr || realloc) {
|
||||
xcb_screen_t* connection::screen() {
|
||||
if (m_screen == nullptr) {
|
||||
m_screen = screen_of_display(default_screen());
|
||||
}
|
||||
return m_screen;
|
||||
|
Loading…
Reference in New Issue
Block a user