Compare commits

..

32 Commits

Author SHA1 Message Date
RiotRobot
48132c9eab v1.7.25 2021-04-12 15:35:26 +01:00
RiotRobot
4f58ba1b22 Prepare changelog for v1.7.25 2021-04-12 15:35:25 +01:00
RiotRobot
d63c27c50a v1.7.25-rc.1 2021-04-07 13:17:54 +01:00
RiotRobot
7edea00d4e Prepare changelog for v1.7.25-rc.1 2021-04-07 13:17:54 +01:00
J. Ryan Stinnett
ce26e7964d Merge pull request #179 from SimonBrandner/disable-spell-check
Fix disabling spellchecker
2021-04-07 12:07:50 +01:00
Šimon Brandner
55dffc8c52 Fix disabling spellchecker
This is quite ugly. We have to use the store here to get this working since spellCheckerEnabled isn't persistent

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-04-02 12:07:33 +02:00
J. Ryan Stinnett
100f08161d Merge pull request #178 from vector-im/jryans/electron-12.0.2
Upgrade to Electron 12.0.2
2021-04-01 17:22:22 +01:00
Germain
d4bf14b47f Merge pull request #177 from vector-im/gsouquet-exit-shortcut 2021-04-01 15:25:57 +01:00
J. Ryan Stinnett
dabca5dc33 Upgrade electron-builder to 22.10.5
This upgrade will help prepare us for macOS aarch64 support
(https://github.com/vector-im/element-web/issues/16075) as well as pulling in
other smaller fixes.
2021-04-01 12:11:56 +01:00
J. Ryan Stinnett
d11a7e77ac Upgrade to Electron 12.0.2
This is a [major release](https://www.electronjs.org/blog/electron-12-0)
upgrade. There are a few breaking changes, but none seem to affect us.

We believe moving to Electron 12 will help with some graphics issues on certain
systems.

Fixes https://github.com/vector-im/element-web/issues/15869
2021-04-01 12:11:56 +01:00
Germain Souquet
adfb4a424a remove unused imports 2021-04-01 09:30:15 +01:00
Germain Souquet
5fc871492e make shortcut pressed variable more explanatory 2021-03-31 17:18:39 +01:00
Germain
3c68fe796f Merge pull request #176 from vector-im/gsouquet-docs
Migrate native-node-modules docs to element-desktop
2021-03-31 12:53:09 +01:00
Germain
a996aff19b Update punctuation for native module docs
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2021-03-31 12:51:22 +01:00
Germain Souquet
84990559ec Avoid exit listener to hijack other application shortcuts 2021-03-31 08:58:24 +01:00
Germain Souquet
fdf216ca75 Clarify native modules build options 2021-03-30 09:38:19 +01:00
Germain Souquet
f460cfa99a Migrate native-node-modules docs to element-desktop 2021-03-29 16:01:11 +01:00
RiotRobot
d2bc3a8a03 Merge branch 'master' into develop 2021-03-29 13:49:40 +01:00
RiotRobot
6a107f7095 v1.7.24 2021-03-29 13:49:24 +01:00
RiotRobot
ff4ebd4b39 Prepare changelog for v1.7.24 2021-03-29 13:49:24 +01:00
Germain
76eef82274 Merge pull request #173 from vector-im/gsouquet-warn-before-exit 2021-03-29 12:12:27 +01:00
Germain Souquet
d986555517 Only prompt exit warning for keyboard shortcuts 2021-03-29 12:10:27 +01:00
J. Ryan Stinnett
939c5b4588 Merge pull request #172 from vector-im/jryans/electron-11.4.1
Upgrade to Electron 11.4.1
2021-03-26 09:59:56 +00:00
Germain
f51001a460 Merge pull request #174 from vector-im/gsouquet-fix-dockerbuild-typo
Fix docker:build:native documentation typo
2021-03-25 17:38:42 +00:00
Germain
db2fd9dd53 Fix docker:build:native documentation typo 2021-03-25 15:40:47 +00:00
Germain Souquet
3d18ff16d1 Attempt to minimise the window first rather than exiting 2021-03-25 14:50:33 +00:00
Germain Souquet
9cdea580d3 Remove checkbox options for exit dialog 2021-03-25 14:34:02 +00:00
Germain Souquet
68587e84ed Add user settings for warn before exit 2021-03-25 14:15:04 +00:00
J. Ryan Stinnett
58be4c62f7 Upgrade to Electron 11.4.1 2021-03-25 13:57:29 +00:00
Germain Souquet
c9c0ceb757 Add prompt to warn before quitting the application 2021-03-25 12:46:10 +00:00
RiotRobot
a46698559f v1.7.24-rc.1 2021-03-25 12:36:14 +00:00
RiotRobot
c18b213699 Prepare changelog for v1.7.24-rc.1 2021-03-25 12:36:14 +00:00
6 changed files with 633 additions and 197 deletions

View File

@@ -1,3 +1,40 @@
Changes in [1.7.25](https://github.com/vector-im/element-desktop/releases/tag/v1.7.25) (2021-04-12)
===================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.25-rc.1...v1.7.25)
* No changes since rc.1
Changes in [1.7.25-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.25-rc.1) (2021-04-07)
=============================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.24...v1.7.25-rc.1)
* Fix disabling spellchecker
[\#179](https://github.com/vector-im/element-desktop/pull/179)
* Upgrade to Electron 12.0.2
[\#178](https://github.com/vector-im/element-desktop/pull/178)
* Avoid exit listener to hijack other application shortcuts
[\#177](https://github.com/vector-im/element-desktop/pull/177)
* Migrate native-node-modules docs to element-desktop
[\#176](https://github.com/vector-im/element-desktop/pull/176)
* Add prompt to warn before quitting the application
[\#173](https://github.com/vector-im/element-desktop/pull/173)
* Upgrade to Electron 11.4.1
[\#172](https://github.com/vector-im/element-desktop/pull/172)
* Fix docker:build:native documentation typo
[\#174](https://github.com/vector-im/element-desktop/pull/174)
Changes in [1.7.24](https://github.com/vector-im/element-desktop/releases/tag/v1.7.24) (2021-03-29)
===================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.24-rc.1...v1.7.24)
* No changes since rc.1
Changes in [1.7.24-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.7.24-rc.1) (2021-03-25)
=============================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.23...v1.7.24-rc.1)
* No changes since 1.7.23
Changes in [1.7.23](https://github.com/vector-im/element-desktop/releases/tag/v1.7.23) (2021-03-15)
===================================================================================================
[Full Changelog](https://github.com/vector-im/element-desktop/compare/v1.7.23-rc.1...v1.7.23)

View File

@@ -96,7 +96,7 @@ yarn run docker:setup
yarn run docker:install
# if you want to build the native modules (this will take a while)
yarn run docker:buildnative
yarn run docker:build:native
yarn run docker:build
```

View File

@@ -0,0 +1,61 @@
# Native Node Modules
For some features, the desktop version of Element can make use of native Node
modules. These allow Element to integrate with the desktop in ways that a browser
cannot.
While native modules enable powerful new features, they must be complied for
each operating system. For official Element releases, we will always build these
modules from source to ensure we can trust the compiled output. In the future,
we may offer a pre-compiled path for those who want to use these features in a
custom build of Element without installing the various build tools required.
Do note that compiling a module for a particular operating system
(Linux/macOS/Windows) will need to be done on that operating system.
Cross-compiling from a host OS for a different target OS may be possible, but
we don't support this flow with Element dependencies at this time.
The process is automated by [vector-im/element-builder](https://github.com/vector-im/element-builder)
when releasing.
The following sections explain the manual steps you can use with a custom build of Element to enable
these features if you'd like to try them out.
It is possible to [build those native modules locally automatically](https://github.com/vector-im/element-desktop#building).
```
yarn run build:native
```
## Adding Seshat for search in E2E encrypted rooms
Seshat is a native Node module that adds support for local event indexing and
full text search in E2E encrypted rooms.
Since Seshat is written in Rust, the Rust compiler and related tools need to be
installed before installing Seshat itself. To install Rust please consult the
official Rust [documentation](https://www.rust-lang.org/tools/install).
Seshat also depends on the SQLCipher library to store its data in encrypted form
on disk. You'll need to install it via your OS package manager.
After installing the Rust compiler and SQLCipher, Seshat support can be added
using yarn at the root of this project:
yarn add matrix-seshat
You will have to rebuild the native libraries against electron's version of
of node rather than your system node, using the `electron-build-env` tool.
This is also needed to when pulling in changes to Seshat using `yarn link`.
yarn add electron-build-env
Recompiling Seshat itself can be done like so:
yarn run electron-build-env -- --electron 6.1.1 -- neon build matrix-seshat --release
Please make sure to include all the `--` as well as the `--release` command line
switch at the end. Modify your electron version accordingly depending on the
version that is installed on your system.
After this is done the Electron version of Element can be run from the main folder
as usual using:
yarn start

View File

@@ -2,7 +2,7 @@
"name": "element-desktop",
"productName": "Element",
"main": "src/electron-main.js",
"version": "1.7.23",
"version": "1.7.25",
"description": "A feature-rich client for Matrix.org",
"author": "Element",
"repository": {
@@ -39,8 +39,8 @@
},
"devDependencies": {
"asar": "^2.0.1",
"electron-builder": "22.9.1",
"electron-builder-squirrel-windows": "22.9.1",
"electron-builder": "22.10.5",
"electron-builder-squirrel-windows": "22.10.5",
"electron-devtools-installer": "^3.1.1",
"electron-notarize": "^1.0.0",
"eslint": "7.3.1",
@@ -62,7 +62,7 @@
},
"build": {
"appId": "im.riot.app",
"electronVersion": "11.2.3",
"electronVersion": "12.0.2",
"files": [
"package.json",
{

View File

@@ -27,7 +27,9 @@ const argv = require('minimist')(process.argv, {
alias: {help: "h"},
});
const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol} = require('electron');
const {
app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol, dialog,
} = require('electron');
const AutoLaunch = require('auto-launch');
const path = require('path');
@@ -253,6 +255,30 @@ let eventIndex = null;
let mainWindow = null;
global.appQuitting = false;
const exitShortcuts = [
(input, platform) => platform !== 'darwin' && input.alt && input.code === 'F4',
(input, platform) => platform !== 'darwin' && input.control && input.code === 'KeyQ',
(input, platform) => platform === 'darwin' && input.meta && input.code === 'KeyQ',
];
const warnBeforeExit = (event, input) => {
const shouldWarnBeforeExit = store.get('warnBeforeExit', true);
const exitShortcutPressed = exitShortcuts.some(shortcutFn => shortcutFn(input, process.platform));
if (shouldWarnBeforeExit && exitShortcutPressed) {
const shouldCancelCloseRequest = dialog.showMessageBoxSync(mainWindow, {
type: "question",
buttons: ["Cancel", "Close Element"],
message: "Are you sure you want to quit?",
defaultId: 1,
cancelId: 0,
}) === 0;
if (shouldCancelCloseRequest) {
event.preventDefault();
}
}
};
const deleteContents = async (p) => {
for (const entry of await afs.readdir(p)) {
@@ -340,6 +366,12 @@ ipcMain.on('ipcCall', async function(ev, payload) {
launcher.disable();
}
break;
case 'shouldWarnBeforeExit':
ret = store.get('warnBeforeExit', true);
break;
case 'setWarnBeforeExit':
store.set('warnBeforeExit', args[0]);
break;
case 'getMinimizeToTrayEnabled':
ret = tray.hasTray();
break;
@@ -387,17 +419,25 @@ ipcMain.on('ipcCall', async function(ev, payload) {
break;
case 'setSpellCheckLanguages':
if (args[0] && args[0].length > 0) {
mainWindow.webContents.session.setSpellCheckerEnabled(true);
store.set("spellCheckerEnabled", true);
try {
mainWindow.webContents.session.setSpellCheckerLanguages(args[0]);
} catch (er) {
console.log("There were problems setting the spellcheck languages", er);
}
} else {
mainWindow.webContents.session.setSpellCheckerLanguages([]);
mainWindow.webContents.session.setSpellCheckerEnabled(false);
store.set("spellCheckerEnabled", false);
}
break;
case 'getSpellCheckLanguages':
ret = mainWindow.webContents.session.getSpellCheckerLanguages();
if (store.get("spellCheckerEnabled", true)) {
ret = mainWindow.webContents.session.getSpellCheckerLanguages();
} else {
ret = [];
}
break;
case 'getAvailableSpellCheckLanguages':
ret = mainWindow.webContents.session.availableSpellCheckerLanguages;
@@ -897,12 +937,15 @@ app.on('ready', async () => {
enableRemoteModule: false,
contextIsolation: true,
webgl: false,
spellcheck: true,
},
});
mainWindow.loadURL('vector://vector/webapp/');
Menu.setApplicationMenu(vectorMenu);
// Handle spellchecker
// For some reason spellCheckerEnabled isn't persisted so we have to use the store here
mainWindow.webContents.session.setSpellCheckerEnabled(store.get("spellCheckerEnabled", true));
// Create trayIcon icon
if (store.get('minimizeToTray', true)) tray.create(trayConfig);
@@ -917,10 +960,12 @@ app.on('ready', async () => {
}
});
mainWindow.webContents.on('before-input-event', warnBeforeExit);
mainWindow.on('closed', () => {
mainWindow = global.mainWindow = null;
});
mainWindow.on('close', (e) => {
mainWindow.on('close', async (e) => {
// If we are not quitting and have a tray icon then minimize to tray
if (!global.appQuitting && (tray.hasTray() || process.platform === 'darwin')) {
// On Mac, closing the window just hides it

667
yarn.lock
View File

File diff suppressed because it is too large Load Diff