|
Public screen closing bug in OS4.1 (FIXED) |
Posted on: 2011/6/15 21:13
#1 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/5/19 13:23 Posts: 2815
|
When OWB is running on a public screen, and then closes, it appears that it never calls CloseScreen(), and instead relies upon the "Open/close automatically" feature of Sys:Prefs/Screens...
... But this feature does not appear to work when a "foriegn" window (like a Ringhio notification) is temporarily present on that public screen. You would expect the public screen to automatically close when this foreign window closes, but this does not appear to be the case. EDIT: Please note that this bug report is not quite correct, and I have revised it in Post #22 EDIT 2: It appears that both bugs have already been fixed, and so should be available in the next OS4 update! Edited by ChrisH on 2011/6/16 18:26:19
Edited by ChrisH on 2011/6/18 11:32:39 Edited by ChrisH on 2011/6/18 11:33:14 |
|
_________________
Author of the PortablE programming language. I love using Amiga OS4.1 on my A1-X1000 & Sam440 ![]() Don't forget the official support forum for OS4! |
||
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/15 21:50
#2 |
---|---|---|
Amigans Defender
![]() ![]() Joined:
2006/11/17 22:40 From England
Posts: 2862
|
I think that's actually a Ringhio bug. The last window on a public screen is responsible for closing it. On public screens an application should be attempting a CloseScreen() when it has finished on that screen.
AFAIK, anyway. You can't expect the application that opens a public screen to hang around in memory waiting to close it, if other apps are squatting. (btw, I have downloaded and installed your litle patch) |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/15 23:08
#3 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2007/2/23 13:49 From Finland, the land of Santa, sauna, sisu and salmiakki
Posts: 982
|
Easy workaround is close that Ringhio window before closing your app. (Move mouse pointer over Ringhio window and it will reveal the close gadget.)
|
|
_________________
Extremely happy X1000 user. Be authentic. "Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray AmigaOne X1000 |
||
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/15 23:15
#4 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/5/19 13:23 Posts: 2815
|
@TSK Quote:
Easy workaround is close that Ringhio window before closing your app. Except that it is easy to forget (or not even notice the Ringhio notification).... not to mention this shouldn't be an issue in the first place for something as important to the Amiga as Screens. @Chris So what does "Open/close automatically" do then? I thought it was a new feature for OS4.1, which automatically opened (and closed) public screens when you referred to them by name instead of using OpenScreen/CloseScreen (although I don't actually know how you would do that). Quote: btw, I have downloaded and installed your litle patch) Please make sure to download version "r2", as this fixes problems with MPlayer amoung other things. |
|
_________________
Author of the PortablE programming language. I love using Amiga OS4.1 on my A1-X1000 & Sam440 ![]() Don't forget the official support forum for OS4! |
||
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 4:58
#5 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2008/1/6 17:56 From Pennsylvania, USA
Posts: 773
|
@ChrisH
No public screen will close if there is a window open on it. It's a safety measure not a bug. What do you think would happen if a program rendered to a window on a screen that has closed? The screen closing is automatic in the sense that the last visitor window on a public screen doesn't need to explicitly close a screen when the window closes. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 7:55
#6 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/5/19 13:23 Posts: 2815
|
@xenic Quote:
No public screen will close if there is a window open on it. Of course not! That is not what I am claiming. Please re-read what I wrote. If it is still not clear, then I will explain again.... Quote: The screen closing is automatic in the sense that the last visitor window on a public screen doesn't need to explicitly close a screen when the window closes. This is NOT happening, hence my bug report. |
|
_________________
Author of the PortablE programming language. I love using Amiga OS4.1 on my A1-X1000 & Sam440 ![]() Don't forget the official support forum for OS4! |
||
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 11:44
#7 |
---|---|---|
Amigans Defender
![]() ![]() Joined:
2006/11/17 22:40 From England
Posts: 2862
|
Quote:
Regardless of whether this is set or not, visitor windows should still be trying to close the public screen... I think. Otherwise you get the situation where the application that opened the screen initially has to stay in memory and loop trying to close it. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 12:06
#8 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/5/19 13:23 Posts: 2815
|
@Chris
That does not appear to be the case. At least the SDK says this: Quote: NAME Quote: NAME Quote: NAME Quote:
This all seems to indicate that "visitor windows" should NOT try opening or closing the screen. There does not appear to be any counter operating in the fashion you suggest. It also provides a way that "Open/close automatically" COULD work: If public screen FooBar has that feature enabled, then when a program calls LockPubScreen("FooBar"), or if it opens a window with WA_PubScreenName="FooBar", then AmigaOS can automatically open that screen for the program. This also means that AmigaOS must automatically close the screen when the last visitor window is CloseWindow()ed... except it doesn't in my tests. Edited by ChrisH on 2011/6/16 12:21:55
Edited by ChrisH on 2011/6/16 12:49:02 |
|
_________________
Author of the PortablE programming language. I love using Amiga OS4.1 on my A1-X1000 & Sam440 ![]() Don't forget the official support forum for OS4! |
||
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 13:18
#9 |
---|---|---|
Just popping in
![]() ![]() Joined:
2006/11/26 17:45 Posts: 239
|
A screen, public or not, belongs to the application which opened it by a call to OpenScreen or OpenScreenTags. Only this application is allowed to close the screen by a call to CloseScreen. Visitor windows must not call CloseScreen on public screens.
If OS4 has a mechanism to open public screens automatically by a call to LockPubScreen, this mechanism is also responsible to close the screen. If it does not work, it is a bug. Usually LockPubScreen should not open a screen, but fail if the named screen does not exist or is not public. A program which opened a screen and made it public must be aware that visitor windows can exist and that CloseScreen can fail. In this case it has to wait until all visitor windows are gone before it closes the screen. It must not quit before the screen is closed. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 14:33
#10 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2008/1/6 17:56 From Pennsylvania, USA
Posts: 773
|
@Thomas
Quote: A program which opened a screen and made it public must be aware that visitor windows can exist and that CloseScreen can fail. In this case it has to wait until all visitor windows are gone before it closes the screen. It must not quit before the screen is closed. That's true for programs that open their own screens and has been the case since public screens were introduced to the O.S. However, the OS4 Screens preferences program enables system created screens that are opened automatically whenever a program attempts to open on a screen with that name. Even programs that don't normally open their own public screens can be opened on a public screen that does not yet exist if the screen is defined in the Screens preferences and set to open/close automatically. For example, I have created a screen in Screens preferences called "Internet" with the auto open/close setting selected. I have a TOOLTYPE "PUBSCREEN=Internet" set in all my Internet apps. Whenever I start one of my Internet apps, OS4 will automatically open the screen "Internet" if it is not already open. My other Internet programs will also open on the same screen once it is opened and the screen will closed automatically when the last window is closed. OS4 OWB doesn't open it's own screen. It will open on a public screen specified with the PUBSCREEN Tooltype. The whole public screen mechanism and "Screens" created public screens work fine on my system. I don't like Ringhio and don't use it. It opens small notification messages that don't look or act like standard Amiga Windows. They are just small colored blocks with text that appear on the screen background. I think the Ringio notifications look like they belong in some other OS. There are clearly defined mechanisms for visitor windows and requesters on public screens but Ringhio messages don't act like normal windows or requesters and don't appear to be well integrated into Intuition. The problem is with Ringhio and not Intuition or Screens preferences and I think that patching CloseScreen() is a misguided attempt to compensate for a Ringhio problem. Without Ringhio, my public screens (whether program created or Screen prefs created) all work as they should. I think Ringhio should use system compliant requesters instead of the current method. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 14:57
#11 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2006/11/27 14:35 From Nantes, France
Posts: 863
|
Quote:
I agree with you patching CloseScreen() so that it never fails might not be a good idea because this means that some programs that rely on the fact that CloseScreen() returns immediately might get stuck for ever without being prepared of this... *If* it's a bug in Ringhio let's fix Ringhio not Intuition. EDIT: removed some stupidity. |
|
_________________
Back to a quiet home... At last ![]() |
||
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 14:58
#12 |
---|---|---|
Just popping in
![]() ![]() Joined:
2006/11/26 17:45 Posts: 239
|
Quote:
However, the OS4 Screens preferences program enables system created screens that are opened automatically whenever a program attempts to open on a screen with that name. As I said, if there is such a mechanism, then this mechanism is responsible for closing the screen, just like any other application. And it must be possible for that mechanisam and any other application to rely on the notification system (SA_PubSig, SA_PubTask) in order to know when the last visitor window disappears. If Ringhio destroys the notification because it does not use the normal LockPubScreen/UnlockPubScreen and/or OpenWindow/CloseWindow functions, then it is just bad software and should be fixed. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 15:54
#13 |
---|---|---|
Just popping in
![]() ![]() Joined:
2006/12/1 12:20 From Bologna, Italy
Posts: 92
|
I cannot replicate the problem using AOS4.1 beta (upd2 + daily updates)
OWB (3.32) correctly close the screen when the last Ringhio notification fades away, so the bug seems to be fixed. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 16:01
#14 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2008/1/6 17:56 From Pennsylvania, USA
Posts: 773
|
@abalaban
Quote: I agree with you patching CloseScreen() so that it never fails might not be a good idea because this means that some programs that rely on the fact that CloseScreen() returns immediately might get stuck for ever without being prepared of this... Yes, I can imagine all sorts of potential problems. I wonder what happens if a visitor window attempts to open on the screen while the owning program is stuck in patched CloseScreen()? Some screens are opened with a request for signaling when the last window is closed and will never even call CloseScreen() until the signal is received. Patching CloseScreen() would have no effect anyway. It would be nice if someone involved in OS4 development would comment on the wisdom of patching CloseScreen() in this way. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 16:15
#15 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2008/1/6 17:56 From Pennsylvania, USA
Posts: 773
|
@M3X
Quote: I cannot replicate the problem using AOS4.1 beta (upd2 + daily updates) OWB (3.32) correctly close the screen when the last Ringhio notification fades away, so the bug seems to be fixed. In that case, I think Chris should remove the patch from OS4Depot before it causes any unforseen problems. I have to wonder how MUI will react if it gets stuck in CloseScreen() of an MUI defined screen. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 16:19
#16 |
---|---|---|
Amigans Defender
![]() ![]() Joined:
2006/11/26 23:16 Posts: 980
|
Quote:
It would be nice if someone involved in OS4 development would comment on the wisdom of patching CloseScreen() in this way. It is a very bad idea. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 16:20
#17 |
---|---|---|
Just popping in
![]() ![]() Joined:
2007/2/24 10:59 From Near Cologne, somewhere in the deep forest
Posts: 128
|
As thomas said, theres simply no need for a CloseScreen() patch. Just follow the development guidelines, and do some wait if CloseScreen() fails. If theres a broken program still holding a Lock on your public screen, there is actually nothing you (or the OS) can do against this, beside freeing as many resources as possible and place yourself into a Wait() loop.
Some time in the future there may be some other solution for closing public screens, involving messaging perhaps, which would help with crashed programs holding a Lock on a public screen. As soon as Exec/Dos killed the broken program (and freed its resources/locks), Intuition could send a Signal/Message to the process that opened the public screen, telling that its safe now to attempt another CloseScreen(). Something along this line... |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 16:21
#18 |
---|---|---|
Amigans Defender
![]() ![]() Joined:
2006/11/26 23:16 Posts: 980
|
Quote:
I have to wonder how MUI will react if it gets stuck in CloseScreen() of an MUI defined screen. MUI 3.9 is still in active development so any defects can be fixed. |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 16:27
#19 |
---|---|---|
Just popping in
![]() ![]() Joined:
2007/2/24 10:59 From Near Cologne, somewhere in the deep forest
Posts: 128
|
@ssolie:
You could take this as a proposal for a new feature ![]() |
|
|
Re: Public screen closing bug in OS4.1 |
Posted on: 2011/6/16 17:17
#20 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/5/19 13:23 Posts: 2815
|
@all
Since people are blaming Ringhio, and/or the programs, I will explain more why I think this is an *OS4* bug: If I get MUI to open a screen for SimpleMail, then tell CygnusEd to open it's window on that public screen, then close SimpleMail, then close CygnusEd... then the public screen will remain open forever (and in fact if I run SimpleMail again then it will be unable to use that public screen, and will use Workbench instead, since I suspect MUI tries to create a new public screen of the same name and fails because one already exists). @whose Quote: As thomas said, theres simply no need for a CloseScreen() patch. Just follow the development guidelines That is all very well... unless OS4 itself is buggy. My BetterCloseScreen patch solves the problem for MUI apps, but not for OWB since it (unsurprisingly) never seems to call CloseScreen in the first place. @all I do NOT wish to debate the pros & cons of my CloseScreen patch in this thread, and kindly ask you to refrain from doing so. This thread is about an OS4 bug. You can create a new thread if you wish to discuss my patch... however I would prefer if you would wait for the "r2" release to be verified for public download, since this fixes a major bug. Edited by ChrisH on 2011/6/16 17:33:31
|
|
_________________
Author of the PortablE programming language. I love using Amiga OS4.1 on my A1-X1000 & Sam440 ![]() Don't forget the official support forum for OS4! |
||