Skip to content

Commit

Permalink
wlserver: Re-hook pausing on session pause
Browse files Browse the repository at this point in the history
During the refactor in 88eb1b4, the
handle_session_active function lost the ultimate role of *causing a
pause* when the session became inactive.

The duty of pausing the session was given the `DirtyState` function on
the backend, which now uses the same "moral" condition to set the paused
state (`g_DRM.paused = !wlsession_active();`)...

... except that now `DirtyState` state is only called when the session
is resumed. In turn, this means that on session suspend, nothing ends-up
pausing the DRM backend anymore!

This change unconditionally calls `DirtyState`, which in turn does the
accounting for pausing the backend. Actually, it conditionally passes
`false` to the argument to force nothing.

This fixes what ends-up causing `drmModeAtomicCommit: Permission denied`
when moving to another VT from gamescope's.
  • Loading branch information
samueldr committed Nov 18, 2024
1 parent 06a6225 commit a3e8146
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,7 @@ bool wlsession_active()

static void handle_session_active( struct wl_listener *listener, void *data )
{
if (wlserver.wlr.session->active)
GetBackend()->DirtyState( true, true );
GetBackend()->DirtyState( wlserver.wlr.session->active, wlserver.wlr.session->active );
wl_log.infof( "Session %s", wlserver.wlr.session->active ? "resumed" : "paused" );
}
#endif
Expand Down

0 comments on commit a3e8146

Please sign in to comment.