Window.class and IDCMP
Window.class and IDCMP
I've created a window object in which I restrict the IDCMP message range to the closewindow event only, by passing "WA_IDCMP, IDCMP_CLOSEWINDOW, /.../". This is just for the sake of testing something; the window has gadgets and menu and all. When I do WM_HANDLEINPUT for this particular window, I receive not only WMHI_CLOSEWINDOW but also other events (such as WMHI_MENUPICK). Is this normal or is something broken? Should I do anything else to restrict the event range for WM_HANDLEINPUT?
The Rear Window blog
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Re: Window.class and IDCMP
There is nothing broken. Just consider the WA_IDCMP flags independent of the WMHI events. Always explicitly handle the WMHI events you are interested in and ignore the rest.
ExecSG Team Lead
- thomasrapp
- Posts: 318
- Joined: Sun Jun 19, 2011 12:22 am
Re: Window.class and IDCMP
My experience shows that flags from WA_IDCMP when specified on NewObject() are added to the default flags set by window.class internally. Some flags must be set by WA_IDCMP, for example IDCMP_RAWKEY, otherwise no WMHI_RAWKEY event will occur. You cannot unset flags by removing them from WA_IDCMP.
I have not yet tried what happens when you change flags by SetAttr(window_object,WA_IDCMP,...) and whether you can unset flags set by window.class internally.
If you set both WA_IDCMP and WINDOW_IDCMPHookBits on NewObject(), the IDCMPHookBits are not added to those in WA_IDCMP. You have to specify them explicitely in both tags.
I have not yet tried what happens when you change flags by SetAttr(window_object,WA_IDCMP,...) and whether you can unset flags set by window.class internally.
If you set both WA_IDCMP and WINDOW_IDCMPHookBits on NewObject(), the IDCMPHookBits are not added to those in WA_IDCMP. You have to specify them explicitely in both tags.
Re: Window.class and IDCMP
@ssolie
Any tips?
Why I'm asking: in connection with this thread, I'm working on a program that uses multiple windows generating Intuition input. I've decided to use a shared port for all windows to handle all incoming events in a single loop. As one of the windows is a drawing window that sends loads of INTUITION_MOUSEMOVE events, I'm trying to limit the amount of events other windows could possibly send to the shared port. I want the event handling to be as efficient as possible.ssolie wrote:Just consider the WA_IDCMP flags independent of the WMHI events. Always explicitly handle the WMHI events you are interested in and ignore the rest.
Any tips?
The Rear Window blog
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
- thomasrapp
- Posts: 318
- Joined: Sun Jun 19, 2011 12:22 am
Re: Window.class and IDCMP
Depending on how different the windows are in their behaviour and purpose and on what the application does between the input events, it might be an idea to create a seperate process for each window. This surely will result in the highest possible responsiveness of your application and it might give the user the option to save his work in case one of the processes crashed. And it might be much easier to program and thus have less bugs.
Re: Window.class and IDCMP
Yes, test it before worrying about it. If you notice there is a real problem then we can get into more complex solutions such as multiple message ports and so on.trixie wrote:Any tips?
ExecSG Team Lead
Re: Window.class and IDCMP
@thomasrapp
Are you sure? I use no WA_IDCMP tag for the program window in WordNet and yet I receive WMHI_RAWKEY events just all right.My experience shows that flags from WA_IDCMP when specified on NewObject() are added to the default flags set by window.class internally. Some flags must be set by WA_IDCMP, for example IDCMP_RAWKEY, otherwise no WMHI_RAWKEY event will occur.
Thanks, I'll keep this solution in mind.Depending on how different the windows are in their behaviour and purpose and on what the application does between the input events, it might be an idea to create a seperate process for each window. This surely will result in the highest possible responsiveness of your application
The Rear Window blog
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Re: Window.class and IDCMP
@ssolie

Point taken. I thought I'd ask before I actually start implementing something because re-implementation usually takes longer than a questiontest it before worrying about it. If you notice there is a real problem then we can get into more complex solutions such as multiple message ports and so on.

The Rear Window blog
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition