Skip to content

Commit

Permalink
Implement the session lock protocol
Browse files Browse the repository at this point in the history
Currently implemented:

- Locking and unlocking.
- Display above all desktop layers, including OVERLAY (but below
  DWIDGET).
- Waiting for the client to display locked surfaces before
  declaring the screen to be locked. If the client does not
  display all surfaces, locks anyway after a timeout.
- Multiple outputs, including outputs being added/removed while
  locking or locked.
- Leaving the screen locked if the client crashes (but allows a
  new client to come in and lock the screen).

TODO:
- Deal with outputs being resized.
- Properly display text if the screenlocker crashes. Currently it
  just displays two a big "explosion" emoji.
- Use a view instead of a plain wlr_surface_node?

Tested with swaylock.

Fixes #1494
Fixes #1358
  • Loading branch information
lcolitti committed Mar 14, 2024
1 parent 91088a2 commit 4174425
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 1 deletion.
1 change: 1 addition & 0 deletions metadata/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ install_data('shortcuts-inhibit.xml', install_dir: conf_data.get('PLUGIN_XML_DIR
install_data('wsets.xml', install_dir: conf_data.get('PLUGIN_XML_DIR'))
install_data('wayfire-shell.xml', install_dir: conf_data.get('PLUGIN_XML_DIR'))
install_data('xdg-activation.xml', install_dir: conf_data.get('PLUGIN_XML_DIR'))
install_data('session-lock.xml', install_dir: conf_data.get('PLUGIN_XML_DIR'))
8 changes: 8 additions & 0 deletions metadata/session-lock.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<wayfire>
<plugin name="session-lock">
<_short>Session Lock Protocol</_short>
<_long>An implementation of the ext-session-lock-v1 protocol. Provides more secure screen locking.</_long>
<category>Utility</category>
</plugin>
</wayfire>
3 changes: 2 additions & 1 deletion plugins/protocols/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
protocol_plugins = [
'foreign-toplevel', 'gtk-shell', 'wayfire-shell', 'xdg-activation', 'shortcuts-inhibit', 'input-method-v1'
'foreign-toplevel', 'gtk-shell', 'wayfire-shell', 'xdg-activation', 'shortcuts-inhibit',
'input-method-v1', 'session-lock'
]

all_include_dirs = [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc]
Expand Down
Loading

0 comments on commit 4174425

Please sign in to comment.