mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-31 20:03:48 -07:00
guard onDisconnect
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
|
|
||||||
void CMonitor::onConnect(bool noRule) {
|
void CMonitor::onConnect(bool noRule) {
|
||||||
|
if (m_bEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
// get monitor rule that matches
|
// get monitor rule that matches
|
||||||
SMonitorRule monitorRule = g_pConfigManager->getMonitorRuleFor(output->name);
|
SMonitorRule monitorRule = g_pConfigManager->getMonitorRuleFor(output->name);
|
||||||
|
|
||||||
@@ -109,6 +112,10 @@ void CMonitor::onConnect(bool noRule) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CMonitor::onDisconnect() {
|
void CMonitor::onDisconnect() {
|
||||||
|
|
||||||
|
if (!m_bEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
// Cleanup everything. Move windows back, snap cursor, shit.
|
// Cleanup everything. Move windows back, snap cursor, shit.
|
||||||
CMonitor* BACKUPMON = nullptr;
|
CMonitor* BACKUPMON = nullptr;
|
||||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
Reference in New Issue
Block a user