File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 16
16
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
17
17
//
18
18
19
+ /*
20
+ * This out of focus window is a somewhat strange Window
21
+ * When the main window is out of focus (so not receving any keystrokes)
22
+ * it is surrounded by a red square to notify the user
23
+ * The red square is the only functionality, so no save, no move, no resize etc.
24
+ */
25
+
19
26
using Microsoft . Xna . Framework ;
20
27
using Microsoft . Xna . Framework . Graphics ;
21
28
Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ public abstract class Window : RenderPrimitive
45
45
VertexBuffer WindowVertexBuffer ;
46
46
IndexBuffer WindowIndexBuffer ;
47
47
48
- readonly bool DoNotDisplayWindow ;
48
+ public bool DoNotDisplayWindow // true for a NotInFocus window
49
+ {
50
+ get ;
51
+ private set ;
52
+ }
49
53
50
54
public Window ( WindowManager owner , int width , int height , string caption )
51
55
{
Original file line number Diff line number Diff line change @@ -171,14 +171,20 @@ public void Initialize()
171
171
public void Save ( BinaryWriter outf )
172
172
{
173
173
foreach ( var window in Windows )
174
- window . Save ( outf ) ;
174
+ if ( ! window . DoNotDisplayWindow )
175
+ // This if is added to not do the save in case of the out of focus window
176
+ // See Source\RunActivity\Viewer3D\Popups\OutOfFocusWindow.cs
177
+ window . Save ( outf ) ;
175
178
}
176
179
177
180
[ CallOnThread ( "Render" ) ]
178
181
public void Restore ( BinaryReader inf )
179
182
{
180
183
foreach ( var window in Windows )
181
- window . Restore ( inf ) ;
184
+ if ( ! window . DoNotDisplayWindow )
185
+ // This if is added to not do the restore in case of the out of focus window
186
+ // See Source\RunActivity\Viewer3D\Popups\OutOfFocusWindow.cs
187
+ window . Restore ( inf ) ;
182
188
}
183
189
184
190
[ CallOnThread ( "Updater" ) ]
You can’t perform that action at this time.
0 commit comments