Reuse same ID when reconnecting monitor, otherwise use minimum available ID (#2666)

Fixes #2601
This commit is contained in:
Tuur Vanhoutte
2023-07-09 23:08:40 +02:00
committed by GitHub
parent b33d82734f
commit b99ac063ea
3 changed files with 20 additions and 8 deletions

View File

@@ -101,6 +101,8 @@ class CCompositor {
std::vector<CWindow*> m_vWindowsFadingOut;
std::vector<SLayerSurface*> m_vSurfacesFadingOut;
std::unordered_map<std::string, int64_t> m_mMonitorIDMap;
void initServer();
void startCompositor();
void cleanup();
@@ -168,7 +170,7 @@ class CCompositor {
CMonitor* getMonitorInDirection(const char&);
void updateAllWindowsAnimatedDecorationValues();
void updateWindowAnimatedDecorationValues(CWindow*);
int getNextAvailableMonitorID();
int getNextAvailableMonitorID(std::string const & name);
void moveWorkspaceToMonitor(CWorkspace*, CMonitor*);
void swapActiveWorkspaces(CMonitor*, CMonitor*);
CMonitor* getMonitorFromString(const std::string&);