dde-dock/frame/window/mainwindow.h
donghualin 477bc09965 fix: 修复重启AM后任务栏崩溃的问题
1、重启AM后,需要重新更新每个子部件的dockInter,因为这些字部件的dockInter是从MultiScreenWorker类中获取的,而MultiScreenWorker类中的dockInter已经被释放重新获取了;
2、重新启动AM后,由于任务栏会重新执行positionChanged的方法,在这个过程中会执行300毫秒的动画,在动画执行完成后,会判断当前服务是否重启过,如果重启过服务,则重新刷新界面

Log: 修复重启AM后任务栏崩溃的问题
Influence: 重启AM服务,观察任务栏是否重启
Task: https://pms.uniontech.com/task-view-225201.html
Change-Id: I1d5337fe7a0101450dfce7338d32aad73c14f697
2022-12-14 01:33:00 +00:00

83 lines
2.5 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
* zhaolong <zhaolong@uniontech.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "xcb_misc.h"
#include "multiscreenworker.h"
#include "touchsignalmanager.h"
#include "imageutil.h"
#include "utils.h"
#include "mainwindowbase.h"
#include <DPlatformWindowHandle>
#include <QWidget>
DWIDGET_USE_NAMESPACE
class MainPanelControl;
class QTimer;
class MenuWorker;
class QScreen;
class MainWindow : public MainWindowBase
{
Q_OBJECT
public:
explicit MainWindow(MultiScreenWorker *multiScreenWorker, QWidget *parent = nullptr);
void setGeometry(const QRect &rect);
friend class MainPanelControl;
// 以下接口是实现基类的接口
// 用来更新子区域的位置一般用于在执行动画的过程中根据当前的位置来更新里面panel的大小
DockWindowType windowType() const override;
void setPosition(const Dock::Position &position) override;
void setDisplayMode(const Dock::DisplayMode &displayMode) override;
void updateParentGeometry(const Dock::Position &pos, const QRect &rect) override;
QSize suitableSize(const Dock::Position &pos, const int &screenSize, const double &deviceRatio) const override;
void resetPanelGeometry() override;
void serviceRestart() override;
void animationFinished(bool showOrHide) override;
private:
using QWidget::show;
void resizeEvent(QResizeEvent *event) override;
void initConnections();
void resizeDockIcon();
private:
MainPanelControl *m_mainPanel; // 任务栏
MultiScreenWorker *m_multiScreenWorker; // 多屏幕管理
QString m_sniHostService;
QString m_registerKey;
QStringList m_registerKeys;
bool m_needUpdateUi;
};
#endif // MAINWINDOW_H