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?



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.

> 		bgsurface->SetFont( bgsurface, font );
> 		bgsurface->SetColor( bgsurface, 0xEE, 0x00, 0xEE, 0xFF );
>           	}
> 	
> 	//Create Window on layer
> 	{
> 		DFBWindowDescription desc;
> 
> 		desc.flags = ( DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH |
> DWDESC_HEIGHT | DWDESC_CAPS);
> 		desc.caps = DWCAPS_INPUTONLY;

Are you sure you want to use DWCAPS_INPUTONLY? The window will be 
invisible.

> 		desc.posx = 200;
> 		desc.posy = 200;
> 		desc.width = 300;
> 		desc.height = 300;
> 
> 		layer->CreateWindow( layer, &desc, &window1 );
> 		window1->SetOpacity( window1, 0xFF );
> 		window1->GetID( window1, &id1 );
> 		
> 	}
> 

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/




Home | Main Index | Thread Index


directfb.org / Development / Old Archives