SimpleView.st
branchjv
changeset 7299 009757f02299
parent 7296 3e1f431163d7
child 7312 e69b73023aea
--- a/SimpleView.st	Mon Apr 18 23:42:35 2016 +0100
+++ b/SimpleView.st	Wed Apr 20 09:06:30 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -1305,39 +1303,28 @@
     (Screen isNil or:[Screen current isNil]) ifTrue:[^ self].
 
     "
-     tell all view classes to flush any
+     Don't do anything when restarting from a snapshot. Otherwuse
+     all fonts and so on got reset to defaults which is what we
+     DON'T want. If the font is not available, then font ioself 
+     should pick a proper replacement.
+    "
+    Smalltalk isRestarting ifTrue:[ ^ self ].
+    "
+     Tell all view classes to flush any
      cached style-data
     "
     self changed:#style.
     SimpleView updateStyleCache.
     SimpleView allSubclassesDo:[:aClass |
-	"JV@2010-12-02: Removed to avoid lost of preferred fonts on image restart"
-	"/ cg: no, this is required!!!!!!
-	"/ otherwise, we get ugly courier fonts on windows
-	"/ updateStyleCache MUST clear any previously
-	"/ cached font values, otherwise you cannot load a style's font.
-	"/ if you want to keep your fonts, do it elsewhere (keep some userFontPrefs and restore from there)
-
-	"/ JV: Font preferences ARE already saved in user's setting.rc/setting.stx, but they
-	"/     are not reloaded on snapshot restart (which is correct, I think).
-	"/     This just discard such fonts. I would say calling this upon snapshot restart
-	"/     is a bad idea. Workaround it only for me is not a solution as all other
-	"/     Linux users are ... off. Let's workaround it:
-	(Smalltalk isInitialized not and:
-	    [OperatingSystem getOSType == #linux and:
-		[UserPreferences current linuxFontWorkaround]])
-		    ifFalse:[
-			aClass defaultFont:nil.
-		    ].
-
-	(aClass class includesSelector:#updateStyleCache) ifTrue:[
-	    aClass updateStyleCache
-	].
+        aClass defaultFont:nil.
+        (aClass class includesSelector:#updateStyleCache) ifTrue:[
+            aClass updateStyleCache
+        ].
     ].
 
     "/ use #at: to avoid introducing a depency to libview2
     (Smalltalk at:#MIMETypeIconLibrary) notNil ifTrue:[
-	(Smalltalk at:#MIMETypeIconLibrary) flushIcons
+        (Smalltalk at:#MIMETypeIconLibrary) flushIcons
     ].
 
 
@@ -1347,7 +1334,7 @@
 
     "Modified: / 15-09-1998 / 22:04:15 / cg"
     "Modified (format): / 05-10-2011 / 16:08:47 / az"
-    "Modified (format): / 30-03-2012 / 17:31:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-04-2016 / 08:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 updateStyleCache