Skip to content

Commit b2ec191

Browse files
committed
Add a restart engine shortcut
Sometimes (especially when performing operations fast) empty tiles appear. Restarting the engin solves that issue.
1 parent 515f699 commit b2ec191

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/controller/actions/shortcuts.ts

+11
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ export class ShortcutManager {
163163
shortcuts
164164
.getCycleEngine()
165165
.activated.connect(this.cycleEngine.bind(this));
166+
shortcuts
167+
.getRestartEngine()
168+
.activated.connect(this.restartEngine.bind(this));
166169

167170
shortcuts
168171
.getSwitchBTree()
@@ -337,4 +340,12 @@ export class ShortcutManager {
337340
this.ctrl.qmlObjects.osd.show(engineName(engineType));
338341
this.ctrl.driverManager.setEngineConfig(desktop, engineConfig);
339342
}
343+
344+
restartEngine(): void {
345+
const desktop = this.ctrl.desktopFactory.createDefaultDesktop();
346+
const engineConfig = this.ctrl.driverManager.getEngineConfig(desktop);
347+
let engineType = engineConfig.engineType;
348+
this.ctrl.qmlObjects.osd.show("Restart: " + engineName(engineType));
349+
this.ctrl.driverManager.setEngineConfig(desktop, engineConfig);
350+
}
340351
}

src/extern/qml.ts

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export interface Shortcuts {
5757
getResizeRight(): ShortcutHandler;
5858

5959
getCycleEngine(): ShortcutHandler;
60+
getRestartEngine(): ShortcutHandler;
6061
getSwitchBTree(): ShortcutHandler;
6162
getSwitchHalf(): ShortcutHandler;
6263
getSwitchThreeColumn(): ShortcutHandler;

src/qml/shortcuts.qml

+11
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@ Item {
160160
sequence: "Meta+Ctrl+L";
161161
}
162162

163+
function getRestartEngine() {
164+
return restartEngine;
165+
}
166+
ShortcutHandler {
167+
id: restartEngine;
168+
169+
name: "PoloniumRestartEngine";
170+
text: "Polonium: Restart Engine";
171+
sequence: "Meta+Shift+R";
172+
}
173+
163174
function getCycleEngine() {
164175
return cycleEngine;
165176
}

0 commit comments

Comments
 (0)