mirror of
https://github.com/KeithDHedger/LFSDesktopProject.git
synced 2025-08-15 22:10:23 +00:00
Fixed cairo surfaces not being created/resized properly
This commit is contained in:
@ -56,7 +56,6 @@ int main(int argc, char **argv)
|
||||
|
||||
apc=new LFSTK_applicationClass();
|
||||
|
||||
apc->LFSTK_getDefaultWInit();
|
||||
apc->LFSTK_addWindow(NULL,BOXLABEL,"LFSAbout");
|
||||
wc=apc->mainWindow;
|
||||
wc->LFSTK_setKeepAbove(true);
|
||||
|
@ -1,4 +1,5 @@
|
||||
0.7.0
|
||||
Fixed cairo surfaces not being created/resized properly.
|
||||
Fixed minor update glitch.
|
||||
Ignore lines beginning with '#' when using LFSTK_loadVarsFromFile from prefs class.
|
||||
Changes to structures, you must recompile all.
|
||||
|
@ -371,13 +371,13 @@ struct windowInitStruct
|
||||
int y=0;
|
||||
int w=1;
|
||||
int h=1;
|
||||
std::string appName;
|
||||
std::string className;
|
||||
std::string windowName;
|
||||
std::string appName="";
|
||||
std::string className="";
|
||||
std::string windowName="";
|
||||
bool overRide=false;
|
||||
bool loadVars=true;
|
||||
bool shutDisplayOnExit=false;
|
||||
Atom windowType;
|
||||
Atom windowType=0;
|
||||
bool decorated=true;
|
||||
int level=NORMAL;
|
||||
Display *display=NULL;
|
||||
|
@ -812,19 +812,60 @@ unsigned long LFSTK_lib::LFSTK_getColourFromName(Display *display,Colormap cm,co
|
||||
* \param int width.
|
||||
* \param int height.
|
||||
*/
|
||||
#if 1
|
||||
void LFSTK_lib::LFSTK_setCairoSurface(Display *display,Window window,Visual *visual,cairo_surface_t **sfc,cairo_t **cr,int width,int height)
|
||||
{
|
||||
if((height<1) || (width<1))
|
||||
return;
|
||||
|
||||
if((sfc!=NULL) && (*sfc!=NULL))
|
||||
cairo_surface_destroy(*sfc);
|
||||
|
||||
*sfc=cairo_xlib_surface_create(display,window,visual,width,height);
|
||||
|
||||
if((cr!=NULL) && (*cr!=NULL))
|
||||
cairo_destroy (*cr);
|
||||
|
||||
*cr=cairo_create(*sfc);
|
||||
}
|
||||
#else
|
||||
void LFSTK_lib::LFSTK_setCairoSurface(Display *display,Window window,Visual *visual,cairo_surface_t **sfc,cairo_t **cr,int width,int height)
|
||||
{
|
||||
if((height<1) || (width<1))
|
||||
return;
|
||||
fprintf(stderr,"srfc=%p\n",*sfc);
|
||||
//if(*sfc!=NULL)
|
||||
// fprintf(stderr,"cw=%i ch=%i\n",cairo_xlib_surface_get_width (*sfc),cairo_xlib_surface_get_height (*sfc));
|
||||
|
||||
if((sfc!=NULL) && (*sfc!=NULL))
|
||||
{
|
||||
fprintf(stderr,"00000\n");
|
||||
cairo_surface_destroy (*sfc);
|
||||
|
||||
|
||||
//sfc=cairo_xlib_surface_create(display,window,visual,width,height);
|
||||
*sfc=NULL;
|
||||
}
|
||||
|
||||
if(*sfc==NULL)
|
||||
//{
|
||||
*sfc=cairo_xlib_surface_create(display,window,visual,width,height);
|
||||
// }
|
||||
else
|
||||
cairo_xlib_surface_set_size(*sfc,width,height);
|
||||
|
||||
if(*cr==NULL)
|
||||
//fprintf(stderr,"cw=%i ch=%i\n",cairo_xlib_surface_get_width (*sfc),cairo_xlib_surface_get_height (*sfc));
|
||||
|
||||
if((cr!=NULL) && (*cr!=NULL))
|
||||
{
|
||||
cairo_destroy (*cr);
|
||||
*cr=NULL;
|
||||
}
|
||||
//else
|
||||
if(*cr==NULL)
|
||||
*cr=cairo_create(*sfc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get mime type of file.
|
||||
|
Reference in New Issue
Block a user