Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/dbackingstoreproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ void DBackingStoreProxy::updateWallpaperShared()
const qint32 *header = reinterpret_cast<const qint32*>(m_sharedMemory->constData());
const uchar *content = reinterpret_cast<const uchar*>(m_sharedMemory->constData()) + HEADER_SIZE;

qint32 byte_count = header[0];
qint32 image_width = header[1];
qint32 image_height = header[2];
qint32 image_format = header[3];
Expand Down
2 changes: 1 addition & 1 deletion src/ddesktopinputselectioncontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ QRect DDesktopInputSelectionControl::cursorHandleRect() const
return handleRectForCursorRect(cursorRectangle());
}

static int getInputRectangleY(const QPoint &pos)
[[maybe_unused]] static int getInputRectangleY(const QPoint &pos)
{
// 保证handle不会超出TextEdit类输入框
int posY = pos.y();
Expand Down
2 changes: 1 addition & 1 deletion src/dnativesettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
DPP_BEGIN_NAMESPACE

class DPlatformSettings;
class Q_DECL_HIDDEN DNativeSettings : public QAbstractDynamicMetaObject
class DNativeSettings : public QAbstractDynamicMetaObject
{
public:
explicit DNativeSettings(QObject *base, DPlatformSettings *settings, bool global_settings);
Expand Down
6 changes: 3 additions & 3 deletions src/dplatformsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ QT_END_NAMESPACE

DPP_BEGIN_NAMESPACE

class Q_DECL_HIDDEN DPlatformSettings
class DPlatformSettings
{
public:
virtual ~DPlatformSettings() {}
Expand All @@ -42,13 +42,13 @@ class Q_DECL_HIDDEN DPlatformSettings
void handleNotify(const QByteArray &signal, qint32 data1, qint32 data2);

private:
struct Q_DECL_HIDDEN Callback
struct Callback
{
PropertyChangeFunc func;
void *handle;
};

struct Q_DECL_HIDDEN SignalCallback
struct SignalCallback
{
SignalFunc func;
void *handle;
Expand Down
9 changes: 6 additions & 3 deletions src/dxcbxsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static xcb_atom_t internAtom(xcb_connection_t *conn, const char *name)
return atom;
}

static QByteArray atomName(xcb_connection_t *conn, xcb_atom_t atom)
[[maybe_unused]] static QByteArray atomName(xcb_connection_t *conn, xcb_atom_t atom)
{
xcb_get_atom_name_cookie_t cookie = xcb_get_atom_name(conn, atom);
xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(conn, cookie, nullptr);
Expand Down Expand Up @@ -169,9 +169,12 @@ class Q_DECL_HIDDEN DXcbXSettingsPrivate
{
public:
DXcbXSettingsPrivate(xcb_connection_t *connection, const QByteArray &property, DXcbXSettings *qq)
: connection(connection)
: q_ptr(qq)
, connection(connection)
, x_settings_window(0)
, x_settings_atom(0)
, serial(-1)
, initialized(false)
, q_ptr(qq)
{
if (property.isEmpty()) {
x_settings_atom = internAtom(connection, "_XSETTINGS_SETTINGS");
Expand Down
2 changes: 1 addition & 1 deletion src/dxcbxsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

class DXcbXSettingsPrivate;

class Q_DECL_HIDDEN DXcbXSettings : public DPlatformSettings
class DXcbXSettings : public DPlatformSettings
{
Q_DECLARE_PRIVATE(DXcbXSettings)

Check warning on line 26 in src/dxcbxsettings.h

View workflow job for this annotation

GitHub Actions / cppcheck

Unused private function: 'DXcbXSettings::d_func'

Check warning on line 26 in src/dxcbxsettings.h

View workflow job for this annotation

GitHub Actions / static-check / static-check

Unused private function: 'DXcbXSettings::d_func'
public:
DXcbXSettings(xcb_connection_t *connection, const QByteArray &property = QByteArray());
DXcbXSettings(xcb_connection_t *connection, xcb_window_t setting_window, const QByteArray &property = QByteArray());
Expand Down
4 changes: 2 additions & 2 deletions src/vtablehook.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class VtableHook
quintptr fun1_offset = toQuintptr(&fun1);
quintptr fun2_offset = toQuintptr(&fun2);

if (fun1_offset < 0 || fun1_offset > UINT_LEAST16_MAX)
if (fun1_offset > UINT_LEAST16_MAX)
return false;

quintptr *vfun = vfptr_t1 + fun1_offset / sizeof(quintptr);
Expand Down Expand Up @@ -180,7 +180,7 @@ class VtableHook
quintptr fun1_offset = toQuintptr(&fun1);
quintptr fun2_offset = toQuintptr(&fun2);

if (fun1_offset < 0 || fun1_offset > UINT_LEAST16_MAX)
if (fun1_offset > UINT_LEAST16_MAX)
return false;

quintptr *vfun = vfptr_t1 + fun1_offset / sizeof(quintptr);
Expand Down
6 changes: 3 additions & 3 deletions tests/src/ut_dnativesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

DPP_USE_NAMESPACE

class TDNativeSettings : public testing::Test
class GTEST_API_ TDNativeSettings : public testing::Test
{
protected:
void SetUp();
void TearDown();
void SetUp() override;
void TearDown() override;

QWindow *window = nullptr;
};
Expand Down
2 changes: 1 addition & 1 deletion tests/src/ut_dxcbxsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void propertyChangedfunc(xcb_connection_t *, const QByteArray &, const QV
testPropertyChangedCallback = true;
}

class TDXcbXSettings : public testing::Test
class GTEST_API_ TDXcbXSettings : public testing::Test
{
protected:
void SetUp();
Expand Down
1 change: 1 addition & 0 deletions wayland/dwayland/dhighdpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ void DHighDpi::removeScreenFactorCache(QScreen *screen)
} else {
screenFactorMap.clear();
#else
Q_UNUSED(screen)
{
#endif
// 刷新所有窗口
Expand Down
3 changes: 2 additions & 1 deletion wayland/dwayland/dwaylandinterfacehook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ bool DWaylandInterfaceHook::supportForSplittingWindowByType(quint32 wid, quint32
if(!window || !window->handle())
return false;
DNoTitlebarWlWindowHelper::setWindowProperty(window, ::supportForSplittingWindow, false);
return window->property(::supportForSplittingWindow).toInt() >= screenSplittingType;
int propertyValue = window->property(::supportForSplittingWindow).toInt();
return propertyValue >= 0 && static_cast<quint32>(propertyValue) >= screenSplittingType;
}

DPP_END_NAMESPACE
2 changes: 2 additions & 0 deletions wayland/wayland-shell/dwaylandshellmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ static void checkIsDWayland(const QString &function)
{
#ifndef D_DEEPIN_IS_DWAYLAND
qCWarning(dwlp) << "This package is not compiled as dwayland, and [" << function << "] not support in this version.";
#else
Q_UNUSED(function)
#endif
}

Expand Down
7 changes: 4 additions & 3 deletions xcb/dhighdpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,17 @@
return qCeil(base_factor) / base_factor;
}

void DHighDpi::onDPIChanged(xcb_connection_t *connection, const QByteArray &name, const QVariant &property, void *handle)

Check warning on line 156 in xcb/dhighdpi.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'onDPIChanged' is never used.

Check warning on line 156 in xcb/dhighdpi.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

The function 'onDPIChanged' is never used.
{
Q_UNUSED(connection)
Q_UNUSED(name)
Q_UNUSED(handle)

static bool dynamic_dpi = qEnvironmentVariableIsSet("D_DXCB_RT_HIDPI");

if (!dynamic_dpi)
return;

Q_UNUSED(connection)
Q_UNUSED(name)

// 判断值是否有效
if (!property.isValid())
return;
Expand Down
7 changes: 2 additions & 5 deletions xcb/dplatformbackingstorehelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

#ifdef Q_OS_LINUX
#define private public
#define protected public
#include "qxcbbackingstore.h"

Check warning on line 14 in xcb/dplatformbackingstorehelper.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "qxcbbackingstore.h" not found.

Check warning on line 14 in xcb/dplatformbackingstorehelper.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: "qxcbbackingstore.h" not found.
#undef protected
#undef private
#endif

Expand Down Expand Up @@ -158,12 +160,7 @@
VtableHook::callOriginalFun(this->backingStore(), &QPlatformBackingStore::resize, size, staticContents);

QXcbBackingStore *bs = static_cast<QXcbBackingStore*>(backingStore());
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
QXcbShmImage *shm_image = reinterpret_cast<QXcbShmImage*>(bs->m_image);
#else
struct _QXcbBackingStore { QImage *m_image; }; // Expose m_image
QXcbShmImage *shm_image = reinterpret_cast<QXcbShmImage*>(reinterpret_cast<_QXcbBackingStore*>( &bs )->m_image);
#endif

if (shm_image->m_shm_info.shmaddr) {
DPlatformWindowHelper *window_helper = DPlatformWindowHelper::mapped.value(bs->window()->handle());
Expand Down
3 changes: 2 additions & 1 deletion xcb/dplatformintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ static bool updateCursorTheme(void *dpy)
return setTheme;
}

static xcb_cursor_t overrideCreateFontCursor(QXcbCursor *xcb_cursor, QCursor *c, QWindow *window)
[[maybe_unused]] static xcb_cursor_t overrideCreateFontCursor(QXcbCursor *xcb_cursor, QCursor *c, QWindow *window)
{
const Qt::CursorShape cshape = c->shape();
xcb_connection_t *conn = xcb_cursor->xcb_connection();
Expand Down Expand Up @@ -944,6 +944,7 @@ static void overrideChangeCursor(QPlatformCursor *cursorHandle, QCursor * cursor
if (widget->property(disableOverrideCursor).toBool())
return;

Q_UNUSED(w) // Variable is used in some Qt versions but not all
#ifdef D_ENABLE_CURSOR_HOOK
// set cursor size scale
static bool xcursrSizeIsSet = qEnvironmentVariableIsSet("XCURSOR_SIZE");
Expand Down
Loading