Codebase list dtkwidget / 8d17439
New upstream version 2.0.9.10 Boyuan Yang 5 years ago
8 changed file(s) with 107 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
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
018 <a name="2.0.9.9"></a>
119 ## 2.0.9.9 (2018-11-09)
220
3333 // functions
3434 DEFINE_CONST_CHAR(hasBlurWindow);
3535 DEFINE_CONST_CHAR(hasComposite);
36 DEFINE_CONST_CHAR(windowManagerName);
3637 DEFINE_CONST_CHAR(connectWindowManagerChangedSignal);
3738 DEFINE_CONST_CHAR(connectHasBlurWindowChanged);
3839 DEFINE_CONST_CHAR(connectHasCompositeChanged);
257258 return hasComposite && reinterpret_cast<bool(*)()>(hasComposite)();
258259 }
259260
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
260287 QList<DForeignWindow *> DWindowManagerHelper::currentWorkspaceWindows() const
261288 {
262289 D_DC(DWindowManagerHelper);
5656 };
5757 Q_DECLARE_FLAGS(MotifDecorations, MotifDecoration)
5858
59 enum WMName {
60 OtherWM,
61 DeepinWM,
62 KWinWM
63 };
64 Q_ENUM(WMName)
65
5966 ~DWindowManagerHelper();
6067
6168 static DWindowManagerHelper *instance();
7178
7279 bool hasBlurWindow() const;
7380 bool hasComposite() const;
81 QString windowManagerNameString() const;
82 WMName windowManagerName() const;
7483
7584 QList<DForeignWindow*> currentWorkspaceWindows() const;
7685
311311 * \~chinese - 在 FORCE_RASTER_WIDGETS 宏生效的情况下,默认设置 Qt::AA_ForceRasterWidgets 以减少 glx 相关库的加载,减少程序启动时间;
312312 * \~chinese - 自动根据 applicationName 和 系统 locale 加载对应的翻译文件;
313313 * \~chinese - 会根据系统gsettings中 com.deepin.dde.dapplication 的 qpixmapCacheLimit 值来设置 QPixmapCache::cacheLimit ;
314 * \~chinese - 会根据系统gsettings中 com.deepin.dde.touchscreen longpress-duration 的值来设置 QTapAndHoldGesture::timeout ;
314315 * \~chinese - 方便地通过 setSingleInstance 来实现程序的单实例。
316 *
317 * \~chinese \note DApplication 设置的 QTapAndHoldGesture::timeout 会比 gsettings
318 * \~chinese 中的值小 100,用来绕过 Dock 长按松开容易导致应用启动的问题,详细解释见
319 * \~chinese 见代码注释或者 https://github.com/linuxdeepin/internal-discussion/issues/430
315320 *
316321 * \~chinese \sa loadTranslator, setSingleInstance.
317322 */
365370 QGSettings gsettings("com.deepin.dde.dapplication", "/com/deepin/dde/dapplication/");
366371 if (gsettings.keys().contains("qpixmapCacheLimit"))
367372 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);
368393 }
369394 #endif
370395 }
995995 /*!\reimp */
996996 void DDialog::hideEvent(QHideEvent *event)
997997 {
998 DAbstractDialog::hideEvent(event);
999
1000 Q_EMIT visibleChanged(isVisible());
1001 }
1002
1003 void DDialog::closeEvent(QCloseEvent *event)
1004 {
1005 Q_UNUSED(event)
1006
9981007 Q_EMIT aboutToClose();
999
1000 DAbstractDialog::hideEvent(event);
10011008
10021009 done(-1);
10031010
115115
116116 void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
117117 void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
118 void closeEvent(QCloseEvent *event) override;
118119 void childEvent(QChildEvent *event) Q_DECL_OVERRIDE;
119120 void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
120121
5151 m_caps = new DLabel;
5252 m_eye = new DImageButton;
5353 m_submit = new DImageButton;
54 m_invalidTip = new DArrowRectangle(DArrowRectangle::ArrowTop, q);
54 m_invalidTip = new DArrowRectangle(DArrowRectangle::ArrowTop, DArrowRectangle::FloatWidget);
5555 m_invalidMessage = new DLabel(m_invalidTip);
56 m_invalidTip->setContent(m_invalidMessage);
57 m_invalidTip->setMargin(10);
5658
5759 m_loadSlider = new LoadSlider(q);
5860 m_loadSlider->hide();
249251 D_D(DPasswdEditAnimated);
250252
251253 d->init();
254
255 d->m_invalidTip->setParent(parent);
252256 }
253257
254258 /**
436440 d->_q_hideLoadSlider();
437441
438442 d->m_invalidMessage->setText(message);
443 d->m_invalidMessage->adjustSize();
439444
440445 d->m_passwdEdit->selectAll();
441446 d->m_passwdEdit->setFocus();
447452
448453 if (!d->m_invalidTip->isVisible()) {
449454 // 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);
452458
453459 updateAlertPosition();
454460
490496 {
491497 D_D(DPasswdEditAnimated);
492498
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);
499506
500507 d->m_invalidTip->setArrowX(20);
501508 d->m_invalidMessage->show();
10701070 }
10711071
10721072 if (event->buttons() == Qt::LeftButton
1073 && offset_x > startDragDistance
1073 // 此条件会导致横向拖动时卡顿
1074 // && offset_x > startDragDistance
10741075 && valid_pressed_index) {
10751076
10761077 updateMoveingTabPosition(event->pos());