Changeset View
Changeset View
Standalone View
Standalone View
applets/appmenu/plugin/appmenumodel.cpp
Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Line(s) | |||||
255 | #endif | 255 | #endif | ||
256 | 256 | | |||
257 | } | 257 | } | ||
258 | 258 | | |||
259 | void AppMenuModel::onWindowChanged(WId id) | 259 | void AppMenuModel::onWindowChanged(WId id) | ||
260 | { | 260 | { | ||
261 | if (m_currentWindowId == id) { | 261 | if (m_currentWindowId == id) { | ||
262 | KWindowInfo info(id, NET::WMState | NET::WMGeometry); | 262 | KWindowInfo info(id, NET::WMState | NET::WMGeometry); | ||
263 | const bool contained = m_screenGeometry.isNull() || m_screenGeometry.contains(info.geometry().center()); | 263 | | ||
264 | //! HACK: if the user has enabled screen scaling under X11 environment | ||||
265 | //! then the window and screen geometries can not be trusted for comparison | ||||
266 | //! before windows coordinates be adjusted properly. | ||||
267 | //! BUG: 404500 | ||||
268 | QPoint windowCenter = info.geometry().center(); | ||||
269 | if (KWindowSystem::isPlatformX11()) { | ||||
270 | windowCenter /= qApp->devicePixelRatio(); | ||||
271 | } | ||||
272 | | ||||
273 | const bool contained = m_screenGeometry.isNull() || m_screenGeometry.contains(windowCenter); | ||||
264 | 274 | | |||
265 | setVisible(contained && !info.isMinimized()); | 275 | setVisible(contained && !info.isMinimized()); | ||
266 | } | 276 | } | ||
267 | } | 277 | } | ||
268 | 278 | | |||
269 | QHash<int, QByteArray> AppMenuModel::roleNames() const | 279 | QHash<int, QByteArray> AppMenuModel::roleNames() const | ||
270 | { | 280 | { | ||
271 | QHash<int, QByteArray> roleNames; | 281 | QHash<int, QByteArray> roleNames; | ||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |