Cx locks WB

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Cx locks WB

Post by mritter0 »

In my project I use the screen notify system for when WB wants to close/reopen. All worked fine until I added a little commodity to my project. It seems to lock the screen and prevents WB from completing its update. Is this normal? Do I have to shut down the Cx and re-open? If I don't start the Cx at program start it works as expected. The Cx just listens for 2 rawkeys.
Workbench Explorer - A better way to browse drawers
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: Cx locks WB

Post by xenic »

mritter0 wrote:In my project I use the screen notify system for when WB wants to close/reopen. All worked fine until I added a little commodity to my project. It seems to lock the screen and prevents WB from completing its update. Is this normal? Do I have to shut down the Cx and re-open? If I don't start the Cx at program start it works as expected. The Cx just listens for 2 rawkeys.
If you open Exchange you will see a number of commodities that don't block WB from close/reopen. In the case of those that can open a window, there is blocking when the window is open. If your commodity isn't opening a window then there should be a way of preventing it from blocking WB open/close.
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: Cx locks WB

Post by mritter0 »

Its weird. I have verified the PubScreen is unlocked. Disable the Cx it works fine. I will keep plugging away at it. It can't be a bug since, like you said, there are other Cxs running that work. Has to be on my part.
Workbench Explorer - A better way to browse drawers
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: Cx locks WB

Post by salass00 »

mritter0 wrote:Its weird. I have verified the PubScreen is unlocked. Disable the Cx it works fine. I will keep plugging away at it. It can't be a bug since, like you said, there are other Cxs running that work. Has to be on my part.
It might be worth for you to try and isolate the problem code into a smaller test program. If it turns out to be a system bug rather than just a mistake on your part then this will also be useful as a test case for when fixing it.
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: Cx locks WB

Post by xenic »

mritter0 wrote:Its weird. I have verified the PubScreen is unlocked. Disable the Cx it works fine. I will keep plugging away at it. It can't be a bug since, like you said, there are other Cxs running that work. Has to be on my part.
I found a couple of example commodity programs on the old developer CD, modified them slightly to compile for OS4 and tested them. Neither one prevents Workbench from closing and reopening. If you have access to a developer CD, the examples are Broker.c and PopShell.c. Maybe you can compare what you're doing with the way those examples work. If you figure out the problem let us know because I have an old program that also blocks WB open/close which might be commodities related.
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: Cx locks WB

Post by mritter0 »

I figured it out. When the window was closed it tried to re-open it before it should have. I had to put several little checks in the code to figure it out. Thanks for the input. It made me look at things closer and found another error, also.
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: Cx locks WB

Post by mritter0 »

I found the real problem: I was using bit SNOTIFY_WAIT_REPLY along with SNOTIFY_BEFORE_CLOSEWB and SNOTIFY_AFTER_OPENWB. Took out SNOTIFY_WAIT_REPLY like AutoDocs says not to use and it works much better.
Workbench Explorer - A better way to browse drawers
Post Reply