src/modules/xworkspaces.cpp
/**
   * Rebuild the list of managed clients
   */
Rebuild the list of managed clients
Rebuild the list of managed clients
void xworkspaces_module::rebuild_clientlist() {
    vector<xcb_window_t> newclients = ewmh_util::get_client_list();
    std::sort(newclients.begin(), newclients.end());
    for (auto&& client : newclients) {
      if (m_clients.count(client) == 0) {
        m_connection.ensure_event_mask(client, XCB_EVENT_MASK_PROPERTY_CHANGE);
      }
    }
    m_clients.clear();
    m_windows.clear();
    for (auto&& client : newclients) {
      auto desk = ewmh_util::get_desktop_from_window(client);
      m_clients[client] = desk;
      m_windows[desk]++;
    }
    rebuild_urgent_hints();
  }
void xworkspaces_module :: rebuild_clientlist ( ) { vector < xcb_window_t > newclients = ewmh_util :: get_client_list ( ) ; std :: sort ( newclients . begin ( ) , newclients . end ( ) ) ; for ( auto && client : newclients ) { if ( m_clients . count ( client ) == 0 ) { m_connection . ensure_event_mask ( client , XCB_EVENT_MASK_PROPERTY_CHANGE ) ; } } m_clients . clear ( ) ; m_windows . clear ( ) ; for ( auto && client : newclients ) { auto desk = ewmh_util :: get_desktop_from_window ( client ) ; m_clients [ client ] = desk ; m_windows [ desk ] ++ ; } rebuild_urgent_hints ( ) ; }
Rebuild the list of managed clients
Rebuild the list of managed clients
// new client: listen for changes (wm_hint or desktop) // rebuild entire mapping of clients to desktops