From 80d4e5ed2ea2d4a506f86851e41e19daa593dbcd Mon Sep 17 00:00:00 2001
From: Andrew Aldridge <i80and@foxquill.com>
Date: Sun, 31 Dec 2017 02:11:15 +0000
Subject: [PATCH] Ensure screen savers have an active GL context
Fixes a NULL dereference in Flurry, and incorrect viewport
configuration in Gravity and GLife.
Fixes #13191
---
src/add-ons/screen_savers/flurry/Flurry.cpp | 4 ++--
src/add-ons/screen_savers/glife/GLifeView.cpp | 3 ++-
src/add-ons/screen_savers/gravity/GravityView.cpp | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/add-ons/screen_savers/flurry/Flurry.cpp b/src/add-ons/screen_savers/flurry/Flurry.cpp
index befa124e39..738caae6e7 100644
a
|
b
|
FlurryView::InitCheck() const
|
104 | 104 | void |
105 | 105 | FlurryView::AttachedToWindow() |
106 | 106 | { |
107 | | LockGL(); |
108 | | |
109 | 107 | BGLView::AttachedToWindow(); |
110 | 108 | |
| 109 | LockGL(); |
| 110 | |
111 | 111 | MakeTexture(); |
112 | 112 | |
113 | 113 | glDisable(GL_DEPTH_TEST); |
diff --git a/src/add-ons/screen_savers/glife/GLifeView.cpp b/src/add-ons/screen_savers/glife/GLifeView.cpp
index 4e511e8c8f..d03405a0a7 100644
a
|
b
|
GLifeView::~GLifeView(void)
|
45 | 45 | void |
46 | 46 | GLifeView::AttachedToWindow(void) |
47 | 47 | { |
48 | | LockGL(); |
49 | 48 | BGLView::AttachedToWindow(); |
| 49 | |
| 50 | LockGL(); |
50 | 51 | |
51 | 52 | glClearDepth(1.0); |
52 | 53 | glDepthFunc(GL_LESS); |
diff --git a/src/add-ons/screen_savers/gravity/GravityView.cpp b/src/add-ons/screen_savers/gravity/GravityView.cpp
index 1b0dea7669..67d93541a1 100644
a
|
b
|
GravityView::~GravityView()
|
42 | 42 | void |
43 | 43 | GravityView::AttachedToWindow() |
44 | 44 | { |
45 | | LockGL(); |
46 | 45 | BGLView::AttachedToWindow(); |
47 | 46 | |
| 47 | LockGL(); |
| 48 | |
48 | 49 | glClearDepth(1.0f); |
49 | 50 | |
50 | 51 | glEnable(GL_BLEND); |