mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00

wayland环境下,窗管无法提供windowId,原来通过windowID的方式获取截图的方式失效,因此窗管增加了通过窗体的UUID的方式来获取截图的接口,前端通过传入UUID的方式来获取截图 Log: 修复wayland环境下无法显示预览图的问题 Influence: wayland-任务栏打开一个应用窗口,鼠标放入到窗口上,查看预览图 Bug: https://pms.uniontech.com/bug-view-140919.html Change-Id: I3506e8edb8f875ba7c5d7b3d3471ad51a3170f58
44 lines
1.5 KiB
C++
44 lines
1.5 KiB
C++
/*
|
||
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
|
||
*
|
||
* Author: sbw <sbw@sbw.so>
|
||
*
|
||
* Maintainer: sbw <sbw@sbw.so>
|
||
*
|
||
* 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 IMAGEUTIL_H
|
||
#define IMAGEUTIL_H
|
||
|
||
#include <QWidget>
|
||
#include <QPixmap>
|
||
#include <QSvgRenderer>
|
||
#include <QApplication>
|
||
|
||
class QCursor;
|
||
|
||
class ImageUtil
|
||
{
|
||
public:
|
||
static const QPixmap loadSvg(const QString &iconName, const QString &localPath, const int size, const qreal ratio);
|
||
static const QPixmap loadSvg(const QString &iconName, const QSize size, const qreal ratio = qApp->devicePixelRatio());
|
||
static QCursor* loadQCursorFromX11Cursor(const char* theme, const char* cursorName, int cursorSize);
|
||
// 加载窗口的预览图
|
||
static QImage loadWindowThumb(const WId &windowId, int width, int height); // x11下加载,用windowID
|
||
static QImage loadWindowThumb(const QString &uuid, int width, int height); // wayland下加载,用uuid
|
||
};
|
||
|
||
#endif // IMAGEUTIL_H
|