From ab449c205cb656b32e8d1b8e036783f18704ff8e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 5 Dec 2022 22:15:01 +0000 Subject: Introduce events for Window device pixel ratio changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a mix between screen device pixel ratio. Currently we store the property on a per-window basis, but the change notifications are still on a per screen basis which can fall apart on edge cases. On wayland we are getting per window DPR changes without as useful screen change events so it's important to fix. It also has potential to clean up the Windows backend in the future where the backend is currently papering over the two concepts. This patch introduces two new events: A QWindowSystemInterface to trigger a window DPR change independently of a screen change. An event to notify windows the new DPR rather than needing to track signals on the screen. This happens either when the window dpr changes or implicitly through a screen change. This can deprecate an existing event ScreenChangeInternal so the value is reused and renamed for clarity. Change-Id: I637a07fd4520ba3184ccc2c987c29d8d23a65ad3 Reviewed-by: Tor Arne Vestbø --- src/widgets/widgets/qdockwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 67bb099446..375bd3daae 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -119,7 +119,7 @@ bool QDockWidgetTitleButton::event(QEvent *event) { switch (event->type()) { case QEvent::StyleChange: - case QEvent::ScreenChangeInternal: + case QEvent::DevicePixelRatioChange: m_iconSize = -1; break; default: -- cgit v1.2.3