I've discovered some strange ringhio behaviour which can be reproduced by running the code below like this:
- Start the Notify program for the first time
Two popups should be displayed.
Now open Prefs/Notifications
You should find two new registered applications: "TestApp-Something" and "TestApp"
Untick TestApp only but leave TestApp-Something enabled, save settings.
Start the Notify program again
This time the second popup should be disabled but it isn't! Both still show up.
Now do it the other way round: Untick TestApp-Something but tick TestApp
Start the Notify program again
This time only the first popup should be disabled but instead none of them shows up.
Setting REGAPP_UniqueApplication to TRUE in both instances doesn't change anything either.
It seems as if TestApp automagically inherits the Notification settings from TestApp-Something instead of using its own.
Can you please tell me if this is a bug or if it's intentional?
Code: Select all
;/* NotifyTest
gcc -o Notify Notify.c
quit
*/
#include <stdio.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/application.h>
struct Library *ApplicationBase = NULL;
struct ApplicationIFace *IApplication = NULL;
uint32 AppID = 0;
int OpenLibs(void) {
if((DOSBase = IExec->OpenLibrary("dos.library", 52))) {
if((IDOS = (APTR)IExec->GetInterface(DOSBase, "main", 1L, NULL))) {
if((ApplicationBase = IExec->OpenLibrary("application.library", 52))) {
if((IApplication = (APTR)IExec->GetInterface(ApplicationBase, "application", 2L, NULL))) {
return 1;
}
}
}
}
return 0;
}
void CloseLibs(void) {
if(IApplication) IExec->DropInterface((struct Interface *)IApplication);
if(ApplicationBase) IExec->CloseLibrary(ApplicationBase);
if(IDOS) IExec->DropInterface((struct Interface *)IDOS);
if(DOSBase) IExec->CloseLibrary(DOSBase);
}
int main(void) {
if(OpenLibs()) {
AppID = IApplication->RegisterApplication("TestApp-Something",
REGAPP_UniqueApplication, FALSE,
REGAPP_HasIconifyFeature, TRUE,
TAG_END);
if(AppID) {
printf("TestApp-Something application registered.\n");
IDOS->Delay(50);
IApplication->Notify(AppID,
APPNOTIFY_Title, "TestApp-Something Testing!",
APPNOTIFY_Text, "One, Two!",
TAG_END);
printf("TestApp-Something notification sent.\n");
IApplication->UnregisterApplication(AppID, NULL);
printf("TestApp-Something application unregistered.\n");
}
AppID = IApplication->RegisterApplication("TestApp",
REGAPP_UniqueApplication, FALSE,
REGAPP_HasIconifyFeature, TRUE,
TAG_END);
if(AppID) {
printf("TestApp application registered.\n");
IDOS->Delay(50);
IApplication->Notify(AppID,
APPNOTIFY_Title, "TestApp Testing!",
APPNOTIFY_Text, "Three, Four!",
TAG_END);
printf("TestApp notification sent.\n");
IApplication->UnregisterApplication(AppID, NULL);
printf("TestApp application unregistered.\n");
}
CloseLibs();
}
}