diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js index f0e564b7e..d4411d015 100644 --- a/js/ui/windowMenu.js +++ b/js/ui/windowMenu.js @@ -128,11 +128,10 @@ var WindowMenu = new Lang.Class({ let screen = global.screen; let nMonitors = screen.get_n_monitors(); - if (nMonitors > 1) { + let monitorIndex = window.get_monitor(); + if (nMonitors > 1 && monitorIndex >= 0) { this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - let monitorIndex = window.get_monitor(); - let dir = Meta.ScreenDirection.UP; let upMonitorIndex = screen.get_monitor_neighbor_index(monitorIndex, dir);