Startup behavior

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

Startup behavior

Post 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:

20241113_XnView_startup_options_mockup_003.png

Note that when the "Restore Browser directory" is checked the "Browser startup directory" should turn grey/disabled.
You do not have the required permissions to view the files attached to this post.
Last edited by karnak on Wed Apr 09, 2025 5:25 pm, edited 8 times in total.
karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

Re: 1.8.2: Browser startup directory

Post by karnak »

20241113_XnView_startup_options_mockup_002.png
You do not have the required permissions to view the files attached to this post.
User avatar
user0
XnThusiast
Posts: 2292
Joined: Sat May 09, 2015 9:37 am

Re: 1.8.2: Browser startup directory

Post 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
karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

Re: 1.8.2: Browser startup directory

Post 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.
karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

Re: 1.8.2: Browser startup directory

Post by karnak »

I have tried to rework the startup settings some more:

20250331_XnView_startup_mockup_002.png
20250331_XnView_startup_mockup_002_menu.png
You do not have the required permissions to view the files attached to this post.
karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

Re: 1.8.2: Browser startup directory

Post 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".
User avatar
user0
XnThusiast
Posts: 2292
Joined: Sat May 09, 2015 9:37 am

Re: 1.8.2: Browser startup directory

Post 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
You do not have the required permissions to view the files attached to this post.
karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

1.8.2: Browser startup directory

Post 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.
user0 wrote: Tue Apr 01, 2025 10:29 am You start-without-file and as result you want:
  • 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
1.8.7 - browser - session - startup without file - Open browser setting ignored
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.
karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

1.8.7 - startup behavior

Post 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

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

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

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

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

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

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
20250402_XnView_startup_mockup_003_dropdown.png
You do not have the required permissions to view the files attached to this post.
Last edited by karnak on Wed Apr 09, 2025 5:29 pm, edited 6 times in total.
karnak
Posts: 38
Joined: Sat Aug 09, 2014 9:27 pm

Re: 1.8.2: Browser startup directory

Post by karnak »

<post to delete>
Last edited by karnak on Wed Apr 09, 2025 5:01 pm, edited 1 time in total.
User avatar
user0
XnThusiast
Posts: 2292
Joined: Sat May 09, 2015 9:37 am

Re: 1.8.7 - startup behavior

Post by user0 »

I understand session functionality a bit different (the way it works now :D ) - 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
User avatar
user0
XnThusiast
Posts: 2292
Joined: Sat May 09, 2015 9:37 am

Re: 1.8.2: Browser startup directory

Post 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