mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
osdWindow: Check monitor validity before updating
When a monitor is removed, the OsdWindow for that monitor may process the monitors-changed signal before OsdWindowManager does (which will remove the OSD). If that happens, we will currently try to access an invalid monitor; check for this to avoid a couple of warning.
This commit is contained in:
parent
011fef4b2b
commit
ef04a9d1ed
1 changed files with 2 additions and 0 deletions
|
|
@ -192,6 +192,8 @@ const OsdWindow = new Lang.Class({
|
|||
_monitorsChanged: function() {
|
||||
/* assume 110x110 on a 640x480 display and scale from there */
|
||||
let monitor = Main.layoutManager.monitors[this._monitorIndex];
|
||||
if (!monitor)
|
||||
return; // we are about to be removed
|
||||
|
||||
let scalew = monitor.width / 640.0;
|
||||
let scaleh = monitor.height / 480.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue