Page 1 of 1
Startup behavior
Posted: Wed Nov 13, 2024 10:48 am
by karnak
My goal with this topic is to investigate the current startup behavior, define a more consistent startup logic, and ultimately rework the UI to reflect this logic. For the most recent ideas, see post
#205506.
----
After the
1.8.2: Browser startup directory bug fix, I have noticed that there is a setting that overrides the Browser startup directory:
"Settings > General > Save session on program exit = Always"
This is redundant because you can already restore the Browser via:
"Settings > General > Startup > Start without file > Open browser > Directory > Last"
A way to solve this it's to change the behavior of "Save session on program exit" so that it only restores files opened in tabs.
Anyway, given the current behavior I think that "Save session on program exit" could be moved to "Settings > General > Startup".
I have tried to rework the startup settings:
Note that when the "Restore Browser directory" is checked the "Browser startup directory" should turn grey/disabled.
Re: 1.8.2: Browser startup directory
Posted: Wed Nov 13, 2024 11:51 am
by karnak
Re: 1.8.2: Browser startup directory
Posted: Thu Mar 27, 2025 6:10 pm
by user0
splitting '.. - Fullscreen' into checkbox (in open w/ file group) looks fine
the rest of the proposed changes do not make things as clear as 2 existing groups, also:
- Browser checkbox cannot be removed as app can start w/o Browser tab (<Empty> tab will be opened)
- "Save session.." combobox cannot be replaced with single checkbox
Re: 1.8.2: Browser startup directory
Posted: Fri Mar 28, 2025 11:02 pm
by karnak
Thank you for the reply user0.
user0 wrote: Thu Mar 27, 2025 6:10 pm
Browser checkbox cannot be removed as app can start w/o Browser tab (<Empty> tab will be opened)
I see. Do you know if the <Empty> tab has a purpose? Can you do something with it?
user0 wrote: Thu Mar 27, 2025 6:10 pm
"Save session.." combobox cannot be replaced with single checkbox
I see what you mean. I unintentionally removed the "Ask" option.
Re: 1.8.2: Browser startup directory
Posted: Mon Mar 31, 2025 10:23 am
by karnak
I have tried to rework the startup settings some more:

- 20250331_XnView_startup_mockup_002.png (30.24 KiB) Viewed 481 times

- 20250331_XnView_startup_mockup_002_menu.png (11.66 KiB) Viewed 481 times
Re: 1.8.2: Browser startup directory
Posted: Mon Mar 31, 2025 3:23 pm
by karnak
The rework covers the following use-cases:
You
start-with-file and as result you want:
- 1 tab @ file
- 1 tab @ file + previous tabs (currently not possible in XnView)
- 1 tab @ file + previous tabs + Browser @ empty directory (currently not possible in XnView)
- 1 tab @ file + previous tabs + Browser @ custom directory (currently not possible in XnView)
- 1 tab @ file + previous tabs + Browser @ previous directory
- 1 tab @ file + Browser @ empty directory
- 1 tab @ file + Browser @ custom directory
- 1 tab @ file + Browser @ previous directory
- Browser @ file
- Browser @ file + previous tabs
You
start-without-file and as result you want:
- Empty Tab
- previous tabs (currently not possible in XnView)
- previous tabs + Browser @ empty directory (currently not possible in XnView)
- previous tabs + Browser @ custom directory (currently not possible in XnView)
- previous tabs + Browser @ previous directory
- Browser @ empty directory
- Browser @ custom directory
- Browser @ previous directory
Aside from the different UI, the key part of the suggestion is changing the behavior of "Save session on program exit" to "Restore previous tabs".
Re: 1.8.2: Browser startup directory
Posted: Tue Apr 01, 2025 10:29 am
by user0
karnak wrote: Fri Mar 28, 2025 11:02 pm
user0 wrote: Thu Mar 27, 2025 6:10 pm
Browser checkbox cannot be removed as app can start w/o Browser tab (<Empty> tab will be opened)
I see. Do you know if the <Empty> tab has a purpose? Can you do something with it?
there shall be some tab to show menu
karnak wrote: Mon Mar 31, 2025 3:23 pm
You
start-with-file and as result you want:
- 1 tab @ file
- 1 tab @ file + previous tabs (currently not possible in XnView) it works for me
- 1 tab @ file + previous tabs + Browser @ empty directory (currently not possible in XnView) works via "Purge 'Recent files and folders' on exit"
- 1 tab @ file + previous tabs + Browser @ custom directory (currently not possible in XnView) not required
- 1 tab @ file + previous tabs + Browser @ previous directory
- 1 tab @ file + Browser @ empty directory
- 1 tab @ file + Browser @ custom directory not required
- 1 tab @ file + Browser @ previous directory
- Browser @ file
- Browser @ file + previous tabs
when started w file, the saved tab(s) should be restored in the unchanged state,
so some options are not required
karnak wrote: Mon Mar 31, 2025 3:23 pm
You
start-without-file and as result you want:
- Empty Tab
- previous tabs (currently not possible in XnView) it works for me
- previous tabs + Browser @ empty directory (currently not possible in XnView) see issue below
- previous tabs + Browser @ custom directory (currently not possible in XnView) see issue below
- previous tabs + Browser @ previous directory
- Browser @ empty directory
- Browser @ custom directory
- Browser @ previous directory
1.8.7 - browser - session - startup without file - Open browser setting ignored
karnak wrote: Mon Mar 31, 2025 3:23 pm
key part of the suggestion is changing the behavior of "Save session on program exit" to "Restore previous tabs".
actually, it looks ok to:
- move it Startup tab
- reworking it to checkbox, w/o asking dialog
I doubt asking is required here, if user need sessions - go to settings and enable it, like in web browsers
- rename to 'Open tabs from previous session'
as files will be reopened, not restored (eg from cache)
something like:

