kms/device: Don't re-enumerate disabled outputs
This commit is contained in:
parent
1db1d8149b
commit
6897f81984
1 changed files with 7 additions and 2 deletions
|
|
@ -586,8 +586,10 @@ impl Device {
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(conn, maybe)| match (surfaces.get(&conn), maybe) {
|
.filter(|(conn, maybe)| match (surfaces.get(&conn), maybe) {
|
||||||
(Some(current_crtc), Some(new_crtc)) => current_crtc != new_crtc,
|
(Some(current_crtc), Some(new_crtc)) => current_crtc != new_crtc,
|
||||||
(None, _) => true,
|
// see `removed`
|
||||||
_ => false,
|
(Some(_), None) => true,
|
||||||
|
// if we already know about it, we don't consider it added
|
||||||
|
(None, _) => self.inner.outputs.get(conn).is_none(),
|
||||||
})
|
})
|
||||||
.map(|(conn, crtc)| (*conn, *crtc))
|
.map(|(conn, crtc)| (*conn, *crtc))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
@ -598,6 +600,9 @@ impl Device {
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(conn, _)| match config.get(conn) {
|
.filter(|(conn, _)| match config.get(conn) {
|
||||||
Some(Some(c)) => surfaces.get(&conn).is_some_and(|crtc| c != crtc),
|
Some(Some(c)) => surfaces.get(&conn).is_some_and(|crtc| c != crtc),
|
||||||
|
// if don't have a crtc, we need to drop the surface if it exists.
|
||||||
|
// so it needs to be in both `removed` AND `added`.
|
||||||
|
Some(None) => surfaces.get(&conn).is_some(),
|
||||||
_ => true,
|
_ => true,
|
||||||
})
|
})
|
||||||
.map(|(conn, _)| *conn)
|
.map(|(conn, _)| *conn)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue