diff --git a/CMakeLists.txt b/CMakeLists.txt
index e896038..dc80f92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@ set(XML
xml/treeland-shortcut-manager-v1.xml
xml/treeland-shortcut-manager-v2.xml
xml/treeland-window-management-v1.xml
- xml/treeland-ddm-v1.xml
+ xml/treeland-ddm-v2.xml
xml/treeland-screensaver-v1.xml
xml/treeland-prelaunch-splash-v1.xml
xml/treeland-prelaunch-splash-v2.xml
diff --git a/xml/treeland-ddm-v1.xml b/xml/treeland-ddm-v1.xml
deleted file mode 100644
index d0f75d8..0000000
--- a/xml/treeland-ddm-v1.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
- This is the treeland - ddm private communication protocol.
-
- This object is primarily used for establish connection between
- treeland and ddm.
-
-
-
- Send treeland to Greeter mode.
-
-
-
-
- Set lockscreen user to username. Ignore when username is "ddm".
-
-
-
-
-
- Activate treeland session. This will makes treeland try to take
- control of screen.
-
-
-
-
- Deactivate treeland session. This will release control of the
- screen, but not to close the current seats.
-
-
-
-
- Enable treeland rendering. This is primarily called after
- disable_render to resume treeland.
-
-
-
-
- Disable treeland rendering. This will prevent treeland from
- output to DRM device.
-
-
-
-
-
- Call ddm to switch current virtual terminal to vtnr. ddm should
- take care of the switch and call ioctl respectively.
-
-
-
-
-
- Call ddm to acquire control of VT at vtnr. ddm should call
- VT_SETMODE respectively.
-
-
-
-
-
diff --git a/xml/treeland-ddm-v2.xml b/xml/treeland-ddm-v2.xml
new file mode 100644
index 0000000..11cfd02
--- /dev/null
+++ b/xml/treeland-ddm-v2.xml
@@ -0,0 +1,259 @@
+
+
+
+
+
+ This is the treeland - ddm private communication protocol.
+
+ This object is primarily used to establish connection between
+ treeland and ddm.
+
+ Warning! The protocol described in this file is currently in the testing
+ phase. Backward compatible changes may be added together with the
+ corresponding interface version bump. Backward incompatible changes can
+ only be done by creating a new major version of the extension.
+
+
+
+
+
+
+ Capabilities of what ddm can perform on this machine. Treeland
+ can adjust its behavior based on it.
+
+ See the capabilities request for how it is used.
+
+
+
+
+
+
+
+
+
+
+
+ Desktop session types, X11 or Wayland.
+
+ See the login event for how it is used.
+
+
+
+
+
+
+
+ Error codes for authentication failure.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ddm will send its power management capabilities to treeland
+ through this request. The argument is a bitfield of capabilities
+ that ddm can perform on. See the capabilities enum.
+
+ This is primarily used for treeland to adjust its behavior based
+ on what ddm can perform on this machine. For example, if ddm
+ doesn't have poweroff capability, treeland will hide poweroff
+ option in the UI.
+
+
+
+
+
+
+ This is primarily used for crash-recovery of treeland.
+
+ At the time the connection established, ddm will send the users
+ and their corresponding XDG session ID that "have already logged
+ in" by sending this request multiple times.
+
+ Users that "have already logged in" are those who already have
+ active systemd-logind sessions, but dropped-off from the
+ previous-connected treeland, probably due to its crash.
+
+
+
+
+
+
+
+
+ Notify treeland about authentication failure after
+ login or unlock.
+
+
+
+
+
+
+
+ Send treeland to Greeter mode.
+
+
+
+
+ Set lockscreen user to username. Barely lockscreen when username
+ is "dde".
+
+
+
+
+
+
+
+ Activate treeland session. This will make treeland try to take
+ control of screen.
+
+
+
+
+ Deactivate treeland session. This will release control of the
+ screen, but not to close the current seats.
+
+
+
+
+ Enable treeland rendering. This is primarily called after
+ disable_render to resume treeland.
+
+
+
+
+ Disable treeland rendering. This will prevent treeland from
+ output to DRM device.
+
+
+
+
+
+
+
+
+
+ Log a user in with username and secret. session_type is the
+ desktop session type that the user wants to log in to,
+ session_file is the .desktop file of the session.
+
+ Please listen to systemd-logind for whether the session is
+ exactly opened or not. Failed login attempt will be notified by
+ authentication_failed request.
+
+ Typically used when user click the login button on lockscreen.
+
+
+
+
+
+
+
+
+
+ Logout the session.
+
+ session is identical to the value of XDG_SESSION_ID, or the
+ value of org.freedesktop.login1.Session.Id, or the value of a
+ string returned by sd_get_sessions().
+
+ Please listen to org.freedesktop.login1.Manager.SessionRemoved
+ signal for whether the session is exactly closed or not.
+
+ Typically used when user click the logout button in system menu.
+
+
+
+
+
+
+ Lock the session.
+
+ session is identical to the value of XDG_SESSION_ID, or the
+ value of org.freedesktop.login1.Session.Id, or the value of a
+ string returned by sd_get_sessions().
+
+ Please listen to org.freedesktop.login1.Session.Lock signal for
+ whether the session is exactly locked or not.
+
+ Typically used when user click the lock button in system menu.
+
+
+
+
+
+
+ Unlock the session with secret.
+
+ session is identical to the value of XDG_SESSION_ID, or the
+ value of org.freedesktop.login1.Session.Id, or the value of a
+ string returned by sd_get_sessions().
+
+ Please listen to org.freedesktop.login1.Session.Unlock signal
+ for whether the session is exactly unlocked or not. Failed
+ unlock attempt will be notified by authentication_failed
+ request.
+
+ Typically used when user click the unlock button on lockscreen.
+
+
+
+
+
+
+
+
+ Poweroff the machine.
+
+ This is typically used when user click the poweroff button.
+
+
+
+
+ Reboot the machine.
+
+ This is typically used when user click the reboot button.
+
+
+
+
+ Suspend the machine.
+
+ This is typically used when user click the suspend button.
+
+
+
+
+ Hibernate the machine.
+
+ This is typically used when user click the hibernate button.
+
+
+
+
+ Hybrid sleep the machine.
+
+ This is typically used when user click the hybrid sleep button.
+
+
+
+
+
+
+ Call ddm to switch current virtual terminal to vtnr. ddm should
+ take care of the switch and call ioctl respectively.
+
+
+
+
+