Here we go again...
What is wrong with this picture?
#include <proto/exec.h>
#include <proto/intuition.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
//open default display
struct Screen *qt_intuition_screen = IIntuition->OpenScreenTags (NULL,
SA_LikeWorkbench, TRUE,
SA_Type, PUBLICSCREEN,
SA_PubName, "QTPUBSCREEN",
SA_Title, "Qt 4.7.0",
SA_ShowTitle, TRUE,
//SA_Quiet, TRUE,
TAG_END);
if (!qt_intuition_screen)
{
printf("Failed to open public screen!\n");
exit(-1);
}
struct Screen *scr = IIntuition->LockPubScreen("QTPUBSCREEN");
if (!scr)
{
IIntuition->CloseScreen(qt_intuition_screen);
printf("Failed to lock public screen\n");
exit(-1);
}
struct Window *window = IIntuition->OpenWindowTags (NULL,
WA_Left, 100,
WA_Top, 100,
WA_InnerWidth, 300,
WA_InnerHeight, 300,
WA_PubScreen, scr,
WA_PubScreenName, "QTPUBSCREEN",
//WA_UserPort, qt_intuition_port,
WA_IDCMP, IDCMP_CLOSEWINDOW|
IDCMP_NEWSIZE|
IDCMP_MOUSEBUTTONS|
IDCMP_MOUSEMOVE|
IDCMP_CHANGEWINDOW|
//IDCMP_VANILLAKEY|
IDCMP_RAWKEY,
//WA_Flags, WFLG_GIMMEZEROZERO,
WA_GimmeZeroZero, TRUE,
WA_ScreenTitle, "Qt 4.7.0",
WA_Title, "Hello there ;-)",
WA_DepthGadget, TRUE,
WA_SizeGadget, TRUE,
WA_DragBar, TRUE,
WA_CloseGadget, TRUE,
WA_Activate, TRUE,
WA_SmartRefresh, TRUE,
WA_RMBTrap, TRUE,
WA_MinWidth, 1,
WA_MinHeight, 1,
WA_MaxWidth, 1920,
WA_MaxHeight, 1080,
WA_ReportMouse, TRUE,
TAG_END, TAG_DONE
);
IIntuition->UnlockPubScreen(NULL, scr);
if (!window)
{
IIntuition->CloseScreen(qt_intuition_screen);
printf("Failed to open window on public screen!\n");
exit(-1);
}
IIntuition->CloseWindow(window);
IIntuition->CloseScreen(qt_intuition_screen);
return (0);
}
It just returns "Failed to lock public screen". I know it used to work, that same piece of code, so what on earth could be the problem?? I have searched the RKM in vain...
Any help is highly appreciated!