Skip to content
Open
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
2 changes: 1 addition & 1 deletion files/snipe/dde-lock.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Comment=Deepin Lock
Encoding=UTF-8
Exec=/usr/bin/dde-lock
NoDisplay=true
OnlyShowIn=DDE
OnlyShowIn=DDE;Deepin
Type=Application
X-Deepin-Vendor=user-custom
X-Deepin-TurboType=dtkwidget
Expand Down
1 change: 1 addition & 0 deletions plugins/login-gesture/src/gesturepannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
#include <QObject>
#include <QWidget>

#include <QPoint>

Check warning on line 11 in plugins/login-gesture/src/gesturepannel.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPoint> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QVector>

Check warning on line 12 in plugins/login-gesture/src/gesturepannel.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QVector> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPainter>

Check warning on line 13 in plugins/login-gesture/src/gesturepannel.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPainter> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPainterPath>

Check warning on line 14 in plugins/login-gesture/src/gesturepannel.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPainterPath> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QMap>

Check warning on line 15 in plugins/login-gesture/src/gesturepannel.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QMap> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QRectF>

Check warning on line 16 in plugins/login-gesture/src/gesturepannel.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QRectF> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QStateMachine>

Check warning on line 17 in plugins/login-gesture/src/gesturepannel.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QStateMachine> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPushButton>
#include <QLabel>

Expand Down
1 change: 1 addition & 0 deletions plugins/login-gesture/src/waypointwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#include "waypointwidget.h"
#include "waypointmodel.h"

#include <QPainter>

Check warning on line 8 in plugins/login-gesture/src/waypointwidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPainter> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPainterPath>

Check warning on line 9 in plugins/login-gesture/src/waypointwidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPainterPath> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QEvent>

Check warning on line 10 in plugins/login-gesture/src/waypointwidget.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QEvent> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QMouseEvent>

using namespace gestureLogin;
Expand Down
7 changes: 7 additions & 0 deletions src/app/dde-lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@

#include <QDBusInterface>
#include <unistd.h>
#include <X11/Xlib.h>

DCORE_USE_NAMESPACE
DWIDGET_USE_NAMESPACE

static int x11IOErrorHandler(Display *)
{
_exit(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Lock screen stays closed after X11 recovers

When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, x11IOErrorHandler calls _exit(0) without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.

Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.

Prompt for AI agents
In `src/app/dde-lock.cpp` at line 36:

**Lock screen stays closed after X11 recovers**

When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, `x11IOErrorHandler` calls `_exit(0)` without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.

Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.

}

int main(int argc, char *argv[])
{
#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 8, 7) && DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0))
Expand Down Expand Up @@ -280,5 +286,6 @@ int main(int argc, char *argv[])
emit model->showLockScreen();
}
}
XSetIOErrorHandler(x11IOErrorHandler);
return app->exec();
}
Loading