Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.27 #41

Merged
merged 9 commits into from
Jul 7, 2021
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ dist/
node_modules/
thumbs.db
.idea/
.vim/

todo.md
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "marvin",
"version": "0.0.26",
"version": "0.0.27",
"license": "MIT",
"scripts": {
"dev": "electron-webpack dev",
Expand Down
2 changes: 1 addition & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { app } from 'electron';
import { loadConfig } from './config';
import { initModules, deinitModules } from './executor';

app.commandLine.appendSwitch("disable-gpu"); // Transparancy will not work without this
app.commandLine.appendSwitch("disable-gpu"); // Transparency will not work without this

async function startApp() {
const got_single_instance_lock = app.requestSingleInstanceLock();
Expand Down
9 changes: 3 additions & 6 deletions src/main/modules/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ let tray;

let main_window;

const MAX_TRANSFER_LEN = 200; // Text in the results sent to the renderer will be croped to this length.
const MAX_TRANSFER_LEN = 200; // Text in the results sent to the renderer will be cropped to this length.

// This stores the original_options because we only send croped text fields.
// This stores the original_options because we only send cropped text fields.
// (Fixes a performance issue when the clipboard contains a very long text)
const original_option = new Map();

// This variable is used to ensure that if a earlier query finishes after a later query, it will not
// actualty sen the results to the renderer.
// actually sen the results to the renderer.
let execution_count = 0;

function sendUpdatedOptions(id, sender, results) {
Expand Down Expand Up @@ -92,9 +92,6 @@ export function createMainWindow() {
main_window.webContents.on('will-navigate', (e) => {
e.preventDefault();
});
main_window.webContents.on('new-window', (e) => {
e.preventDefault();
});
main_window.on('close', hideWindow);
if (!isDevelopment) {
main_window.on('blur', hideWindow);
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ class App extends React.Component {
clearTimeout(this.last_results);
this.last_results = setTimeout(() => {
clearTimeout(this.last_loading);
this.setState({ results: options, selected: 0 });
this.setState({ results: options, selected: 0, center: true });
}, this.state.config ? this.state.config.general.incremental_result_debounce : 20);
});
ipcRenderer.on('update-config', (_, config) => {
this.setState({ config: config });
});
ipcRenderer.on('reset', (_) => {
this.setState({ results: [], selected: 0 });
this.setState({ results: [], selected: 0, center: true });
});
}

Expand All @@ -45,7 +45,7 @@ class App extends React.Component {
}, this.state.config ? this.state.config.general.debounce_time : 20);
clearTimeout(this.last_loading);
this.last_loading = setTimeout(() => {
this.setState({ results: null, selected: 0 });
this.setState({ results: null, selected: 0, center: true });
}, 200);
}

Expand Down
Loading