Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
111 user(s) are online (84 user(s) are browsing Forums)

Members: 0
Guests: 111

more...

Headlines

 
  Register To Post  

Public screen
Just can't stay away
Just can't stay away


See User information
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_LikeWorkbenchTRUE,
                            
SA_TypePUBLICSCREEN,
                            
SA_PubName"QTPUBSCREEN",
                            
SA_Title"Qt 4.7.0",
                            
SA_ShowTitleTRUE,
                            
//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_Left100,
                                                
WA_Top100,
                                                
WA_InnerWidth300,
                                                
WA_InnerHeight300,

                                                
WA_PubScreenscr,
                                                
WA_PubScreenName"QTPUBSCREEN",

                                                
//WA_UserPort, qt_intuition_port,
                                                
WA_IDCMPIDCMP_CLOSEWINDOW|
                                                          
IDCMP_NEWSIZE|
                                                          
IDCMP_MOUSEBUTTONS|
                                                          
IDCMP_MOUSEMOVE|
                                                          
IDCMP_CHANGEWINDOW|
                                                          
//IDCMP_VANILLAKEY|
                                                          
IDCMP_RAWKEY,
                                                
//WA_Flags, WFLG_GIMMEZEROZERO,
                                                
WA_GimmeZeroZeroTRUE,
                                                
WA_ScreenTitle"Qt 4.7.0",
                                                
WA_Title"Hello there ;-)",
                                                
WA_DepthGadgetTRUE,
                                                
WA_SizeGadgetTRUE,
                                                
WA_DragBarTRUE,
                                                
WA_CloseGadgetTRUE,
                                                
WA_ActivateTRUE,
                                                
WA_SmartRefreshTRUE,
                                                
WA_RMBTrapTRUE,
                                                
WA_MinWidth1,
                                                
WA_MinHeight1,
                                                
WA_MaxWidth1920,
                                                
WA_MaxHeight1080,
                                                
WA_ReportMouseTRUE,
                                                
TAG_ENDTAG_DONE
                                                
);
    
IIntuition->UnlockPubScreen(NULLscr);

    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!

Go to top
Re: Public screen
Just popping in
Just popping in


See User information
intuition.library/OpenScreen:
SA_PubName: If this field is present (and ti_Data is non-NULL), it means that the screen is a public screen, and that the public screen name string is pointed to by ti_Data. Public screens are opened in "PRIVATE" mode and must be made public using PubScreenStatus( screen, 0 ).

intuition.library/LockPubScreen:
RESULT
screen - Returns pointer to a screen if successful or NULL. The call can fail for reasons including that the named public screen doesn't exist or is in private state.

So I guess a IIntuition->PubScreenStatus(qt_intuition_screen, 0) after the IIntuition->OpenScreenTags() should help.

Go to top
Re: Public screen
Just can't stay away
Just can't stay away


See User information
Does he need to lock the screen at all in that case? No other programs should be able to lock the screen if it's in PRIVATE status. He should be able to just open his window after opening the screen and then use PubScreenStatus to allow other programs to lock the screen before opening windows on it.

Go to top
Re: Public screen
Just can't stay away
Just can't stay away


See User information
@Gazelle

Thank you for the pointer, that solved the issue!

Go to top
Re: Public screen
Not too shy to talk
Not too shy to talk


See User information
Quote:

xenic wrote:
Does he need to lock the screen at all in that case? No other programs should be able to lock the screen if it's in PRIVATE status. He should be able to just open his window after opening the screen and then use PubScreenStatus to allow other programs to lock the screen before opening windows on it.



You are right. The owner of the screen does not need to lock it. Only visitors need to.

Go to top
Re: Public screen
Just can't stay away
Just can't stay away


See User information
@xenic & thomas

Ok, good to know!

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project