New upstream version 2.0.9.10
Boyuan Yang
5 years ago
0 | <a name="2.0.9.10"></a> | |
1 | ## 2.0.9.10 (2018-11-30) | |
2 | ||
3 | ||
4 | #### Bug Fixes | |
5 | ||
6 | * the dialog type window will be closed after pressing Super+D ([251418bf](https://github.com/linuxdeepin/dtkwidget/commit/251418bf2423da81fbce5731347fc05c5e23a646)) | |
7 | * workaround QTapAndHoldGesture comes late than right press in dde-daemon ([2af710be](https://github.com/linuxdeepin/dtkwidget/commit/2af710bec685739d5b3a2e113c3e2a860ce0197b)) | |
8 | * **DPasswdEditAnimated:** modify parent for tip widget ([b9edc9d3](https://github.com/linuxdeepin/dtkwidget/commit/b9edc9d36386fcd9537e0b5cafc734e1696fa294)) | |
9 | * **dtabbar:** horizontal dragging delays. ([9efe4990](https://github.com/linuxdeepin/dtkwidget/commit/9efe4990c128e6a5a306057ae52abf614607c9a6)) | |
10 | ||
11 | #### Features | |
12 | ||
13 | * set QTapAndHoldGesture::timeout in DApplication ([a3e23a7e](https://github.com/linuxdeepin/dtkwidget/commit/a3e23a7e233df7b22fa6d8340df80a7744bb8ab7)) | |
14 | * **DWindowManagerHelper:** add inteface: "windowManagerName" ([d4c557f1](https://github.com/linuxdeepin/dtkwidget/commit/d4c557f1d54beb77591b9a208bdbb201f20a376a)) | |
15 | ||
16 | ||
17 | ||
0 | 18 | <a name="2.0.9.9"></a> |
1 | 19 | ## 2.0.9.9 (2018-11-09) |
2 | 20 |
33 | 33 | // functions |
34 | 34 | DEFINE_CONST_CHAR(hasBlurWindow); |
35 | 35 | DEFINE_CONST_CHAR(hasComposite); |
36 | DEFINE_CONST_CHAR(windowManagerName); | |
36 | 37 | DEFINE_CONST_CHAR(connectWindowManagerChangedSignal); |
37 | 38 | DEFINE_CONST_CHAR(connectHasBlurWindowChanged); |
38 | 39 | DEFINE_CONST_CHAR(connectHasCompositeChanged); |
257 | 258 | return hasComposite && reinterpret_cast<bool(*)()>(hasComposite)(); |
258 | 259 | } |
259 | 260 | |
261 | QString DWindowManagerHelper::windowManagerNameString() const | |
262 | { | |
263 | QFunctionPointer windowManagerName = Q_NULLPTR; | |
264 | ||
265 | #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) | |
266 | windowManagerName = qApp->platformFunction(_windowManagerName); | |
267 | #endif | |
268 | ||
269 | return windowManagerName ? reinterpret_cast<QString(*)()>(windowManagerName)() : QString(); | |
270 | } | |
271 | ||
272 | DWindowManagerHelper::WMName DWindowManagerHelper::windowManagerName() const | |
273 | { | |
274 | const QString &wmName = windowManagerNameString(); | |
275 | ||
276 | if (wmName == QStringLiteral("Mutter(DeepinGala)")) { | |
277 | return DeepinWM; | |
278 | } | |
279 | ||
280 | if (wmName == QStringLiteral("KWin")) { | |
281 | return KWinWM; | |
282 | } | |
283 | ||
284 | return OtherWM; | |
285 | } | |
286 | ||
260 | 287 | QList<DForeignWindow *> DWindowManagerHelper::currentWorkspaceWindows() const |
261 | 288 | { |
262 | 289 | D_DC(DWindowManagerHelper); |
56 | 56 | }; |
57 | 57 | Q_DECLARE_FLAGS(MotifDecorations, MotifDecoration) |
58 | 58 | |
59 | enum WMName { | |
60 | OtherWM, | |
61 | DeepinWM, | |
62 | KWinWM | |
63 | }; | |
64 | Q_ENUM(WMName) | |
65 | ||
59 | 66 | ~DWindowManagerHelper(); |
60 | 67 | |
61 | 68 | static DWindowManagerHelper *instance(); |
71 | 78 | |
72 | 79 | bool hasBlurWindow() const; |
73 | 80 | bool hasComposite() const; |
81 | QString windowManagerNameString() const; | |
82 | WMName windowManagerName() const; | |
74 | 83 | |
75 | 84 | QList<DForeignWindow*> currentWorkspaceWindows() const; |
76 | 85 |
311 | 311 | * \~chinese - 在 FORCE_RASTER_WIDGETS 宏生效的情况下,默认设置 Qt::AA_ForceRasterWidgets 以减少 glx 相关库的加载,减少程序启动时间; |
312 | 312 | * \~chinese - 自动根据 applicationName 和 系统 locale 加载对应的翻译文件; |
313 | 313 | * \~chinese - 会根据系统gsettings中 com.deepin.dde.dapplication 的 qpixmapCacheLimit 值来设置 QPixmapCache::cacheLimit ; |
314 | * \~chinese - 会根据系统gsettings中 com.deepin.dde.touchscreen longpress-duration 的值来设置 QTapAndHoldGesture::timeout ; | |
314 | 315 | * \~chinese - 方便地通过 setSingleInstance 来实现程序的单实例。 |
316 | * | |
317 | * \~chinese \note DApplication 设置的 QTapAndHoldGesture::timeout 会比 gsettings | |
318 | * \~chinese 中的值小 100,用来绕过 Dock 长按松开容易导致应用启动的问题,详细解释见 | |
319 | * \~chinese 见代码注释或者 https://github.com/linuxdeepin/internal-discussion/issues/430 | |
315 | 320 | * |
316 | 321 | * \~chinese \sa loadTranslator, setSingleInstance. |
317 | 322 | */ |
365 | 370 | QGSettings gsettings("com.deepin.dde.dapplication", "/com/deepin/dde/dapplication/"); |
366 | 371 | if (gsettings.keys().contains("qpixmapCacheLimit")) |
367 | 372 | QPixmapCache::setCacheLimit(gsettings.get("qpixmap-cache-limit").toInt()); |
373 | } | |
374 | ||
375 | // set QTapAndHoldGesture::timeout | |
376 | if (QGSettings::isSchemaInstalled("com.deepin.dde.touchscreen")) { | |
377 | QGSettings gsettings("com.deepin.dde.touchscreen"); | |
378 | if (gsettings.keys().contains("longpressDuration")) | |
379 | // NOTE(hualet): -100 is a workaround against the situation that that sometimes longpress | |
380 | // and release on Dock cause App launches which should be avoided. | |
381 | // | |
382 | // I guess it happens like this: longpress happens on Dock, | |
383 | // Dock menu shows(doesn't grab the mouse which is a bug can't be fixed easily), | |
384 | // user ends the longpress, DDE Dock recevies mouseReleaseEvent and checks for | |
385 | // QTapAndHoldGesture which is still not happening (maybe because the timer used is | |
386 | // a CoarseTimer?), so Dock treats the event as a normal mouseReleaseEvent, launches the | |
387 | // App or triggers the action. | |
388 | // | |
389 | // see: https://github.com/linuxdeepin/internal-discussion/issues/430 | |
390 | // | |
391 | // This workaround hopefully can fix most of this situations. | |
392 | QTapAndHoldGesture::setTimeout(gsettings.get("longpress-duration").toInt() - 100); | |
368 | 393 | } |
369 | 394 | #endif |
370 | 395 | } |
995 | 995 | /*!\reimp */ |
996 | 996 | void DDialog::hideEvent(QHideEvent *event) |
997 | 997 | { |
998 | DAbstractDialog::hideEvent(event); | |
999 | ||
1000 | Q_EMIT visibleChanged(isVisible()); | |
1001 | } | |
1002 | ||
1003 | void DDialog::closeEvent(QCloseEvent *event) | |
1004 | { | |
1005 | Q_UNUSED(event) | |
1006 | ||
998 | 1007 | Q_EMIT aboutToClose(); |
999 | ||
1000 | DAbstractDialog::hideEvent(event); | |
1001 | 1008 | |
1002 | 1009 | done(-1); |
1003 | 1010 |
115 | 115 | |
116 | 116 | void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; |
117 | 117 | void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; |
118 | void closeEvent(QCloseEvent *event) override; | |
118 | 119 | void childEvent(QChildEvent *event) Q_DECL_OVERRIDE; |
119 | 120 | void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; |
120 | 121 |
51 | 51 | m_caps = new DLabel; |
52 | 52 | m_eye = new DImageButton; |
53 | 53 | m_submit = new DImageButton; |
54 | m_invalidTip = new DArrowRectangle(DArrowRectangle::ArrowTop, q); | |
54 | m_invalidTip = new DArrowRectangle(DArrowRectangle::ArrowTop, DArrowRectangle::FloatWidget); | |
55 | 55 | m_invalidMessage = new DLabel(m_invalidTip); |
56 | m_invalidTip->setContent(m_invalidMessage); | |
57 | m_invalidTip->setMargin(10); | |
56 | 58 | |
57 | 59 | m_loadSlider = new LoadSlider(q); |
58 | 60 | m_loadSlider->hide(); |
249 | 251 | D_D(DPasswdEditAnimated); |
250 | 252 | |
251 | 253 | d->init(); |
254 | ||
255 | d->m_invalidTip->setParent(parent); | |
252 | 256 | } |
253 | 257 | |
254 | 258 | /** |
436 | 440 | d->_q_hideLoadSlider(); |
437 | 441 | |
438 | 442 | d->m_invalidMessage->setText(message); |
443 | d->m_invalidMessage->adjustSize(); | |
439 | 444 | |
440 | 445 | d->m_passwdEdit->selectAll(); |
441 | 446 | d->m_passwdEdit->setFocus(); |
447 | 452 | |
448 | 453 | if (!d->m_invalidTip->isVisible()) { |
449 | 454 | // focus BUG |
450 | //d->m_invalidTip->setContent(d->m_invalidMessage); | |
451 | //d->m_invalidTip->adjustSize(); | |
455 | // d->m_invalidTip->setContent(d->m_invalidMessage); | |
456 | // d->m_invalidTip->adjustSize(); | |
457 | d->m_invalidTip->setContent(d->m_invalidMessage); | |
452 | 458 | |
453 | 459 | updateAlertPosition(); |
454 | 460 | |
490 | 496 | { |
491 | 497 | D_D(DPasswdEditAnimated); |
492 | 498 | |
493 | const QString &message = d->m_invalidMessage->text(); | |
494 | ||
495 | QPoint pos = mapToGlobal(rect().bottomLeft()); | |
496 | QFontMetrics fm((QFont())); | |
497 | d->m_invalidTip->setGeometry(pos.x(), pos.y() + 5, fm.width(message) + 20, fm.height() + 20); | |
498 | d->m_invalidMessage->move(10, 15); | |
499 | QPoint pos = mapToParent(rect().bottomLeft()); | |
500 | const int messageHalfWidth = d->m_invalidMessage->width() / 2; | |
501 | d->m_invalidTip->move(pos.x() + messageHalfWidth + 10, pos.y() + 5); | |
502 | ||
503 | const QPoint messagePos = d->m_invalidMessage->pos(); | |
504 | const int h = d->m_invalidTip->height() - d->m_invalidMessage->height() - 10; | |
505 | d->m_invalidMessage->move(messagePos.x(), h / 2); | |
499 | 506 | |
500 | 507 | d->m_invalidTip->setArrowX(20); |
501 | 508 | d->m_invalidMessage->show(); |