Skip to content

Commit b5f8357

Browse files
committed
release 1.2.1 for flatpak
1 parent 9193758 commit b5f8357

5 files changed

Lines changed: 64 additions & 11 deletions

File tree

data/com.github.devalien.workspaces.appdata.xml.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@
6767
</content_rating>
6868

6969
<releases>
70+
<release version="1.2.1" date="2020-08-21">
71+
<description>
72+
<p>Bug Fixes</p>
73+
<ul>
74+
<li>Fixed shortcut for flatpak</li>
75+
<li>Fixed load apps for flatpak</li>
76+
</ul>
77+
</description>
78+
</release>
79+
7080
<release version="1.2.0" date="2020-08-21">
7181
<description>
7282
<p>Features</p>

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
com.github.devalien.workspaces (1.2.1) RELEASED; urgency=low
2+
3+
* Fixed shortcut for flatpak. *
4+
* Fixed load apps for flatpak. *
5+
6+
-- Goncalo Margalho <g@margalho.info> Mon, 21 Aug 2020 12:20:20 +0200
7+
18
com.github.devalien.workspaces (1.2.0) RELEASED; urgency=low
29

310
* Added default shortcut to launch the app and a way to modify it. *

src/Application.vala

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class Workspaces.Application : Gtk.Application {
3030
public const string APP_VERSION = "1.2.0";
3131
public const string APP_ID = "com.github.devalien.workspaces";
3232
public const string SHOW_WORKSPACES_CMD = APP_ID;
33+
public const string FLATPAK_SHOW_WORKSPACES_CMD = "flatpak run " + APP_ID;
3334
private const string SHOW_WORKSPACES_SHORTCUT = "<Control><Alt>w";
3435

3536
private bool show_quick_launch = false;
@@ -195,15 +196,26 @@ public class Workspaces.Application : Gtk.Application {
195196
private void set_default_shortcut () {
196197
CustomShortcutSettings.init ();
197198
foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) {
198-
if (shortcut.command == SHOW_WORKSPACES_CMD) {
199-
CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT);
200-
return;
199+
if (is_flatpak ()) {
200+
if (shortcut.command == FLATPAK_SHOW_WORKSPACES_CMD) {
201+
CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT);
202+
return;
203+
}
204+
} else {
205+
if (shortcut.command == SHOW_WORKSPACES_CMD) {
206+
CustomShortcutSettings.edit_shortcut (shortcut.relocatable_schema, SHOW_WORKSPACES_SHORTCUT);
207+
return;
208+
}
201209
}
202210
}
203211
var shortcut = CustomShortcutSettings.create_shortcut ();
204212
if (shortcut != null) {
205213
CustomShortcutSettings.edit_shortcut (shortcut, SHOW_WORKSPACES_SHORTCUT);
206-
CustomShortcutSettings.edit_command (shortcut, SHOW_WORKSPACES_CMD);
214+
if (is_flatpak ()) {
215+
CustomShortcutSettings.edit_command (shortcut, FLATPAK_SHOW_WORKSPACES_CMD);
216+
} else {
217+
CustomShortcutSettings.edit_command (shortcut, SHOW_WORKSPACES_CMD);
218+
}
207219
}
208220
}
209221

src/Dialogs/Preferences.vala

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,34 @@ public class Workspaces.Dialogs.Preferences : Gtk.Dialog {
7878

7979
CustomShortcutSettings.init ();
8080
foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) {
81-
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
82-
accel = shortcut.shortcut;
83-
accel_path = shortcut.relocatable_schema;
81+
if (is_flatpak ()) {
82+
if (shortcut.command == Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD) {
83+
accel = shortcut.shortcut;
84+
accel_path = shortcut.relocatable_schema;
85+
}
86+
} else {
87+
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
88+
accel = shortcut.shortcut;
89+
accel_path = shortcut.relocatable_schema;
90+
}
8491
}
8592
}
8693

8794
var paste_shortcut_label = create_label (_ ("Open Workspaces Shortcut:"));
8895
var paste_shortcut_entry = new Workspaces.Widgets.ShortcutEntry (accel);
8996
paste_shortcut_entry.shortcut_changed.connect ((new_shortcut) => {
90-
if (accel_path != null) {
97+
if (accel_path != null && accel_path != "") {
9198
CustomShortcutSettings.edit_shortcut (accel_path, new_shortcut);
99+
} else {
100+
var shortcut = CustomShortcutSettings.create_shortcut ();
101+
if (shortcut != null) {
102+
CustomShortcutSettings.edit_shortcut (shortcut, new_shortcut);
103+
if (is_flatpak ()) {
104+
CustomShortcutSettings.edit_command (shortcut, Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD);
105+
} else {
106+
CustomShortcutSettings.edit_command (shortcut, Workspaces.Application.SHOW_WORKSPACES_CMD);
107+
}
108+
}
92109
}
93110
});
94111
if (first_run) {

src/PreferencesWindow.vala

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,16 @@ public class Workspaces.PreferencesWindow : Gtk.ApplicationWindow {
201201

202202
CustomShortcutSettings.init ();
203203
foreach (var shortcut in CustomShortcutSettings.list_custom_shortcuts ()) {
204-
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
205-
accel = shortcut.shortcut;
206-
accel_path = shortcut.relocatable_schema;
204+
if (is_flatpak ()) {
205+
if (shortcut.command == Workspaces.Application.FLATPAK_SHOW_WORKSPACES_CMD) {
206+
accel = shortcut.shortcut;
207+
accel_path = shortcut.relocatable_schema;
208+
}
209+
} else {
210+
if (shortcut.command == Workspaces.Application.SHOW_WORKSPACES_CMD) {
211+
accel = shortcut.shortcut;
212+
accel_path = shortcut.relocatable_schema;
213+
}
207214
}
208215
}
209216

0 commit comments

Comments
 (0)