mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix popup window cant shown
Change-Id: I0545c96c931e36af592fb3168ec2d716818673af
This commit is contained in:
parent
4bfaa78d66
commit
4f3c1a8b9e
Notes:
Deepin Code Review
2016-09-01 07:52:39 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Thu, 01 Sep 2016 07:52:39 +0000 Reviewed-on: https://cr.deepin.io/15674 Project: dde/dde-dock Branch: refs/heads/master
@ -76,6 +76,13 @@ public Q_SLOTS: // METHODS
|
||||
return asyncCallWithArgumentList(QStringLiteral("RegisterFullScreen"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<QString> RegisterArea(const qint32 x1, const qint32 y1, const qint32 x2, const qint32 y2, const qint32 flag)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
argumentList << x1 << y1 << x2 << y2 << flag;
|
||||
return asyncCallWithArgumentList(QStringLiteral("RegisterArea"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> UnregisterArea(const QString &in0)
|
||||
{
|
||||
QList<QVariant> argumentList;
|
||||
|
@ -1,14 +1,21 @@
|
||||
#include "dockpopupwindow.h"
|
||||
|
||||
#include <QScreen>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
#define MOUSE_BUTTON 1 << 1
|
||||
|
||||
DockPopupWindow::DockPopupWindow(QWidget *parent)
|
||||
: DArrowRectangle(ArrowBottom, parent),
|
||||
m_model(false),
|
||||
|
||||
m_acceptDelayTimer(new QTimer(this)),
|
||||
|
||||
m_mouseInter(new DBusXMouseArea(this))
|
||||
m_mouseInter(new DBusXMouseArea(this)),
|
||||
m_displayInter(new DBusDisplay(this))
|
||||
{
|
||||
m_acceptDelayTimer->setSingleShot(true);
|
||||
m_acceptDelayTimer->setInterval(100);
|
||||
@ -110,7 +117,10 @@ void DockPopupWindow::globalMouseRelease(int button, int x, int y, const QString
|
||||
|
||||
void DockPopupWindow::registerMouseEvent()
|
||||
{
|
||||
m_mouseAreaKey = m_mouseInter->RegisterFullScreen();
|
||||
// only regist mouse button event
|
||||
m_mouseAreaKey = m_mouseInter->RegisterArea(0, 0, m_displayInter->screenWidth(), m_displayInter->screenHeight(), MOUSE_BUTTON);
|
||||
// m_mouseAreaKey = m_mouseInter->RegisterFullScreen();
|
||||
|
||||
connect(m_mouseInter, &DBusXMouseArea::ButtonRelease, this, &DockPopupWindow::globalMouseRelease, Qt::UniqueConnection);
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define DOCKPOPUPWINDOW_H
|
||||
|
||||
#include "dbus/dbusxmousearea.h"
|
||||
#include "dbus/dbusdisplay.h"
|
||||
|
||||
#include <darrowrectangle.h>
|
||||
|
||||
@ -45,6 +46,7 @@ private:
|
||||
QTimer *m_acceptDelayTimer;
|
||||
|
||||
DBusXMouseArea *m_mouseInter;
|
||||
DBusDisplay *m_displayInter;
|
||||
};
|
||||
|
||||
#endif // DOCKPOPUPWINDOW_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user