- settings_startup.png (12.29 KiB) Viewed 427 times
1.8.2: Browser startup directory
Posted: Tue Apr 01, 2025 3:22 pm
by karnak
user0 wrote: Tue Apr 01, 2025 10:29 am
You
start-with-file and as result you want:
- 1 tab @ file + previous tabs (currently not possible in XnView) it works for me
You
start-without-file and as result you want:
- previous tabs (currently not possible in XnView) it works for me
If your previous session had Browser and tabs, "Save session on program exit" will restore both, which means you can't have only the previous tabs restored at startup. Please explain how you were able to make these two use-cases work.
user0 wrote: Tue Apr 01, 2025 10:29 am
You
start-with-file and as result you want:
- 1 tab @ file + previous tabs + Browser @ empty directory (currently not possible in XnView) works via "Purge 'Recent files and folders' on exit"
Interesting, I'll test this option. I wonder how many other options can modify the startup behavior.
user0 wrote: Tue Apr 01, 2025 10:29 am
You
start-with-file and as result you want:
- 1 tab @ file + previous tabs + Browser @ custom directory (currently not possible in XnView) not required
- 1 tab @ file + Browser @ custom directory not required
Why not?
Let's say for the next month I have to work on a project for which it will be important to look at reference images. In this instance, I think it would be useful for XnView to always start with the Browser at the root of the project and always restore the previous tabs.
The only comment that comes to mind after taking a quick look is: Multiple Browser tabs? Really?

I'll read the issue more carefully later.
user0 wrote: Tue Apr 01, 2025 10:29 am
- reworking it to checkbox, w/o asking dialog
I doubt asking is required here, if user need sessions - go to settings and enable it, like in web browsers
Is it ok to remove the "Ask" option? I think the "Ask" option is intended to be both a safeguard and a way for new user to discover the
save session feature the first time they exit with multiple tabs open, since "Save session on program exit = Ask" is the default.
1.8.7 - startup behavior
Posted: Tue Apr 01, 2025 7:14 pm
by karnak
I did some testing on startup behaviors (XnView MP v1.8.7).
Premises
Since the startup settings are not very clear, I have used the following rules to determine what is correct behavior:
- "Save session on program exit" means "at startup, open (Viewer) tabs that were open in previous session"
- "Open browser = true" means "always open the browser at startup, even when it was not open in previous session"
- "Open browser = false" means "never open the browser at startup, not even when it was open in previous session"
- "Directory: None" means "always use an empty string as browser path, even when the previous session had a different browser path"
- "Directory: Last" means " always use the browser path from the previous session"
- "Directory: Specified" means "always use the specified browser path, even when the previous session had a different browser path"
Case 1
Settings:

- 20250401_startup_directory_case_1_none.png (4.5 KiB) Viewed 461 times
Action:
Start XnView (without file).
Results:
- When the previous session contained only browser:
At startup, the program opens the browser at "empty path", which is correct.
Â
- When the previous session contained tabs and browser:
At startup, the program opens previous tabs and browser at the path stored in "PathBrowser" (xnview.ini), which is incorrect.
The expected behavior is opening previous tabs and browser at "empty path".
Â
- When the previous session contained only tabs:
At startup, the program opens previous tabs and doesn't open the browser, which is incorrect.
The expected behavior is opening previous tabs and browser at "empty path".
Case 2
Settings:

- 20250401_startup_directory_case_2_last.png (4.5 KiB) Viewed 461 times
Action:
Start XnView (without file).
Results:
- When the previous session contained only browser:
At startup, the program opens the browser at the path stored in "PathBrowser" (xnview.ini), which is correct.
Â
- When the previous session contained tabs and browser:
At startup, the program opens previous tabs and browser at the path stored in "PathBrowser" (xnview.ini), which is correct.
Â
- When the previous session contained only tabs:
At startup, the program opens previous tabs and doesn't open the browser, which is incorrect.
The expected behavior is opening previous tabs and browser at the path stored in "PathBrowser" (xnview.ini).
Case 3
Settings:

