Also remover unused variables and functions Signed-off-by: Jean-Christophe DUBOIS <j...@tribudubois.net> --- systems/x11/primary.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/systems/x11/primary.c b/systems/x11/primary.c index 1f0e0bc..9817c63 100644 --- a/systems/x11/primary.c +++ b/systems/x11/primary.c @@ -83,6 +83,7 @@ D_DEBUG_DOMAIN( X11_Update, "X11/Update", "X11 Update" ); /**********************************************************************************************************************/ +#if 0 static DFBResult dfb_x11_create_window( DFBX11 *x11, X11LayerData *lds, const CoreLayerRegionConfig *config ) { @@ -118,6 +119,7 @@ dfb_x11_destroy_window( DFBX11 *x11, X11LayerData *lds ) return DFB_OK;//ret; } +#endif static DFBResult update_stereo( DFBX11 *x11, const DFBRectangle *left_clip, const DFBRectangle *right_clip, @@ -605,7 +607,9 @@ primaryInitLayer( CoreLayer *layer, shared->output[output].size.w, shared->output[output].size.h, DSPF_RGB32 ); - shared->output[output].xw->layer_id = lds->layer_id; + if (bSucces) { + shared->output[output].xw->layer_id = lds->layer_id; + } } /* fill out the default configuration */ @@ -662,7 +666,6 @@ primaryTestRegion( CoreLayer *layer, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; - X11LayerData *lds = layer_data; D_DEBUG_AT( X11_Layer, "%s()\n", __FUNCTION__ ); @@ -730,7 +733,6 @@ primaryAddRegion( CoreLayer *layer, CoreLayerRegionConfig *config ) { DFBResult ret; - DFBX11 *x11 = driver_data; X11LayerData *lds = layer_data; D_DEBUG_AT( X11_Layer, "%s( lds %p )\n", __FUNCTION__, lds ); @@ -765,7 +767,7 @@ primarySetRegion( CoreLayer *layer, CoreSurfaceBufferLock *left_lock, CoreSurfaceBufferLock *right_lock ) { - DFBResult ret; +// DFBResult ret; DFBX11 *x11 = driver_data; X11LayerData *lds = layer_data; @@ -836,7 +838,7 @@ primaryRemoveRegion( CoreLayer *layer, void *layer_data, void *region_data ) { - DFBX11 *x11 = driver_data; +// DFBX11 *x11 = driver_data; X11LayerData *lds = layer_data; D_DEBUG_AT( X11_Layer, "%s()\n", __FUNCTION__ ); @@ -1228,9 +1230,6 @@ update_screen( DFBX11 *x11, const DFBRectangle *clip, CoreSurfaceBufferLock *loc return DFB_OK; } #endif - if (!xw) - return DFB_OK; - rect.x = rect.y = 0; rect.w = xw->width; @@ -1669,14 +1668,13 @@ dfb_x11_create_window_handler( DFBX11 *x11, SetModeData *setmode ) *(setmode->xw) = NULL; dfb_x11_close_window( x11, xw ); shared->window_count--; + xw = NULL; } bool bSucces = dfb_x11_open_window( x11, &xw, dfb_config->x11_position.x, dfb_config->x11_position.y, shared->output[setmode->output].size.w, shared->output[setmode->output].size.h, config->format ); - xw->layer_id = setmode->layer_id; - /* Set video mode */ if ( !bSucces ) { D_ERROR( "DirectFB/X11: Couldn't open %dx%d window!\n", config->width, config->height ); @@ -1684,10 +1682,11 @@ dfb_x11_create_window_handler( DFBX11 *x11, SetModeData *setmode ) XUnlockDisplay( x11->display ); return DFB_FAILURE; } - else { - *(setmode->xw) = xw; - shared->window_count++; - } + + xw->layer_id = setmode->layer_id; + + *(setmode->xw) = xw; + shared->window_count++; XUnlockDisplay( x11->display ); return DFB_OK; @@ -1710,6 +1709,7 @@ dfb_x11_destroy_window_handler( DFBX11 *x11, DestroyData *destroy ) dfb_x11_close_window( x11, xw ); shared->window_count--; + xw = NULL; } x11->Sync( x11 ); -- 1.9.1 _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev