src/components/screen.cpp
/**
 * Checks if the stored monitor list is different from a newly fetched one
 *
 * Fetches the monitor list and compares it with the one stored
 */
Checks if the stored monitor list is different from a newly fetched one
Fetches the monitor list and compares it with the one stored
Checks if the stored monitor list is different from a newly fetched one Fetches the monitor list and compares it with the one stored
bool screen::have_monitors_changed() const {
  auto monitors = randr_util::get_monitors(m_connection, m_root, true, false);
  if (monitors.size() != m_monitors.size()) {
    return true;
  }
  for (auto m : m_monitors) {
    auto it =
        std::find_if(monitors.begin(), monitors.end(), [m](auto& monitor) -> bool { return m->equals(*monitor); });
    if (it == monitors.end()) {
      return true;
    }
  }
  return false;
}
bool screen :: have_monitors_changed ( ) const { auto monitors = randr_util :: get_monitors ( m_connection , m_root , true , false ) ; if ( monitors . size ( ) != m_monitors . size ( ) ) { return true ; } for ( auto m : m_monitors ) { auto it = std :: find_if ( monitors . begin ( ) , monitors . end ( ) , [ m ] ( auto & monitor ) -> bool { return m -> equals ( * monitor ) ; } ) ; if ( it == monitors . end ( ) ) { return true ; } } return false ; }
Checks if the stored monitor list is different from a newly fetched one
 Fetches the monitor list and compares it with the one stored
Checks if the stored monitor list is different from a newly fetched one Fetches the monitor list and compares it with the one stored
/*
     * Every monitor in the stored list should also exist in the newly fetched
     * list. If this holds then the two lists are equivalent since they have
     * the same size
     */