mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-01 20:51:58 -07:00
internal: migrate to damage_ring
This commit is contained in:
@@ -8,6 +8,14 @@ int ratHandler(void* data) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
CMonitor::CMonitor() {
|
||||
wlr_damage_ring_init(&damage);
|
||||
}
|
||||
|
||||
CMonitor::~CMonitor() {
|
||||
wlr_damage_ring_finish(&damage);
|
||||
}
|
||||
|
||||
void CMonitor::onConnect(bool noRule) {
|
||||
hyprListener_monitorDestroy.removeCallback();
|
||||
hyprListener_monitorFrame.removeCallback();
|
||||
@@ -114,13 +122,13 @@ void CMonitor::onConnect(bool noRule) {
|
||||
if (!noRule)
|
||||
g_pHyprRenderer->applyMonitorRule(this, &monitorRule, true);
|
||||
|
||||
wlr_damage_ring_set_bounds(&damage, vecTransformedSize.x, vecTransformedSize.y);
|
||||
|
||||
wlr_xcursor_manager_load(g_pCompositor->m_sWLRXCursorMgr, scale);
|
||||
|
||||
Debug::log(LOG, "Added new monitor with name %s at %i,%i with size %ix%i, pointer %x", output->name, (int)vecPosition.x, (int)vecPosition.y, (int)vecPixelSize.x,
|
||||
(int)vecPixelSize.y, output);
|
||||
|
||||
damage = wlr_output_damage_create(output);
|
||||
|
||||
// add a WLR workspace group
|
||||
if (!pWLRWorkspaceGroupHandle) {
|
||||
pWLRWorkspaceGroupHandle = wlr_ext_workspace_group_handle_v1_create(g_pCompositor->m_sWLREXTWorkspaceMgr);
|
||||
@@ -253,8 +261,6 @@ void CMonitor::onDisconnect() {
|
||||
|
||||
activeWorkspace = -1;
|
||||
|
||||
wlr_output_damage_destroy(damage);
|
||||
|
||||
wlr_output_layout_remove(g_pCompositor->m_sWLROutputLayout, output);
|
||||
|
||||
wlr_output_enable(output, false);
|
||||
@@ -284,11 +290,11 @@ void CMonitor::onDisconnect() {
|
||||
}
|
||||
|
||||
void CMonitor::addDamage(pixman_region32_t* rg) {
|
||||
wlr_output_damage_add(damage, rg);
|
||||
wlr_damage_ring_add(&damage, rg);
|
||||
}
|
||||
|
||||
void CMonitor::addDamage(wlr_box* box) {
|
||||
wlr_output_damage_add_box(damage, box);
|
||||
wlr_damage_ring_add_box(&damage, box);
|
||||
}
|
||||
|
||||
bool CMonitor::isMirror() {
|
||||
|
Reference in New Issue
Block a user