windowMenu: Check if monitorIndex is valid before using it
Calling meta_window_get_monitor on an unmanaged window may return
-1, so we need to check the return value.
https://bugzilla.gnome.org/show_bug.cgi?id=788882
(cherry picked from commit c9bf72c5c4
)
This commit is contained in:
parent
0b82388c49
commit
a662e7bb87
@ -128,10 +128,9 @@ var WindowMenu = new Lang.Class({
|
|||||||
|
|
||||||
let screen = global.screen;
|
let screen = global.screen;
|
||||||
let nMonitors = screen.get_n_monitors();
|
let nMonitors = screen.get_n_monitors();
|
||||||
if (nMonitors > 1) {
|
|
||||||
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
|
||||||
|
|
||||||
let monitorIndex = window.get_monitor();
|
let monitorIndex = window.get_monitor();
|
||||||
|
if (nMonitors > 1 && monitorIndex >= 0) {
|
||||||
|
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||||
|
|
||||||
let dir = Meta.ScreenDirection.UP;
|
let dir = Meta.ScreenDirection.UP;
|
||||||
let upMonitorIndex =
|
let upMonitorIndex =
|
||||||
|
Loading…
Reference in New Issue
Block a user