Sumatrapdf: SumatraPDF automatically changes settings value in settings in Windows 10

Created on 19 Jun 2018  ·  7Comments  ·  Source: sumatrapdfreader/sumatrapdf

SumatraPDF on Windows10 automatically changes the value of
WindowState in settings file to 3

Value was manually set to 1.
It resets back to 3 after a few days of use.

Anyone face this issue?

Most helpful comment

Why does this value change randomly.

It doesn't. As already mentioned above Sumatra writes the _last used value_ of WindowState (i.e. the state of the window when the app exits properly) to the settings file.

In case you have turned off Sumatra's ability to save session data (open tabs and file states) then quite likely there won't be too many remaining settings you'll need to repeatedly modify and save. In such a situation you can go ahead with @GitHubRulesOK's first suggestion and make the settings file read-only.

All 7 comments

1 is normal and 3 is fullscreen. So you mean to say Sumatra automatically starts opening in fullscreen mode without you doing anything? Doesn't seem likely. The only way it'll do this is if you close the app (say with Alt+F4) _while_ you're viewing a document in fullscreen mode. In that case it'll obviously write the last used value i.e. WindowState = 3 to SumatraPDF-settings.txt.

Yes. That is what I mean. I am using sumatra on a Win10 Tablet.
Everthing works fine for a while, but every few days I find there is no menu and no tabs. The document is open in Full screen. Then I have to close sumatra, go and change the setting from 3 to 1, save and reopen.
Few days later same thing. This has happend about 4 times in the past month and half since I started using sumatra.

Using a tablet (without keyboard) usually can have this side effect if F5 or F11 is somehow being invoked to go full screen unwittingly

with a keyboard it is easy to hit escape (or f11) either of which would reset the windowstate prior to closing.

If there is an on screen keyboard is it active and triggering Function keys ? alternatively next time your in full screen try via an on screen keyboard using [escape] to exit full screen

Thank You.
Thats probably the right explanation. It happened again a few minutes ago, hit [escape] on the on screen keyboard and it did exit full screen.

Checked the settings file and the WindowState=2 now. Why does this value change randomly. Any way I an default it to stay at 1?

@wins9900
one of the "benefits" of the settings file is the fact its _dynamic_ and changes "on the fly" the downside is that if the program closes unexpectedly the file can be corrupted (as others have complained when windows reboots) there are at least a few potential solutions but none may suit your needs

1) lock the settings file to read only (that means you have restricted use and need too unlock and lock the file each time you need to make a change = too much hassle unless your running a web kiosk

2)posibbly the easiest is to run a small command line routine via a one click shortcut to emulate the manual edit see Find & Replace Text)
two lines should be enough i.e
change "windowstate = 3" to "windowstate = 1"
and also "windowstate = 2" to "windowstate =1"
you could run those only if you know you had a problem

3)keep a copy of the settings file and overwrite it at startup, e.g. write a batch file that copies the last good settings.txt, then opens sumatrapdf then at the end of a good session asks do you want to keep new settings

alternatively a shortcut to notepad with the settings file would probably be similar to simply opening advanced settings

Why does this value change randomly.

It doesn't. As already mentioned above Sumatra writes the _last used value_ of WindowState (i.e. the state of the window when the app exits properly) to the settings file.

In case you have turned off Sumatra's ability to save session data (open tabs and file states) then quite likely there won't be too many remaining settings you'll need to repeatedly modify and save. In such a situation you can go ahead with @GitHubRulesOK's first suggestion and make the settings file read-only.

Thank you guys.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

banbonic picture banbonic  ·  4Comments

Gugus99 picture Gugus99  ·  3Comments

lanhktc picture lanhktc  ·  3Comments

kbitlive picture kbitlive  ·  7Comments

carlvn picture carlvn  ·  3Comments