It looks like the issue may be coming from your directfb implementation ... on 
which platform does it run ?
 
Anyway, just to be sure, you can try the following:
 
First, try to launch your program with the following option: --dfb:cursor, and 
see if the cursor appears (this is equivalent to having the cursor directive 
specified in directfb configuration file, eg directfbrc).
If it works, you may consider creating a directfbrc file under /etc, or a 
.directfbrc file in your home dir or in the working dir.
 
If it doesn't, try the other layer cursor functions (EnableCursor and 
SetCursorOpacity), ...
 
David
 
 
 

 
________________________________

De : Laxmikant Rashinkar [mailto:lk2...@gmail.com] 
Envoyé : mercredi 16 mars 2011 01:53
À : CORVOYSIER David RD-MAPS-REN
Cc : directfb-dev@directfb.org
Objet : Re: [directfb-dev] question on mouse cursor


Hi David,

thanks a lot for your help. I implemented your suggestions and now I don't get 
any errors. However, the cursor is not being displayed. I get mouse move events 
and I can see that as the mouse moves over various components they get 
highlighted, but the mouse cursor itself is not visible.

I'm using directfb 1.0 and I don't have a directfbrc file.

Any suggestions on how I should proceed?

thanks a lot
Dhoti

david.corvoys...@orange-ftgroup.com wrote: 

        Hi
        
        I don't know about your error, since it seems to occur on a simple 
CreateSurface operation, but anyway, this is how you shoud do to change the 
cursor image (here with a cursor image from a file).
        I think that you need in particular to request at least administrative 
privileges on the layer before modifying the cursor (and go back to shared once 
you're done).
        
        <snip>
        
        IDirectFB *dfb = NULL;
         
        // Create main directfb administrative interface
        DFBCHECK(DirectFBCreate(&dfb));
        
        if (!dfb)
           return -1;
          
        // Get a handle on the primary layer
        IDirectFBDisplayLayer* layer = NULL;
        DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
        
        IDirectFBSurface* cursor;
        DFBSurfaceDescription idsc;
        IDirectFBImageProvider* iprov = NULL;
        /* Acquire cursor image */
            if ((dfb->CreateImageProvider(dfb, "/path/to/my/cursor/cursor.png", 
&iprov)) == DFB_OK){
              /* Create the cursor surface */
              DFBCHECK(iprov->GetSurfaceDescription(iprov, &idsc));
              idsc.flags = DFBSurfaceDescriptionFlags(DSDESC_WIDTH | 
DSDESC_HEIGHT |DSDESC_CAPS);
              idsc.caps  = DFBSurfaceCapabilities(DSCAPS_SYSTEMONLY);
              if(dfb->CreateSurface(dfb, &idsc, &cursor) == DFB_OK){
                /* Render the cursor onto the image surface */
                DFBCHECK(iprov->RenderTo(iprov, cursor, NULL));
              }
              iprov->Release(iprov);
              /* Set cursor shape */
              DFBCHECK(layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE));
              DFBCHECK(layer->SetCursorShape(layer,cursor, 0,0)); /* 0,0 -> 
cursor hotpoint is at 0,0 */
              DFBCHECK(layer->SetCooperativeLevel(layer, DLSCL_SHARED));
         }
        
        </snip>
        
        Regards
        
        David
        
        PS: please also verify that the no-cursor directive is not specified in 
your directfbrc file.
        
        -----Message d'origine-----
        De : directfb-dev-boun...@directfb.org 
[mailto:directfb-dev-boun...@directfb.org] De la part de Dhoti Walla
        Envoyé : dimanche 13 mars 2011 16:14
        À : Maik Greubel
        Cc : directfb-dev@directfb.org
        Objet : Re: [directfb-dev] question on mouse cursor
        
        Maik,
        
        thanks for your response. I should have mentioned that I'm running this 
on a Set Top Box and basic GUI and event handling work fine. Only the mouse 
does not work. I'm using DirectFB 1.0
        
        thanks
        Dhoti
        
        Maik Greubel wrote:
          

                Hello,
                
                From: "Dhoti Walla" <dhotiwa...@gmail.com> 
<mailto:dhotiwa...@gmail.com> 
                Sent: Sunday, March 13, 2011 7:04 AM
                To: <directfb-dev@directfb.org> 
<mailto:directfb-dev@directfb.org> 
                Subject: [directfb-dev] question on mouse cursor
                
                    

                        err = dfb->CreateSurface(&dfb, &mouseSurfaceDesc, 
&mouseSurface);
                        
                        Here is where I get a failure. err is always 0x07 which 
is
                        DFB_ACCESSDENIED,   /* Access to the resource is 
denied. */
                              

                Just an idea: Do you try to execute the binary as unprivileged 
user 
                and have no access to /dev/fb*?
                
                Regards
                
                Maik
                    

        _______________________________________________
        directfb-dev mailing list
        directfb-dev@directfb.org
        http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
        _______________________________________________
        directfb-dev mailing list
        directfb-dev@directfb.org
        http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
          

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to