From 5d313cead7b4901b55b67960b86a82ffed1df637 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Tue, 22 Nov 2016 22:40:52 -0800 Subject: [PATCH] Enable recent files, projects, new window task on Windows taskbar --- src/reopen-project-menu-manager.js | 25 +++++++++++++++++++++++++ src/workspace.coffee | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/reopen-project-menu-manager.js b/src/reopen-project-menu-manager.js index 50c42e115..b651b6223 100644 --- a/src/reopen-project-menu-manager.js +++ b/src/reopen-project-menu-manager.js @@ -46,6 +46,31 @@ export default class ReopenProjectMenuManager { this.projects = this.historyManager.getProjects().slice(0, this.config.get('core.reopenProjectMenuCount')) const newMenu = ReopenProjectMenuManager.createProjectsMenu(this.projects) this.lastProjectMenu = this.menuManager.add([newMenu]) + this.updateWindowsJumpList() + } + + updateWindowsJumpList () { + if (process.platform !== 'win32') return + + if (this.app === undefined) { + this.app = require('remote').app + } + + this.app.setJumpList([ + { + type:'custom', + name:'Recent Projects', + items: this.projects.map(p => ({ + type: 'task', + title: ReopenProjectMenuManager.createLabel(p), + program: process.execPath, + args: p.paths.map(path => `"${path}"`).join(' ') })) + }, + { type: 'recent' }, + { items: [ + {type: 'task', title: 'New Window', program: process.execPath, args: '--new-window', description: 'Opens a new Atom window'} + ]} + ]) } dispose () { diff --git a/src/workspace.coffee b/src/workspace.coffee index 89c53b678..9c6dc3b80 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -441,7 +441,7 @@ class Workspace extends Model # Avoid adding URLs as recent documents to work-around this Spotlight crash: # https://github.com/atom/atom/issues/10071 - if uri? and not url.parse(uri).protocol? + if uri? and (not url.parse(uri).protocol? or process.platform is 'win32') @applicationDelegate.addRecentDocument(uri) pane = @paneContainer.paneForURI(uri) if searchAllPanes