diff --git a/LFSDock/LFSDock/app/lfsdock.local b/LFSDock/LFSDock/app/lfsdock.local index d761c7d..cc88043 100755 --- a/LFSDock/LFSDock/app/lfsdock.local +++ b/LFSDock/LFSDock/app/lfsdock.local @@ -9,4 +9,10 @@ if [[ $1 = "conf" ]];then popd fi -LD_LIBRARY_PATH="../../../LFSToolKit/LFSToolKit/app/.libs" ./lfsdock +if [[ $USEVALGRIND -eq 1 ]];then + VALGRIND="valgrind --leak-check=full" +else + VALGRIND= +fi + +LD_LIBRARY_PATH="../../../LFSToolKit/LFSToolKit/app/.libs" $VALGRIND ./lfsdock diff --git a/LFSDock/LFSDock/src/callbacks.cpp b/LFSDock/LFSDock/src/callbacks.cpp index 5b69a3d..1fd618d 100644 --- a/LFSDock/LFSDock/src/callbacks.cpp +++ b/LFSDock/LFSDock/src/callbacks.cpp @@ -131,6 +131,7 @@ bool contextCB(void *p,void* ud) launcherCB(NULL,lwc->popupFromGadget->userData); break; case BUTTONREMOVE: + sendNotify("Removing ",ll->entry.name); unlink(ll->desktopFilePath.c_str()); apc->exitValue=0; apc->mainLoop=false; diff --git a/LFSDock/LFSDock/src/main.cpp b/LFSDock/LFSDock/src/main.cpp index 3f2d2d4..e887e1a 100644 --- a/LFSDock/LFSDock/src/main.cpp +++ b/LFSDock/LFSDock/src/main.cpp @@ -146,7 +146,7 @@ int main(int argc,char **argv) int psize; int key=666; propReturn pr; - windowInitStruct *win=new windowInitStruct;; + windowInitStruct *win;//=new windowInitStruct;; std::string lc="#a0f0f0f0"; std::string pc="#60a0a0a0"; std::string ac="#60404040"; @@ -186,13 +186,8 @@ int main(int argc,char **argv) dockWindow->LFSTK_initDnD(true); dockWindow->LFSTK_setWindowDropCallBack(windowDrop,(void*)0xdeadbeef); - win->x=0; - win->y=0; - win->w=1; - win->h=1; - win->app=apc; + win=apc->LFSTK_getDefaultWInit(); win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); - win->wc=dockWindow; apc->LFSTK_addToolWindow(win); popActionWindow=apc->windows->back().window; @@ -289,7 +284,8 @@ int main(int argc,char **argv) dockWindow->LFSTK_showWindow(true); dockWindow->LFSTK_setKeepAbove(true); -updateTaskBar(true); + if(useTaskBar==true) + updateTaskBar(true); int retval=apc->LFSTK_runApp(); while(ll!=NULL) diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp index d9495ab..84a512e 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp @@ -182,33 +182,28 @@ windowInitStruct* LFSTK_applicationClass::LFSTK_getDefaultWInit(void) * \note name can be NULL, if window is set to 1px size and type to _NET_WM_WINDOW_TYPE_DOCK. * \note class take ownership of wi don't delete. */ -void LFSTK_applicationClass::LFSTK_addWindow(windowInitStruct *wi,const char *name)//TODO// +void LFSTK_applicationClass::LFSTK_addWindow(windowInitStruct *wi,const char *name) { windowInitStruct *win; if(wi==NULL) { win=this->LFSTK_getDefaultWInit(); - //win=new windowInitStruct; - //win->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); } else win=wi; - //win->app=this; if(name==NULL) { win->windowName=""; win->x=-1; win->y=-1; win->overRide=true; - //win->windowType="_NET_WM_WINDOW_TYPE_DOCK"; win->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")); win->decorated=false; } else win->windowName=name; -// win->loadVars=true; this->windows->push_back({new LFSTK_windowClass(win,this),false,false}); if(this->windows->size()==1) this->mainWindow=this->windows->back().window; @@ -229,31 +224,29 @@ void LFSTK_applicationClass::LFSTK_addToolWindow(windowInitStruct *wi) if(wi==NULL) { win=this->LFSTK_getDefaultWInit(); -// win=new windowInitStruct; -// win->app=this; - win->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")); + win->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); } else { win=wi; } - win->windowName="";//TODO// - win->loadVars=true; + //win->windowName=""; + //win->loadVars=true; //win->windowType="_NET_WM_WINDOW_TYPE_DOCK"; //win->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")); win->decorated=false; win->overRide=true; win->level=ABOVEALL; + this->windows->push_back({new LFSTK_toolWindowClass(win,this),false,false}); + //LFSTK_toolWindowClass *tw=new LFSTK_toolWindowClass(win,this); +// + //windowData wd; - LFSTK_toolWindowClass *tw=new LFSTK_toolWindowClass(win,this); - - windowData wd; - - wd.window=tw; - wd.loopFlag=false; - wd.showing=false; - this->windows->push_back(wd); + //wd.window=tw; + //wd.loopFlag=false; + //wd.showing=false; + //this->windows->push_back(wd); delete win; } diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.cpp index 0dd264c..2e87b29 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.cpp @@ -79,11 +79,7 @@ void LFSTK_toolWindowClass::windowClassInitCommon(windowInitStruct *wi) XChangeProperty(this->app->display,this->window,xa,XA_ATOM,32,PropModeAppend,(unsigned char *)&xa_prop,4); this->LFSTK_setWindowType(wi->windowType); -// if(wi->name!=NULL) -// this->windowName=strdup(wi->name); - this->windowName=wi->windowName; -// else -// this->windowName=strdup("LFSToolWindow"); + this->windowName=wi->windowName; XStoreName(this->app->display,this->window,this->windowName.c_str()); classHint.res_name=(char*)wi->appName.c_str(); classHint.res_class=(char*)wi->className.c_str(); @@ -115,17 +111,25 @@ void LFSTK_toolWindowClass::windowClassInitCommon(windowInitStruct *wi) this->gadgetMap.clear(); } +/** +* Window constructor. +* \param windowInitStruct *wi. +* \param LFSTK_applicationClass *app. +* \note Caller is resonsible for deleting wi. +*/ LFSTK_toolWindowClass::LFSTK_toolWindowClass(windowInitStruct *wi,LFSTK_applicationClass *app) { this->windowClassInitCommon(wi); this->gadgetMap.clear(); } -//LFSTK_toolWindowClass::LFSTK_toolWindowClass(Display *disp,LFSTK_windowClass *wc,const char *windowtype,int x,int y,int w,int h,const char* name,LFSTK_applicationClass *app) +/** +* Window constructor. +* \param ... +*/ LFSTK_toolWindowClass::LFSTK_toolWindowClass(Display *disp,LFSTK_windowClass *wc,Atom windowtype,int x,int y,int w,int h,const char* name,LFSTK_applicationClass *app) { - windowInitStruct *wi=app->LFSTK_getDefaultWInit();//TODO// - //new windowInitStruct;//TODO// + windowInitStruct *wi=app->LFSTK_getDefaultWInit(); wi->x=x; wi->y=y; wi->w=w; @@ -139,7 +143,6 @@ LFSTK_toolWindowClass::LFSTK_toolWindowClass(Display *disp,LFSTK_windowClass *wc wi->level=ABOVEALL; wi->display=disp; wi->wc=wc; - //wi->app=app; this->windowClassInitCommon(wi); this->gadgetMap.clear(); diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.h b/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.h index dcbb6cd..b9f3120 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.h +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKToolWindow.h @@ -36,7 +36,7 @@ class LFSTK_toolWindowClass : public LFSTK_windowClass protected: private: - void windowClassInitCommon(windowInitStruct *wi); + void windowClassInitCommon(windowInitStruct *wi); }; #endif diff --git a/LFSToolKit/examples/basic.cpp b/LFSToolKit/examples/basic.cpp index 50f6364..7d27b89 100755 --- a/LFSToolKit/examples/basic.cpp +++ b/LFSToolKit/examples/basic.cpp @@ -287,9 +287,7 @@ int main(int argc, char **argv) wc->LFSTK_resizeWindow(DIALOGWIDTH,sy,true); wc->LFSTK_setKeepAbove(true); - //wc->LFSTK_setWindowPixmap(apc->globalLib->LFSTK_getWindowPixmap(apc->display,apc->rootWindow),apc->displayWidth,apc->displayHeight); - //wc->LFSTK_showWindow(); printf("Number of gadgets in window=%i\n",wc->LFSTK_gadgetCount()); apc->LFSTK_setTimer(1000000,true); apc->LFSTK_setTimerCallBack(timerCB,NULL); @@ -302,7 +300,7 @@ int main(int argc, char **argv) popWindow->LFSTK_resizeWindow(poplabel->LFSTK_getTextRealWidth("This is a mouse enter callback"),GADGETHITE); popWindow->LFSTK_setWindowColourName(NORMALCOLOUR,"#c0808080"); - //popWindow->LFSTK_setTile(NULL,0); + int retval=apc->LFSTK_runApp(); delete apc;