background: refresh background on gl-video-memory-purged signal
Right now we refresh the background when resuming and when NVIDIA. But mutter has a signal to tell us specifically when to refresh, and the signal is only emitted for NVIDIA, so use that instead.
This commit is contained in:
parent
f4fd379bd6
commit
5f571b8531
@ -539,10 +539,15 @@ var BackgroundSource = new Lang.Class({
|
|||||||
this._backgrounds = [];
|
this._backgrounds = [];
|
||||||
|
|
||||||
this._monitorsChangedId = global.screen.connect('monitors-changed',
|
this._monitorsChangedId = global.screen.connect('monitors-changed',
|
||||||
this._onMonitorsChanged.bind(this));
|
this._refresh.bind(this));
|
||||||
|
|
||||||
|
global.display.connect('gl-video-memory-purged', () => {
|
||||||
|
Meta.Background.refresh_all();
|
||||||
|
this._refresh();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMonitorsChanged() {
|
_refresh() {
|
||||||
for (let monitorIndex in this._backgrounds) {
|
for (let monitorIndex in this._backgrounds) {
|
||||||
let background = this._backgrounds[monitorIndex];
|
let background = this._backgrounds[monitorIndex];
|
||||||
|
|
||||||
|
@ -278,18 +278,6 @@ var LayoutManager = new Lang.Class({
|
|||||||
global.screen.connect('in-fullscreen-changed',
|
global.screen.connect('in-fullscreen-changed',
|
||||||
this._updateFullscreen.bind(this));
|
this._updateFullscreen.bind(this));
|
||||||
this._monitorsChanged();
|
this._monitorsChanged();
|
||||||
|
|
||||||
// NVIDIA drivers don't preserve FBO contents across
|
|
||||||
// suspend/resume, see
|
|
||||||
// https://bugzilla.gnome.org/show_bug.cgi?id=739178
|
|
||||||
if (Shell.util_need_background_refresh()) {
|
|
||||||
LoginManager.getLoginManager().connect('prepare-for-sleep',
|
|
||||||
(lm, suspending) => {
|
|
||||||
if (suspending)
|
|
||||||
return;
|
|
||||||
Meta.Background.refresh_all();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// This is called by Main after everything else is constructed
|
// This is called by Main after everything else is constructed
|
||||||
|
@ -396,15 +396,6 @@ get_gl_vendor (void)
|
|||||||
return vendor;
|
return vendor;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
shell_util_need_background_refresh (void)
|
|
||||||
{
|
|
||||||
if (g_strcmp0 (get_gl_vendor (), "NVIDIA Corporation") == 0)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
canvas_draw_cb (ClutterContent *content,
|
canvas_draw_cb (ClutterContent *content,
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
|
Loading…
Reference in New Issue
Block a user