mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix strut height error
Change-Id: I796aacbe2b38b400fdd926384d47895fe621ddf6
This commit is contained in:
parent
069b52093a
commit
bf79f1cca5
Notes:
Deepin Code Review
2017-07-14 15:48:37 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Fri, 14 Jul 2017 15:48:34 +0800 Reviewed-on: https://cr.deepin.io/24588 Project: dde/dde-dock Branch: refs/heads/master
@ -206,7 +206,7 @@ const QRect DockSettings::windowRect(const Position position, const bool hide) c
|
||||
default:Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
qDebug() << Q_FUNC_INFO << m_mainWindowSize << primaryRect << p << size;
|
||||
// qDebug() << Q_FUNC_INFO << m_mainWindowSize << primaryRect << p << size;
|
||||
|
||||
return QRect(primaryRect.topLeft() + p, size);
|
||||
}
|
||||
@ -282,7 +282,7 @@ void DockSettings::menuActionClicked(QAction *action)
|
||||
|
||||
void DockSettings::onPositionChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
const Position prevPos = m_position;
|
||||
const Position nextPos = Dock::Position(m_dockInter->position());
|
||||
|
||||
@ -302,7 +302,7 @@ void DockSettings::onPositionChanged()
|
||||
|
||||
void DockSettings::iconSizeChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
m_iconSize = m_dockInter->iconSize();
|
||||
AppItem::setIconBaseSize(m_iconSize);
|
||||
|
||||
@ -313,7 +313,7 @@ void DockSettings::iconSizeChanged()
|
||||
|
||||
void DockSettings::displayModeChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
m_displayMode = Dock::DisplayMode(m_dockInter->displayMode());
|
||||
DockItem::setDockDisplayMode(m_displayMode);
|
||||
qApp->setProperty(PROP_DISPLAY_MODE, QVariant::fromValue(m_displayMode));
|
||||
@ -325,7 +325,7 @@ void DockSettings::displayModeChanged()
|
||||
|
||||
void DockSettings::hideModeChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
m_hideMode = Dock::HideMode(m_dockInter->hideMode());
|
||||
|
||||
emit windowHideModeChanged();
|
||||
@ -333,7 +333,7 @@ void DockSettings::hideModeChanged()
|
||||
|
||||
void DockSettings::hideStateChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
const Dock::HideState state = Dock::HideState(m_dockInter->hideState());
|
||||
|
||||
if (state == Dock::Unknown)
|
||||
@ -346,7 +346,7 @@ void DockSettings::hideStateChanged()
|
||||
|
||||
void DockSettings::dockItemCountChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
if (m_displayMode == Dock::Efficient)
|
||||
return;
|
||||
|
||||
@ -357,7 +357,7 @@ void DockSettings::dockItemCountChanged()
|
||||
|
||||
void DockSettings::primaryScreenChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
m_primaryRect = m_displayInter->primaryRect();
|
||||
|
||||
calculateWindowConfig();
|
||||
@ -368,14 +368,14 @@ void DockSettings::primaryScreenChanged()
|
||||
void DockSettings::resetFrontendGeometry()
|
||||
{
|
||||
const QRect r = windowRect(m_position);
|
||||
qDebug() << Q_FUNC_INFO << r;
|
||||
// qDebug() << Q_FUNC_INFO << r;
|
||||
|
||||
m_dockInter->SetFrontendWindowRect(r.x(), r.y(), r.width(), r.height());
|
||||
}
|
||||
|
||||
void DockSettings::calculateWindowConfig()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
const int defaultHeight = AppItem::itemBaseHeight();
|
||||
const int defaultWidth = AppItem::itemBaseWidth();
|
||||
|
||||
|
@ -124,7 +124,7 @@ void MainWindow::setFixedSize(const QSize &size)
|
||||
{
|
||||
const QPropertyAnimation::State state = m_sizeChangeAni->state();
|
||||
|
||||
qDebug() << state;
|
||||
// qDebug() << state;
|
||||
if (state == QPropertyAnimation::Stopped && this->size() == size)
|
||||
return;
|
||||
|
||||
@ -132,7 +132,7 @@ void MainWindow::setFixedSize(const QSize &size)
|
||||
return m_sizeChangeAni->setEndValue(size);
|
||||
|
||||
|
||||
qDebug() << Q_FUNC_INFO << size;
|
||||
// qDebug() << Q_FUNC_INFO << size;
|
||||
|
||||
m_sizeChangeAni->setStartValue(this->size());
|
||||
m_sizeChangeAni->setEndValue(size);
|
||||
@ -142,7 +142,7 @@ void MainWindow::setFixedSize(const QSize &size)
|
||||
void MainWindow::internalMove(int x, int y)
|
||||
{
|
||||
const QPropertyAnimation::State state = m_posChangeAni->state();
|
||||
const QPoint p = pos();
|
||||
const QPoint p = m_posChangeAni->endValue().toPoint();
|
||||
const QPoint tp = QPoint(x, y);
|
||||
|
||||
if (state == QPropertyAnimation::Stopped && p == tp)
|
||||
@ -151,7 +151,7 @@ void MainWindow::internalMove(int x, int y)
|
||||
// if (state == QPropertyAnimation::Running && m_posChangeAni->endValue() != tp)
|
||||
// return m_posChangeAni->setEndValue(QPoint(x, y));
|
||||
|
||||
m_posChangeAni->setStartValue(p);
|
||||
m_posChangeAni->setStartValue(pos());
|
||||
m_posChangeAni->setEndValue(tp);
|
||||
m_posChangeAni->start();
|
||||
}
|
||||
@ -175,7 +175,7 @@ void MainWindow::initComponents()
|
||||
|
||||
void MainWindow::compositeChanged()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
|
||||
const int duration = m_wmHelper->hasComposite() ? 200 : 0;
|
||||
|
||||
@ -278,7 +278,7 @@ void MainWindow::positionChanged(const Position prevPos)
|
||||
|
||||
void MainWindow::updatePosition()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
// all update operation need pass by timer
|
||||
Q_ASSERT(sender() == m_positionUpdateTimer);
|
||||
|
||||
@ -295,7 +295,7 @@ void MainWindow::updateGeometry()
|
||||
const Position position = m_settings->position();
|
||||
QSize size = m_settings->windowSize();
|
||||
|
||||
qDebug() << Q_FUNC_INFO << position << size;
|
||||
// qDebug() << Q_FUNC_INFO << position << size;
|
||||
|
||||
m_mainPanel->setFixedSize(size);
|
||||
m_mainPanel->updateDockPosition(position);
|
||||
@ -348,10 +348,13 @@ void MainWindow::clearStrutPartial()
|
||||
|
||||
void MainWindow::setStrutPartial()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
// first, clear old strut partial
|
||||
clearStrutPartial();
|
||||
|
||||
// reset env
|
||||
resetPanelEnvironment(true);
|
||||
|
||||
if (m_settings->hideMode() != Dock::KeepShowing)
|
||||
return;
|
||||
|
||||
@ -368,6 +371,8 @@ void MainWindow::setStrutPartial()
|
||||
const QRect r = QRect(p, m_settings->windowSize());
|
||||
QRect strutArea(0, 0, maxScreenWidth, maxScreenHeight);
|
||||
|
||||
qDebug() << "screen info: " << r << p << strutArea;
|
||||
|
||||
switch (side)
|
||||
{
|
||||
case Position::Top:
|
||||
@ -430,7 +435,7 @@ void MainWindow::setStrutPartial()
|
||||
|
||||
void MainWindow::expand()
|
||||
{
|
||||
qDebug() << "expand";
|
||||
// qDebug() << "expand";
|
||||
const QPoint finishPos(0, 0);
|
||||
|
||||
if (m_mainPanel->pos() == finishPos && m_mainPanel->size() == this->size() && m_panelHideAni->state() == QPropertyAnimation::Stopped)
|
||||
@ -460,7 +465,7 @@ void MainWindow::expand()
|
||||
|
||||
void MainWindow::narrow(const Position prevPos)
|
||||
{
|
||||
qDebug() << "narrow" << prevPos;
|
||||
// qDebug() << "narrow" << prevPos;
|
||||
// const QSize size = m_settings->windowSize();
|
||||
const QSize size = m_mainPanel->size();
|
||||
|
||||
@ -494,7 +499,7 @@ void MainWindow::resetPanelEnvironment(const bool visible)
|
||||
const Position position = m_settings->position();
|
||||
const QRect r(m_settings->windowRect(position));
|
||||
|
||||
qDebug() << Q_FUNC_INFO << r;
|
||||
// qDebug() << Q_FUNC_INFO << r;
|
||||
m_sizeChangeAni->setEndValue(r.size());
|
||||
m_mainPanel->setFixedSize(r.size());
|
||||
QWidget::setFixedSize(r.size());
|
||||
@ -519,7 +524,7 @@ void MainWindow::resetPanelEnvironment(const bool visible)
|
||||
|
||||
void MainWindow::updatePanelVisible()
|
||||
{
|
||||
qDebug() << m_updatePanelVisible;
|
||||
// qDebug() << m_updatePanelVisible;
|
||||
|
||||
if (!m_updatePanelVisible)
|
||||
return;
|
||||
@ -528,7 +533,7 @@ void MainWindow::updatePanelVisible()
|
||||
|
||||
const Dock::HideState state = m_settings->hideState();
|
||||
|
||||
qDebug() << state;
|
||||
// qDebug() << state;
|
||||
|
||||
do
|
||||
{
|
||||
@ -551,7 +556,7 @@ void MainWindow::updatePanelVisible()
|
||||
|
||||
void MainWindow::adjustShadowMask()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << m_mainPanel->pos() << m_panelHideAni->state() << m_panelShowAni->state() << m_wmHelper->hasComposite();
|
||||
// qDebug() << Q_FUNC_INFO << m_mainPanel->pos() << m_panelHideAni->state() << m_panelShowAni->state() << m_wmHelper->hasComposite();
|
||||
if (m_mainPanel->pos() != QPoint(0, 0) ||
|
||||
m_panelHideAni->state() == QPropertyAnimation::Running ||
|
||||
m_panelShowAni->state() == QPauseAnimation::Running ||
|
||||
|
@ -93,11 +93,11 @@ void XcbMisc::set_strut_partial(xcb_window_t winId, Orientation orientation, uin
|
||||
break;
|
||||
}
|
||||
|
||||
qDebug() << "xcb_ewmh_set_wm_strut_partial" << endl
|
||||
<< "top" << strut_partial.top << strut_partial.top_start_x << strut_partial.top_end_x << endl
|
||||
<< "left" << strut_partial.left << strut_partial.left_start_y << strut_partial.left_end_y << endl
|
||||
<< "right" << strut_partial.right << strut_partial.right_start_y << strut_partial.right_end_y << endl
|
||||
<< "bottom" << strut_partial.bottom << strut_partial.bottom_start_x << strut_partial.bottom_end_x << endl;
|
||||
// qDebug() << "xcb_ewmh_set_wm_strut_partial" << endl
|
||||
// << "top" << strut_partial.top << strut_partial.top_start_x << strut_partial.top_end_x << endl
|
||||
// << "left" << strut_partial.left << strut_partial.left_start_y << strut_partial.left_end_y << endl
|
||||
// << "right" << strut_partial.right << strut_partial.right_start_y << strut_partial.right_end_y << endl
|
||||
// << "bottom" << strut_partial.bottom << strut_partial.bottom_start_x << strut_partial.bottom_end_x << endl;
|
||||
|
||||
xcb_ewmh_set_wm_strut_partial(&m_ewmh_connection, winId, strut_partial);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user