- 20250401_startup_directory_case_3_specified.png (4.46 KiB) Viewed 461 times
Action:
Start XnView (without file).
Results:
- When the previous session contained only browser:
At startup, the program opens the browser at the path stored in "customPath" (xnview.ini), which is correct.
Â
- When the previous session contained tabs and browser:
At startup, the program opens previous tabs and browser at the path stored in "PathBrowser" (xnview.ini), which is incorrect.
The expected behavior is opening previous tabs and browser at the path stored in "customPath" (xnview.ini).
Â
- When the previous session contained only tabs:
At startup, the program opens previous tabs and doesn't open the browser, which is incorrect.
The expected behavior is opening previous tabs and browser at the path stored in "customPath" (xnview.ini).
Case 4
Settings:

- 20250401_startup_directory_case_4_no-browser.png (4.51 KiB) Viewed 426 times
Action:
Start XnView (without file).
Results:
- When the previous session contained only browser:
At startup, the program opens the "< Empty >" tab, which is correct.
Â
- When the previous session contained tabs and browser:
At startup, the program opens previous tabs and browser at the path stored in "PathBrowser" (xnview.ini), which is incorrect.
The expected behavior is opening previous tabs.
Â
- When the previous session contained only tabs:
At startup, the program opens previous tabs, which is correct.
Case 5
Settings:

- 20250401_startup_directory_case_5_file-viewer.png (1.2 KiB) Viewed 397 times
Action:
Start XnView with file.
Expected behavior:
After completing the startup procedure (as described in cases 1 to 4), the program opens the image in a new tab.
Case 6
Settings:

- 20250401_startup_directory_case_6_file-browser.png (1.21 KiB) Viewed 397 times
Action:
Start XnView with file.
Expected behavior:
After completing the startup procedure (as described in cases 1 to 4), the program opens the image in the browser.
Additional suggestion
In addition to the testing, I reworked the "Startup" settings to be more clear and in line with the behaviors I described above.
Key changes:
- "Open browser" changed from checkbox to drop-down.
- "Save session on program exit" moved from "General" to "Startup" and renamed to "Open previous tabs".

- 20250402_XnView_startup_mockup_003.png (5.63 KiB) Viewed 408 times

- 20250402_XnView_startup_mockup_003_dropdown.png (7.09 KiB) Viewed 408 times
Re: 1.8.2: Browser startup directory
Posted: Wed Apr 02, 2025 6:33 pm
by karnak
<post to delete>
Re: 1.8.7 - startup behavior
Posted: Tue Apr 08, 2025 8:09 am
by user0
I understand session functionality a bit different (the way it works now

) - saved tabs should not be modified on open:
karnak wrote: Tue Apr 01, 2025 7:14 pm
- "Save session on program exit" means "at startup, open (Viewer) tabs that were open in previous session" - all tabs (Viewer and Browser)
- "Open browser = true" means "always open the browser at startup, even when it was not open in previous session" - OK
- "Open browser = false" means "never open the browser at startup, not even when it was open in previous session"
if there is saved Browser tab - open it
if there is no saved Browser tab - do not open new one
- "Directory: None" means "always use an empty string as browser path, even when the previous session had a different browser path"
- "Directory: Last" means " always use the browser path from the previous session"
- "Directory: Specified" means "always use the specified browser path, even when the previous session had a different browser path"
'Directory' setting only applies to new Browser tab when:
- app starts w/o file AND
- Save session functionality is off
Re: 1.8.2: Browser startup directory
Posted: Tue Apr 08, 2025 11:04 am
by user0
karnak wrote: Tue Apr 01, 2025 3:22 pm
user0 wrote: Tue Apr 01, 2025 10:29 am
You
start-with-file and as result you want:
- 1 tab @ file + previous tabs (currently not possible in XnView) it works for me
You
start-without-file and as result you want:
- previous tabs (currently not possible in XnView) it works for me
If your previous session had Browser and tabs, "Save session on program exit" will restore both, which means you can't have only the previous tabs restored at startup. Please explain how you were able to make these two use-cases work.
'previous tabs' means Viewer and Browser tabs, not just Viewer
so, if Browser tab exists in saved session, it will be restored as well (Directory setting ignored)
karnak wrote: Tue Apr 01, 2025 3:22 pm
user0 wrote: Tue Apr 01, 2025 10:29 am
You
start-with-file and as result you want:
- 1 tab @ file + previous tabs + Browser @ custom directory (currently not possible in XnView) not required
- 1 tab @ file + Browser @ custom directory not required
Why not?
Let's say for the next month I have to work on a project for which it will be important to look at reference images. In this instance, I think it would be useful for XnView to always start with the Browser at the root of the project and always restore the previous tabs.
restoring tabs from saved session should not modify them
karnak wrote: Tue Apr 01, 2025 3:22 pm
user0 wrote: Tue Apr 01, 2025 10:29 am
- reworking it to checkbox, w/o asking dialog
I doubt asking is required here, if user need sessions - go to settings and enable it, like in web browsers
Is it ok to remove the "Ask" option? I think the "Ask" option is intended to be both a safeguard and a way for new user to discover the
save session feature the first time they exit with multiple tabs open, since "Save session on program exit = Ask" is the default.
asking definitely increases feature discoverability
on the other hand, I doubt many people use sessions functionality.. but I could be wrong