Some IDCMP questions...

2 posts / 0 new
Last post
OldFart
OldFart's picture
Offline
Last seen: 3 hours 41 min ago
Joined: 2010-11-30 14:09
Some IDCMP questions...

Hi,

To finish off the title:
...and an IDCMP port rattling like a machine gun.

When a window (MY window, that is) is active, the IDCMP port gets innundated with mousemove messages, although I modified the IDCMP 'filter' to NOT pass these messages:

  1. if (IIntuition->GetWindowAttr((__GE)->ge_Window[ACTIVEWOID], WA_IDCMP, (APTR)&IDCMP, 4) != 0)
  2. {
  3. (__GE)->ge_DefaultIDCMP = IDCMP;
  4. _PrintFlags(IDCMP);
  5. IDCMP = (__GE)->ge_ActiveIDCMP;
  6.  
  7. if (IIntuition->SetWindowAttr((__GE)->ge_Window[ACTIVEWOID], WA_IDCMP, (APTR)&IDCMP, 4) != 0)
  8. {
  9. # ifdef DEBUG
  10. uint32 IDCMP_Modified = 0;
  11.  
  12. if (IIntuition->GetWindowAttr((__GE)->ge_Window[ACTIVEWOID], WA_IDCMP, (APTR)&IDCMP_Modified, 4) != 0)
  13. {
  14. _PrintFlags(IDCMP_Modified);
  15. }
  16. _ElseError("Get Window Attribute(s) DEBUG");
  17.  
  18. # endif
  19.  
  20. }
  21. _ElseError("Set Window Attribute(s)");
  22.  
  23. }
  24. _ElseError("Get Attributes");

In this part both _PrintFlags() and _ElseError() are functionlike macros.

The output from _PrintFlags() is this:

  1. FLAGS: * IDCMP [ 0000 1110 1100 1100 0010 0110 0101 1100 ]
  2. FLAGS: * IDCMP_Modified [ 0101 0011 0010 1011 0000 1010 0001 1000 ]
  3. FLAGS: * IDCMP [ 0000 0000 0000 0000 0100 0000 0110 0010 ]

The 1st line is the IDCMP-flags as default by opening a Window.
The 2nd line is the applied IDCMP-flags after modification (a far cry from...).
The 3rd line is the set of IDCMP-flags I had in mind.

All according to this scheme:

  1. |||| |||| |||| |||| |||| |||| |||| ||||
  2. NOTEZ-BIEN --------+||| |||| |||| |||| |||| |||| |||| ||||
  3. RESERVED2 ---------+|| |||| |||| |||| |||| |||| |||| ||||
  4. RESERVED1 ----------+| |||| |||| |||| |||| |||| |||| ||||
  5. EXTENDEDKEYBOARD -----------+ |||| |||| |||| |||| |||| |||| ||||
  6. |||| |||| |||| |||| |||| |||| ||||
  7. EXTENDEDMOUSE ------------ +||| |||| |||| |||| |||| |||| ||||
  8. GADGETHELP ------------ -+|| |||| |||| |||| |||| |||| ||||
  9. CHANGEWINDOW ------------ --+| |||| |||| |||| |||| |||| ||||
  10. MENUHELP ------------ ---+ |||| |||| |||| |||| |||| ||||
  11. |||| |||| |||| |||| |||| ||||
  12. IDCMPUPDATE ------------ ---- +||| |||| |||| |||| |||| ||||
  13. INTUITICKS ------------ ---- -+|| |||| |||| |||| |||| ||||
  14. VANILLAKEY ------------ ---- --+| |||| |||| |||| |||| ||||
  15. DELTAMOVE ------------ ---- ---+ |||| |||| |||| |||| ||||
  16. |||| |||| |||| |||| ||||
  17. INACTIVEWINDOW ------------ ---- ---- +||| |||| |||| |||| ||||
  18. ACTIVEWINDOW ------------ ---- ---- -+|| |||| |||| |||| ||||
  19. WBENCHMESSAGE ------------ ---- ---- --+| |||| |||| |||| ||||
  20. DISKREMOVED ------------ ---- ---- ---+ |||| |||| |||| ||||
  21. |||| |||| |||| ||||
  22. DISKINSERTED ------------ ---- ---- ---- +||| |||| |||| ||||
  23. NEWPREFS ------------ ---- ---- ---- -+|| |||| |||| ||||
  24. MENUVERIFY ------------ ---- ---- ---- --+| |||| |||| ||||
  25. REQCLEAR ------------ ---- ---- ---- ---+ |||| |||| ||||
  26. |||| |||| ||||
  27. REQVERIFY ------------ ---- ---- ---- ---- +||| |||| ||||
  28. RAWKEY ------------ ---- ---- ---- ---- -+|| |||| ||||
  29. CLOSEWINDOW ------------ ---- ---- ---- ---- --+| |||| ||||
  30. MENUPICK ------------ ---- ---- ---- ---- ---+ |||| ||||
  31. |||| ||||
  32. REQSET ------------ ---- ---- ---- ---- ---- +||| ||||
  33. GADGETUP ------------ ---- ---- ---- ---- ---- -+|| ||||
  34. GADGETDOWN ------------ ---- ---- ---- ---- ---- --+| ||||
  35. MOUSEMOVE ------------ ---- ---- ---- ---- ---- ---+ ||||
  36. ||||
  37. MOUSEBUTTONS ------------ ---- ---- ---- ---- ---- ---- +|||
  38. REFRESHWINDOW ------------ ---- ---- ---- ---- ---- ---- -+||
  39. NEWSIZE ------------ ---- ---- ---- ---- ---- ---- --+|
  40. SIZEVERIFY -------------------------------------------------+

