Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idle_inhibit: Session lock and unmapped surface fixes #8175

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kennylevinsen
Copy link
Member

We were not correctly handling idle inhibitor visibility in case of session locks, nor in case of unmapped surfaces.

This tries to fix both. Not yet tested.

@WhyNotHugo
Copy link
Contributor

WhyNotHugo commented Jun 10, 2024

Does not fix #8080

Idle is still inhibited if a layer shell is never committed and never made visible.

I mistested. See below.

@kennylevinsen
Copy link
Member Author

Idle is still inhibited if a layer shell is never committed and never made visible.

I have added an explicit map check to layer and lock surfaces, and added a test for whether the layer surface output is enabled while we were at it. Could I get you to retest if that did the trick?

@WhyNotHugo
Copy link
Contributor

Er, I think I mis-tested yesterday.

f1b8837 works, but cce747c also works fine.

@kennylevinsen kennylevinsen marked this pull request as ready for review June 11, 2024 10:39
@WhyNotHugo
Copy link
Contributor

Needs rebase, won't build with latest wlroots:

[176/375] Compiling C object sway/sway.p/input_seatop_resize_tiling.c.o
[177/375] Compiling C object sway/sway.p/input_seatop_resize_floating.c.o
[178/375] Compiling C object sway/sway.p/input_seatop_move_tiling.c.o
[179/375] Compiling C object sway/sway.p/input_seatop_move_floating.c.o
ninja: job failed: cc -Isway/sway.p -Isway -I../sway -Iinclude -I../include -Isubprojects/wlroots/include -I../subprojects/wlroots/include -Iprotocols -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/json-c -I/usr/include/libevdev-1.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/elogind -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -Wno-unused-parameter -Wno-unused-result -Wno-missing-braces -Wno-format-zero-length -Wundef -Wvla '-DSYSCONFDIR="//usr/local/etc"' '-DSWAY_VERSION="1.10-dev-f1b883771 (" __DATE__ ", branch '"'"'pr8175'"'"')"' -fmacro-prefix-map=../= -pthread -MD -MQ sway/sway.p/input_tablet.c.o -MF sway/sway.p/input_tablet.c.o.d -o sway/sway.p/input_tablet.c.o -c ../sway/input/tablet.c
In file included from ../sway/input/tablet.c:3:
../subprojects/wlroots/include/wlr/types/wlr_tablet_v2.h:15:10: fatal error: tablet-v2-protocol.h: No such file or directory
   15 | #include "tablet-v2-protocol.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: subcommand failed

I tested f1b8837 with an older wlroots and can confirm that this fixes #8080

If I run my test code (which creates a create a layer-shell surface, attaches an idle inhibitor to it, but never maps it). The idle timeouts trigger as expected.

wayidle -t 3 times out after three seconds.

When a session is locked, no views are visible and there is no way to
interact with the user session. This means that all inhibitors based on
visibility - with the exception being inhibitors on the session lock
surfaces themselves - become inert, allowing the session to go idle.

The only inhibitor type on normal views that one could argue should
remain active is INHIBIT_IDLE_OPEN, but for now we disable all view
inhibitors regardless of type.
Layer surfaces do not have a view, and while they can be occluded they
are always visible on their associated output - assuming it is enabled.
We have historically considered surfaces without a view visible. This
made sense in case of layer surfaces which do not have a view, but it
also allows unmapped surfaces to act as global inhibitors irrespective
of the current view state, which is not the intention fo the protocol.

As we now explicitly handle layer surfaces, assume that views are only
visible if they can be found and their visibility checked.
While we we cannot easily check for true visibility of layer surfaces as
easily as for views, we can check at least check that the output
associated with the surface is enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants