Merge pull request #13307 from atom/dg-windows-jump-lists

Windows taskbar recent & tasks support
This commit is contained in:
Damien Guard 2016-11-23 09:13:03 -08:00 committed by GitHub
commit 07ce491dec
2 changed files with 26 additions and 1 deletions

View File

@ -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 () {

View File

@ -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