Closing first window closes them all

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
jfrasier
Benefactor
Benefactor
Posts: 135
Joined: Sun Jun 27, 2004 9:05 pm

Closing first window closes them all

Post by jfrasier »

We are using PWB 2.1.0.4. If a user opens several browser windows and then closes the first one, they all close. Is there a way to fix that?

Thanks.

Jane

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

PWB is a single threaded application by design to help with runaway popups and minimize memory usage. Closing the parent window willl close all child windows.

To avoid confusion set the following in your INI file.

[Browser]
ConfirmClose=True

More information:
http://teamsoftwaresolutions.com/phpBB2 ... .php?t=270

--Scott

jfrasier
Benefactor
Benefactor
Posts: 135
Joined: Sun Jun 27, 2004 9:05 pm

Post by jfrasier »

I assume that a dialog would pop up to say Are you sure? or something. I tried it and nothing happened. Should I have to confirm the closing of child windows and the parent?

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

You need to make sure you have at least the following set in your INI file.

[Files]
ConfirmCloseMessageFile=ConfirmClose.txt

These settings also affect the dialog that is shown.

[Dialogs]
DialogSeconds=15
ConfirmCloseDefaultNo=True
ConfirmCloseTitle=Confirm Close
ConfirmCloseSoundFile=

--Scott

jfrasier
Benefactor
Benefactor
Posts: 135
Joined: Sun Jun 27, 2004 9:05 pm

Post by jfrasier »

OK, now I have it working but the results don't make sense to me.

Any window I close gives that message, yet second instance windows and child windows do not really close all the browser windows.

Or maybe I still have something missing.

Thanks for your help.

Jane

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Send a copy of your INI file as an attachment to support@teamsoftwaresolutions.com and I will take a look at it.

--Scott

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

You should prevent your patrons from opening many instances of PWB by setting the following in your INI file.

[Security]
DisableSecondInstance=True

This will tell PWB to only use the one instance, so if a patron tries to open a new PWB, it will only open a new child window instead of a new parent window.

--Scott

jfrasier
Benefactor
Benefactor
Posts: 135
Joined: Sun Jun 27, 2004 9:05 pm

Post by jfrasier »

So if I disable second instrance, the user can't open PWB several times, but can only create a new window (File | New) or from a link that opens a new window, right?

I think I changed it to this because users did not know how to open a New window, but knew how to open it again.

I guess it is a tossup.

Thanks.

Jane

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

Not quite, clicking on the PWB shotrcut with the disable second instance set to true will result in a new window. Just the same as it is when it is set to false, but limited to one instance.

--Scott

jfrasier
Benefactor
Benefactor
Posts: 135
Joined: Sun Jun 27, 2004 9:05 pm

Post by jfrasier »

Now I am confused. I disabled second instance but I can start multiple PWB windows. When I close one I get the confirm close dialog, but it only closes the one.

I do see that if the second window is spawned from the first, that closing the first one causes them both to close. It seems confusing though to tell them that they all will close if they don't.

jfrasier
Benefactor
Benefactor
Posts: 135
Joined: Sun Jun 27, 2004 9:05 pm

Post by jfrasier »

So what does second instance mean?

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

A second instance is complete and separate PWB process.

A process includes the parent window process, main thread, and any secondary or child windows, and child threads. Closing the main PWB process closes all the PWB windows in the same process.

If you look in Task Manager on the Processes tab you can view the PWB processes (instances). It is possible to have multiple PWB processes that are independent of the other PWB processes. Closing one PWB process does not close the other PWB processes. Each PWB process can have multiple windows. When you close a process all the PWB windows in the current process are closed without affecting the other PWB processes.

By limiting PWB to a single instance (process), PWB will have a single parent thread that controls all the PWB windows, no matter how many PWB windows are open.

When you try to open a new PWB via a PWB shortcut, and PWB is limited to a single instance, then instead of PWB starting an entire new, and separate PWB process, PWB instead opens a new window in the current process.

A singe process saves memory, and CPU usage, and allows the single process to control all of the PWB windows.

Having multiple processes can be confusing when closing a window because you are not sure if you are closing a parent window which will close all the child windows, or closing a child window, and which child windows belong to which parents.

--Scott

jfrasier
Benefactor
Benefactor
Posts: 135
Joined: Sun Jun 27, 2004 9:05 pm

Post by jfrasier »

Thanks for the long explanation. So to review:

If I disable second instance, and confirm close, the use will get that dialog in cases of closing a parent window, or when closing the very first window opened. Is that correct? That appears to be what I am seeing and that will work for us.

Jane

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

That is correct, and exactly the reason for the 2 options.

--Scott

Post Reply