aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authorVersus Void <versusvoid@gmail.com>2017-10-22 10:01:21 +0000
committerVersus Void <versusvoid@gmail.com>2017-10-22 21:34:56 +0000
commitecb2a2b0d3c5766f0147af2a54ec7d213c070f88 (patch)
tree13ed8b1dab5f079f7ecdffa0eb4eb1145820d925 /backend/drm/drm.c
parent018cd98620b1dbc1c4866bd8406a2841e5768792 (diff)
Emit output resolution event only when resolution changes
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 51a5f636..4c13d01a 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -437,10 +437,12 @@ static bool wlr_drm_connector_set_mode(struct wlr_output *output,
crtc->cursor ? crtc->cursor - drm->cursor_planes : -1);
conn->state = WLR_DRM_CONN_CONNECTED;
- conn->output.width = mode->width;
- conn->output.height = mode->height;
conn->output.current_mode = mode;
- wl_signal_emit(&conn->output.events.resolution, &conn->output);
+ if (conn->output.width != mode->width || conn->output.height != mode->height) {
+ conn->output.width = mode->width;
+ conn->output.height = mode->height;
+ wl_signal_emit(&conn->output.events.resolution, &conn->output);
+ }
// Since realloc_crtcs can deallocate planes on OTHER outputs,
// we actually need to reinitalise all of them