diff --git a/data/greeter.metainfo.xml.in b/data/greeter.metainfo.xml.in index 273332b2..a7e9f2be 100644 --- a/data/greeter.metainfo.xml.in +++ b/data/greeter.metainfo.xml.in @@ -52,6 +52,7 @@ Does not follow the "automatic" accent color (based on wallpaper) Num lock/Caps lock labels are not centered add support for mutter 48 / libmutter-16 + Automatically switch the session to X11 if a11y tools are used diff --git a/data/icons/48.svg b/data/icons/48.svg new file mode 100644 index 00000000..242da6fb --- /dev/null +++ b/data/icons/48.svg @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/data/io.elementary.greeter.desktop.in b/data/io.elementary.greeter.desktop.in index 6117e078..9e399146 100644 --- a/data/io.elementary.greeter.desktop.in +++ b/data/io.elementary.greeter.desktop.in @@ -1,5 +1,7 @@ [Desktop Entry] Name=Pantheon Greeter Comment=Pantheon Greeter +Icon=io.elementary.greeter.settings Exec=@PROJECT_NAME@-compositor Type=Application +NoDisplay=true diff --git a/data/meson.build b/data/meson.build index 9c5553ba..a2b1820e 100644 --- a/data/meson.build +++ b/data/meson.build @@ -40,3 +40,20 @@ test ( find_program('desktop-file-validate'), args: join_paths(meson.current_build_dir (), meson.project_name() + '.desktop') ) + +# For notifications +install_data( + desktop_in, + install_dir: get_option('datadir') / 'applications', +) + +install_data( + 'icons' / '48.svg', + install_dir: get_option('datadir') / 'icons' / 'hicolor' / '48x48' / 'apps', + rename: meson.project_name() + '.settings.svg' +) +install_data( + 'icons' / '48.svg', + install_dir: get_option('datadir') / 'icons' / 'hicolor' / '48x48@2' / 'apps', + rename: meson.project_name() + '.settings.svg' +) diff --git a/meson.build b/meson.build index fd412806..16f9a84c 100644 --- a/meson.build +++ b/meson.build @@ -54,4 +54,7 @@ if vapigen.found() subdir('vapi') endif -gnome.post_install(glib_compile_schemas: true) +gnome.post_install( + glib_compile_schemas: true, + gtk_update_icon_cache: true +) diff --git a/src/Application.vala b/src/Application.vala index ba7440ee..e9c39e95 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -102,6 +102,29 @@ public class Greeter.Application : Gtk.Application { }); add_action (select_session_action); + + var a11y_settings = new GLib.Settings ("org.gnome.desktop.a11y.applications"); + a11y_settings.changed.connect ((key) => { + if (key != "screen-keyboard-enabled" && key != "screen-reader-enabled") { + return; + } + + if (!a11y_settings.get_boolean (key)) { + return; + } + + if (select_session_action.get_state ().get_string () != "pantheon-wayland") { + return; + } + + select_session_action.set_state (new Variant.string ("pantheon")); + + var notification = new Notification (_("Classic session automatically selected")); + notification.set_body (_("Accessibility features may be unavailable in the Secure session")); + notification.set_icon (new ThemedIcon ("preferences-desktop-accessibility")); + + send_notification ("session-type", notification); + }); } public override void activate () {