diff --git a/data/com.github.devalien.workspaces.appdata.xml.in b/data/com.github.devalien.workspaces.appdata.xml.in index a040316..9f0c16c 100644 --- a/data/com.github.devalien.workspaces.appdata.xml.in +++ b/data/com.github.devalien.workspaces.appdata.xml.in @@ -67,6 +67,16 @@ + + +

Bug Fixes

+
    +
  • Fixed shortcut for flatpak
  • +
  • Fixed load apps for flatpak
  • +
+
+
+

Features

diff --git a/debian/changelog b/debian/changelog index 9d6ae83..f54f3b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +com.github.devalien.workspaces (1.2.1) RELEASED; urgency=low + + * Fixed shortcut for flatpak. * + * Fixed load apps for flatpak. * + + -- Goncalo Margalho Mon, 21 Aug 2020 12:20:20 +0200 + com.github.devalien.workspaces (1.2.0) RELEASED; urgency=low * Added default shortcut to launch the app and a way to modify it. * diff --git a/src/Application.vala b/src/Application.vala index 3eeaf49..e79c549 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -30,6 +30,7 @@ public class Workspaces.Application : Gtk.Application { public const string APP_VERSION = "1.2.0"; public const string APP_ID = "com.github.devalien.workspaces"; public const string SHOW_WORKSPACES_CMD = APP_ID; + public const string FLATPAK_SHOW_WORKSPACES_CMD = "flatpak run " + APP_ID; private const string SHOW_WORKSPACES_SHORTCUT = "w"; private bool show_quick_launch = false; @@ -195,15 +196,26 @@ public class Workspaces.Application : Gtk.Application { private void set_default_shortcut () { CustomShortcutSettings.init (); foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) { - if (shortcut.command == SHOW_WORKSPACES_CMD) { - CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT); - return; + if (is_flatpak ()) { + if (shortcut.command == FLATPAK_SHOW_WORKSPACES_CMD) { + CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT); + return; + } + } else { + if (shortcut.command == SHOW_WORKSPACES_CMD) { + CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT); + return; + } } } var shortcut = CustomShortcutSettings.create_shortcut (); if (shortcut != null) { CustomShortcutSettings.edit_shortcut (shortcut, SHOW_WORKSPACES_SHORTCUT); - CustomShortcutSettings.edit_command (shortcut, SHOW_WORKSPACES_CMD); + if (is_flatpak ()) { + CustomShortcutSettings.edit_command (shortcut, FLATPAK_SHOW_WORKSPACES_CMD); + } else { + CustomShortcutSettings.edit_command (shortcut, SHOW_WORKSPACES_CMD); + } } } diff --git a/src/Dialogs/Preferences.vala b/src/Dialogs/Preferences.vala index af3053c..1ce7520 100644 --- a/src/Dialogs/Preferences.vala +++ b/src/Dialogs/Preferences.vala @@ -78,17 +78,34 @@ public class Workspaces.Dialogs.Preferences : Gtk.Dialog { CustomShortcutSettings.init (); foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) { - if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) { - accel = shortcut.shortcut; - accel_path = shortcut.relocatable_schema; + if (is_flatpak ()) { + if (shortcut.command == Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD) { + accel = shortcut.shortcut; + accel_path = shortcut.relocatable_schema; + } + } else { + if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) { + accel = shortcut.shortcut; + accel_path = shortcut.relocatable_schema; + } } } var paste_shortcut_label = create_label (_ ("Open Workspaces Shortcut:")); var paste_shortcut_entry = new Workspaces.Widgets.ShortcutEntry (accel); paste_shortcut_entry.shortcut_changed.connect ((new_shortcut) => { - if (accel_path != null) { + if (accel_path != null && accel_path != "") { CustomShortcutSettings.edit_shortcut (accel_path, new_shortcut); + } else { + var shortcut = CustomShortcutSettings.create_shortcut (); + if (shortcut != null) { + CustomShortcutSettings.edit_shortcut (shortcut, new_shortcut); + if (is_flatpak ()) { + CustomShortcutSettings.edit_command (shortcut, Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD); + } else { + CustomShortcutSettings.edit_command (shortcut, Workspaces.Application.SHOW_WORKSPACES_CMD); + } + } } }); if (first_run) { diff --git a/src/PreferencesWindow.vala b/src/PreferencesWindow.vala index 6f7dbbc..5b18c93 100644 --- a/src/PreferencesWindow.vala +++ b/src/PreferencesWindow.vala @@ -201,9 +201,16 @@ public class Workspaces.PreferencesWindow : Gtk.ApplicationWindow { CustomShortcutSettings.init (); foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) { - if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) { - accel = shortcut.shortcut; - accel_path = shortcut.relocatable_schema; + if (is_flatpak ()) { + if (shortcut.command == Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD) { + accel = shortcut.shortcut; + accel_path = shortcut.relocatable_schema; + } + } else { + if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) { + accel = shortcut.shortcut; + accel_path = shortcut.relocatable_schema; + } } }