The WMHI-Class messages I get are (from the console partly):

  1. FLOW : ----- Handle_AllSignals entered
  2. FLOW : ------ Handle_WMHISignal entered
  3. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  4. FLOW : ------ Handle_WMHISignal vacated
  5. FLOW : ------ Handle_WMHISignal entered
  6. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  7. FLOW : ------ Handle_WMHISignal vacated
  8. FLOW : ------ Handle_WMHISignal entered
  9. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  10. FLOW : ------ Handle_WMHISignal vacated
  11. FLOW : ------ Handle_WMHISignal entered
  12. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  13. FLOW : ------ Handle_WMHISignal vacated
  14. FLOW : ------ Handle_WMHISignal entered
  15. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  16. FLOW : ------ Handle_WMHISignal vacated
  17. FLOW : ------ Handle_WMHISignal entered
  18. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  19. FLOW : ------ Handle_WMHISignal vacated
  20. FLOW : ------ Handle_WMHISignal entered
  21. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  22. FLOW : ------ Handle_WMHISignal vacated
  23. FLOW : ------ Handle_WMHISignal entered
  24. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  25. FLOW : ------ Handle_WMHISignal vacated
  26. FLOW : ------ Handle_WMHISignal entered
  27. DEBUG: Message gotten [ 000F0000 ] -- Class [ 15 ] - [ Mousemove ] rejected *
  28. FLOW : ------ Handle_WMHISignal vacated

and finally:

  1. FLOW : ------ Handle_WMHISignal entered
  2. DEBUG: Message gotten [ 00010000 ] -- Class [ 1 ] - [ Close window ] accepted
  3. FLOW : ------- WMHI_CloseWindow entered
  4. FLOW : ------- WMHI_CloseWindow vacated
  5. FLOW : ------ Handle_WMHISignal vacated
  6. FLOW : ----- Handle_AllSignals vacated

and are generated by this function:

  1. BOOL Handle_WMHISignal(struct ExecParam *xn)
  2. {
  3. INFO_ENTER
  4. BOOL Success = FALSE;
  5.  
  6. uint32 MsgClass;
  7.  
  8. while (((__GE)->ge_WMHI_Message = IIntuition->IDoMethod((__GE)->ge_WinObj[ACTIVEWOID], WM_HANDLEINPUT, 0)) != WMHI_LASTMSG)
  9. {
  10. #ifdef DEBUG
  11. IDOS->Printf("DEBUG: Message gotten [ %08lx ] -- Class [ %2lu ]", (__GE)->ge_WMHI_Message, ((__GE)->ge_WMHI_Message & WMHI_CLASSMASK) >> 16);
  12. #endif
  13.  
  14. if (
  15. ((MsgClass = ((((__GE)->ge_WMHI_Message & WMHI_CLASSMASK) >> 16) - 1)) < 20) &&
  16. ((__GE)->ge_WMHIFilter & (1L<<MsgClass)) &&
  17. ((__GE)->ge_WMHI_ClassJumpTable[MsgClass] != NULL)
  18. )
  19. {
  20. #ifdef DEBUG
  21. IDOS->Printf(" - [ %-15s ] accepted\n", WMHI_Class[MsgClass]);
  22. #endif
  23.  
  24. Success = (__GE)->ge_WMHI_ClassJumpTable[MsgClass](xn);
  25. }
  26. #ifdef DEBUG
  27. else
  28. {
  29. IDOS->Printf(" - [ %-15s ] rejected *\n", WMHI_Class[MsgClass]);
  30. }
  31. #endif
  32. }
  33.  
  34. INFO_VACATE
  35. return Success;
  36. }

a function in which I incorporated this line:

  1. ((__GE)->ge_WMHIFilter & (1L<<MsgClass)) &&

to filter out these unsollicited messages.

Why do I get all these messages?
Why is the applied IDCMP 'filter' so entirely different from BOTH the first automatically generated one AND the one I had in mind?

OldFart

OldFart
OldFart's picture
Offline
Last seen: 3 hours 41 min ago
Joined: 2010-11-30 14:09
Re: Some IDCMP questions...

Modified this line

  1. if (IIntuition->SetWindowAttr((__GE)->ge_Window[ACTIVEWOID], WA_IDCMP, (APTR)&IDCMP, 4) != 0)

to

  1. if (IIntuition->SetWindowAttr((__GE)->ge_Window[ACTIVEWOID], WA_IDCMP, (APTR)IDCMP, 4) != 0)

and that worked miracles...

Log in or register to post comments