DirectFB - Home of the pragmatist Roadmap


[directfb-users] Re: Why Windows manager can move my Surface?
Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[directfb-users] Re: Why Windows manager can move my Surface?



Quoting Ville Syrjälä:
> On Tue, Jul 13, 2004 at 03:31:25PM +0800, Jack Liu (Shanghai) wrote:
> > Hi, Sven,
> > 	Now comes the codes, I write it refer to the example"df_window.c".
> > 
> > 
> > 	DirectFBInit (&argc, &argv);
> > 	DirectFBCreate (&dfb);
> > 
> > 	//init display layer
> > 	dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
> > 	layer->SetCooperativeLevel( layer, DLSCL_ADMINISTRATIVE );
> > 	layer_config.flags = DLCONF_BUFFERMODE;
> > 	layer_config.buffermode = DLBM_FRONTONLY;
> > 	layer->SetConfiguration( layer, &layer_config );
> > 	layer->GetConfiguration( layer, &layer_config );
> > 	layer->EnableCursor ( layer, 1 );
> > 
> > 	//create bg surface
> > 	{
> > 		DFBSurfaceDescription desc;
> > 
> > 		desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_CAPS;
> > 		desc.width = layer_config.width;
> > 		desc.height = layer_config.height;
> > 		desc.caps = DSCAPS_PRIMARY |DSCAPS_SYSTEMONLY;
> > 		dfb->CreateSurface( dfb, &desc, &bgsurface );
> 
> Here you are implicitly creating a window because your DirectFB 
> cooperative level is DFSCL_SHARED. That's why you can move it around. Just 
> replace this part with layer->GetSurface( layer ); and your app will work 
> correctly.

You shouldn't access the layer's surface directly in windowed mode.

But you can create a surface like above, without using DSCAPS_PRIMARY.

You can set this surface as the background image using:

layer->SetBackgroundImage( layer, bgsurface );
layer->SetBackgroundMode( layer, DLBM_IMAGE );

If you create a flipping surface you can use bgsurface->Flip() calls
afterwards to force a window stack recomposition for the whole screen.
Note that you have to pass a NULL region in this case, otherwise it's
not a real flip and it won't be propagated.

-- 
Best regards,
  Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"

                            Convergence GmbH




Home | Main Index | Thread Index


directfb.org / Development / Old Archives