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

interface/screen_inhibit_control: Improve screen inhibit control for use on core #14134

Conversation

er-vin
Copy link
Contributor

@er-vin er-vin commented Jun 26, 2024

  • Make it available on Ubuntu Core
  • Receive notifications for inhibit changes, plugged application could change the inhibit status but had no way to be notified when it actually changes.

@ernestl ernestl requested a review from alexmurray July 3, 2024 19:12
@ernestl ernestl added the Needs security review Can only be merged once security gave a :+1: label Jul 3, 2024
@bboozzoo bboozzoo changed the title interface/screen_inhitib_control: Improve screen inhibit control for use on core interface/screen_inhibit_control: Improve screen inhibit control for use on core Jul 4, 2024
alexmurray
alexmurray previously approved these changes Jul 5, 2024
Copy link
Contributor

@alexmurray alexmurray left a comment

Choose a reason for hiding this comment

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

LGTM!

@er-vin er-vin force-pushed the improve-screen-inhibit-control-for-use-on-core branch from bd22eba to b6b55ef Compare July 23, 2024 14:30
@ernestl ernestl added this to the 2.66 milestone Sep 1, 2024
@ernestl ernestl closed this Sep 3, 2024
@ernestl ernestl reopened this Sep 3, 2024
@er-vin er-vin force-pushed the improve-screen-inhibit-control-for-use-on-core branch from b6b55ef to 88e6436 Compare September 3, 2024 08:02
@ernestl ernestl removed the Needs security review Can only be merged once security gave a :+1: label Sep 19, 2024
Copy link
Contributor

@jhenstridge jhenstridge left a comment

Choose a reason for hiding this comment

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

The addition of access to the HasInhibitChanged signal looks fine (it is included in this copy of the spec). Making the interface implicit on core seems suspect.

Checking my KDE Core Desktop VM, org.freedesktop.PowerManagement on the session bus is owned by org_kde_powerdevil running with the AppArmor label snap.plasma-desktop-session.plasma-powerdevil. Similarly org.freedesktop.ScreenSaver is owned by a process with the label snap.plasma-desktop-session.plasma-kwin-wayland. So allowing communication with label=unconfined does not sound like it would actually enable any communication here.

For proper operation on Core, the interface would need to be modified to allow a snap to provide the slot.

@ernestl ernestl modified the milestones: 2.66, 2.67 Sep 27, 2024
@ernestl
Copy link
Collaborator

ernestl commented Sep 27, 2024

Changed milestone to 2.67, needs more time.

@er-vin er-vin force-pushed the improve-screen-inhibit-control-for-use-on-core branch from 88e6436 to 98d006b Compare September 30, 2024 16:58
@er-vin
Copy link
Contributor Author

er-vin commented Sep 30, 2024

For proper operation on Core, the interface would need to be modified to allow a snap to provide the slot.

It has been reworked in this direction.

Copy link
Contributor

@jhenstridge jhenstridge left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 65.38462% with 9 lines in your changes missing coverage. Please review.

Project coverage is 79.01%. Comparing base (96ea7b0) to head (2838a0b).
Report is 70 commits behind head on master.

Files with missing lines Patch % Lines
interfaces/builtin/screen_inhibit_control.go 65.38% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14134      +/-   ##
==========================================
+ Coverage   78.95%   79.01%   +0.06%     
==========================================
  Files        1084     1085       +1     
  Lines      146638   147532     +894     
==========================================
+ Hits       115773   116579     +806     
- Misses      23667    23726      +59     
- Partials     7198     7227      +29     
Flag Coverage Δ
unittests 79.01% <65.38%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@er-vin er-vin force-pushed the improve-screen-inhibit-control-for-use-on-core branch from dc77bc8 to db79993 Compare November 7, 2024 15:05
@er-vin
Copy link
Contributor Author

er-vin commented Nov 7, 2024

Just did a rebase on latest master to ease the re-review.

Copy link
Contributor

@alexmurray alexmurray left a comment

Choose a reason for hiding this comment

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

Still LGTM!

This can be provided by a session snap in such a case
Plugged application could change the inhibit status but had no way to be
notified when it actually changes.
@er-vin er-vin force-pushed the improve-screen-inhibit-control-for-use-on-core branch from db79993 to 2838a0b Compare November 14, 2024 09:25
@er-vin
Copy link
Contributor Author

er-vin commented Nov 14, 2024

@Meulengracht static checks are fixed now, should be good to merge now.

@Meulengracht Meulengracht merged commit 89d50e5 into canonical:master Nov 14, 2024
43 of 57 checks passed
sespiros added a commit to sespiros/snapd that referenced this pull request Nov 19, 2024
* master: (44 commits)
  wrappers: do not reload activation units (canonical#14724)
  gadget/install: support for no{exec,dev,suid} mount flags
  interfaces/builtin/mount_control: add support for nfs mounts (canonical#14694)
  tests: use gojq - part 1 (canonical#14686)
  interfaces/desktop-legacy: allow DBus access to com.canonical.dbusmenu
  interfaces/builtin/fwupd.go: allow access to nvmem for thunderbolt plugin
  tests: removing uc16 executions (canonical#14575)
  tests: Added arm github runner to build snapd (canonical#14504)
  tests: no need to run spread when there are not tests matching the filter (canonical#14728)
  tests/lib/tools/store-state: exit on errors, update relevant tests (canonical#14725)
  tests: udpate the github workflow to run tests suggested by spread-filter tool (canonical#14519)
  testtime: add mockable timers for use in tests (canonical#14672)
  interface/screen_inhibit_control: Improve screen inhibit control for use on core (canonical#14134)
  tests: use images with 20G disk in openstack (canonical#14720)
  i/builtin: allow @ in custom-device filepaths (canonical#14651)
  tests: refactor test-snapd-desktop-layout-with-content
  tests: fix broken app definition
  tests: capitalize sentences in comments
  tests: wrap very long shell line
  tests: fix raciness in async startup and sync install
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants