Skip to content

Commit

Permalink
Warn about Wayland usage
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseExposito committed Apr 6, 2024
1 parent baac65f commit cb3cd4c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
10 changes: 10 additions & 0 deletions po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,13 @@ msgstr "Atrás"

msgid "Forward"
msgstr "Adelante"

msgid "Using Wayland"
msgstr "Se está utilizando Wayland"

msgid ""
"Touché and Touchégg are designed to work on X11. Some actions might or might "
"not work on Wayland."
msgstr ""
"Touché y Touchégg fueron diseñados para funcionar en X11. Algunas "
"configuraciones podrían no funcionar en Wayland."
17 changes: 16 additions & 1 deletion src/main-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ALL_ID, isAll } from '~/config/all-apps';
import Sidebar from './sidebar';
import Content from './content';

const { Adw, GObject } = imports.gi;
const { Adw, GLib, GObject } = imports.gi;

class MainView extends Adw.Bin {
_init() {
Expand All @@ -43,6 +43,8 @@ class MainView extends Adw.Bin {
this.sidebar.connect('appSelected', (self, appName) => this.content.appSelected(appName));
this.sidebar.connect('addApp', () => this.emit('addApp'));
this.sidebar.connect('removeApp', (self, appName) => this.removeApp(appName));

this.warnAboutWayland();
}

showAppGestures(appName) {
Expand All @@ -60,6 +62,19 @@ class MainView extends Adw.Bin {
model.saveToFile();
this.showAppGestures(ALL_ID);
}

warnAboutWayland() {
if (GLib.getenv('XDG_SESSION_TYPE').toLowerCase() !== 'wayland') {
return;
}

const dialog = new Adw.AlertDialog({
heading: _('Using Wayland'),
body: _('Touché and Touchégg are designed to work on X11. Some actions might or might not work on Wayland.'),
});
dialog.add_response('ok', 'OK');
dialog.present(this);
}
}

export default GObject.registerClass(
Expand Down

0 comments on commit cb3cd4c

Please sign in to comment.