MetaWindow: Clear fullscreen monitors when monitors change

The fullscreen monitors state is set given a set of xinerama monitor
identification numbers. When the monitor configuration changes (e.g. by
a hotplug event) these are no longer valid, and may point to
uninitialized or unallocated data. Avoid accessing
uninitialized/unallocated memory by clearing the fullscreen monitor
state when the monitor configuration changes.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2016-11-29 16:13:21 +08:00
parent 36f2d5b0f1
commit 103df63023

View File

@ -3540,6 +3540,9 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
{
const MetaLogicalMonitor *old, *new;
if (window->fullscreen_monitors[0] != -1)
window->fullscreen_monitors[0] = -1;
if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
{
meta_window_update_monitor (window, FALSE);