Skip to content

Move mount/unmount interaction and handling to Cinnamon#13145

Merged
mtwebster merged 2 commits intomasterfrom
mount-stuff
Apr 9, 2026
Merged

Move mount/unmount interaction and handling to Cinnamon#13145
mtwebster merged 2 commits intomasterfrom
mount-stuff

Conversation

@mtwebster
Copy link
Copy Markdown
Member

@mtwebster mtwebster commented Oct 16, 2025

Implement mount/unmount/autorun user interaction in Cinnamon.

Certain aspects of GtkMountOperation are broken under Wayland in
Gtk3 and won't be fixed. Fortunately it can also use a dbus
interface (org.gtk.MountOperationHandler) if a provider exists.

This allows us to:

  • provide the 'device is in use' popup and showing which
    application is using it, when trying to eject a device.
  • provide the password/question dialog when mounting devices that
    require interaction before mounting.
  • eliminate a lot of code and translations from placesManager,
    and make the behavior identical when interacting with a device
    whether from a file manager or Cinnamon's drives applet.
    Translations are provided by Gtk, Gvfs instead (as when
    ejecting a device from a file manager).
  • Adds testMountDialogs.js for theme/dialog testing (activatable
    via looking-glass).
    Also replace mount-detection handling in cinnamon-settings-daemon.
    It was originally part of Cinnamon but mostly removed early on
    when Cinnamon was forked, and we've relied on csd-automount.

With the implementation of CinnamonMountOperation for handling
unmount operations, we can bring in the autorun dialog as well.

  • csd-automount is still used in fallback mode and managed by
    cinnamon-launcher in those situations (nm-applet, polkit agents
    are already handled here also).
  • csd-automount: Disable autostart. cinnamon-settings-daemon#445
    disables autostarting csd-automount at session startup.
  • Adds testAutorunDialog.js for theme/dialog testing (activatable
    via looking-glass).
image

@mtwebster mtwebster marked this pull request as draft October 16, 2025 18:57
@mtwebster mtwebster changed the title Move mount/unmount interaction and handling to Cinnamon [wip] Move mount/unmount interaction and handling to Cinnamon Nov 24, 2025
@clefebvre clefebvre changed the title [wip] Move mount/unmount interaction and handling to Cinnamon [WIP] Move mount/unmount interaction and handling to Cinnamon Nov 25, 2025
@github-actions

This comment was marked as outdated.

mtwebster added a commit to mtwebster/cinnamon-settings-daemon that referenced this pull request Mar 11, 2026
Moving its responsibilities to cinnamon,  this will only be needed
during 'fallback' mode for now.

ref: linuxmint/cinnamon#13145.
@mtwebster mtwebster changed the title [WIP] Move mount/unmount interaction and handling to Cinnamon Move mount/unmount interaction and handling to Cinnamon Mar 12, 2026
@mtwebster mtwebster marked this pull request as ready for review March 12, 2026 18:06
@mtwebster mtwebster force-pushed the mount-stuff branch 2 times, most recently from e120319 to eb4258a Compare March 14, 2026 00:47
@github-actions

This comment was marked as outdated.

@linuxmint linuxmint deleted a comment from github-actions bot Mar 14, 2026
@linuxmint linuxmint deleted a comment from github-actions bot Mar 14, 2026
@linuxmint linuxmint deleted a comment from github-actions bot Mar 14, 2026
@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ gio_volume_monitor

js/ui/automountManager.js:31

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

js/ui/autorunManager.js:169

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

⚠️ gtk_forbidden

js/ui/cinnamonMountOperation.js:23

<interface name="org.Gtk.MountOperationHandler"> \

Most Gtk APIs cannot be used in the Cinnamon runtime.
Use St (Shell Toolkit) equivalents instead.
Allowed Gtk APIs: IconTheme, DirectionType, TextDirection, PositionType,
accelerator_parse, accelerator_get_label, accelerator_name,
Settings, Widget.get_default_direction.


Automated pattern check.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ gio_volume_monitor

js/ui/automountManager.js:31

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

js/ui/autorunManager.js:169

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

⚠️ gtk_forbidden

js/ui/cinnamonMountOperation.js:23

<interface name="org.Gtk.MountOperationHandler"> \

Most Gtk APIs cannot be used in the Cinnamon runtime.
Use St (Shell Toolkit) equivalents instead.
Allowed Gtk APIs: IconTheme, DirectionType, TextDirection, PositionType,
accelerator_parse, accelerator_get_label, accelerator_name,
Settings, Widget.get_default_direction.


Automated pattern check.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ gio_volume_monitor

js/ui/automountManager.js:31

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

js/ui/autorunManager.js:169

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

⚠️ gtk_forbidden

js/ui/cinnamonMountOperation.js:23

<interface name="org.Gtk.MountOperationHandler"> \

Most Gtk APIs cannot be used in the Cinnamon runtime.
Use St (Shell Toolkit) equivalents instead.
Allowed Gtk APIs: IconTheme, DirectionType, TextDirection, PositionType,
accelerator_parse, accelerator_get_label, accelerator_name,
Settings, Widget.get_default_direction.


Automated pattern check.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ gio_volume_monitor

js/ui/automountManager.js:34

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

js/ui/autorunManager.js:169

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

⚠️ gtk_forbidden

js/ui/cinnamonMountOperation.js:23

<interface name="org.Gtk.MountOperationHandler"> \

Most Gtk APIs cannot be used in the Cinnamon runtime.
Use St (Shell Toolkit) equivalents instead.
Allowed Gtk APIs: IconTheme, DirectionType, TextDirection, PositionType,
accelerator_parse, accelerator_get_label, accelerator_name,
Settings, Widget.get_default_direction.


Automated pattern check.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ gio_volume_monitor

js/ui/automountManager.js:34

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

js/ui/autorunManager.js:169

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

⚠️ gtk_forbidden

js/ui/cinnamonMountOperation.js:23

<interface name="org.Gtk.MountOperationHandler"> \

Most Gtk APIs cannot be used in the Cinnamon runtime.
Use St (Shell Toolkit) equivalents instead.
Allowed Gtk APIs: IconTheme, DirectionType, TextDirection, PositionType,
accelerator_parse, accelerator_get_label, accelerator_name,
Settings, Widget.get_default_direction.


Automated pattern check.

Certain aspects of GtkMountOperation are broken under Wayland in
Gtk3 and won't be fixed. Fortunately it can also use a dbus
interface (org.gtk.MountOperationHandler) if a provider exists.

This allows us to:
- provide the 'device is in use' popup and showing which
  application is using it, when trying to eject a device.
- provide the password/question dialog when mounting devices that
  require interaction before mounting.
- eliminate a lot of code and translations from placesManager,
  and make the behavior identical when interacting with a device
  whether from a file manager or Cinnamon's drives applet.
  Translations are provided by Gtk, Gvfs instead (as when
  ejecting a device from a file manager).
- Adds testMountDialogs.js for theme/dialog testing (activatable
  via looking-glass).

Also replace mount-detection handling in cinnamon-settings-daemon.
It was originally part of Cinnamon but mostly removed early on
when Cinnamon was forked, and we've relied on csd-automount.

With the implementation of CinnamonMountOperation for handling
unmount operations, we can bring in the autorun dialog as well.

- csd-automount is still used in fallback mode and managed by
  cinnamon-launcher in those situations (nm-applet, polkit agents
  are already handled here also).
- linuxmint/cinnamon-settings-daemon#445
  disables autostarting csd-automount at session startup.
- Adds testAutorunDialog.js for theme/dialog testing (activatable
  via looking-glass).
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ gio_volume_monitor

js/ui/automountManager.js:34

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

js/ui/autorunManager.js:171

this._volumeMonitor = Gio.VolumeMonitor.get();

Use Main.placesManager instead of Gio.VolumeMonitor directly.
PlacesManager provides a unified API for bookmarks, mounts, volumes,
and drives with debounced updates and safe eject/unmount handling.

⚠️ gtk_forbidden

js/ui/cinnamonMountOperation.js:23

<interface name="org.Gtk.MountOperationHandler"> \

Most Gtk APIs cannot be used in the Cinnamon runtime.
Use St (Shell Toolkit) equivalents instead.
Allowed Gtk APIs: IconTheme, DirectionType, TextDirection, PositionType,
accelerator_parse, accelerator_get_label, accelerator_name,
Settings, Widget.get_default_direction.


Automated pattern check.

mtwebster added a commit to linuxmint/cinnamon-settings-daemon that referenced this pull request Apr 9, 2026
Moving its responsibilities to cinnamon,  this will only be needed
during 'fallback' mode for now.

ref: linuxmint/cinnamon#13145.
@mtwebster mtwebster merged commit 9bdd28c into master Apr 9, 2026
3 of 5 checks passed
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.

1 participant