From 141fcb48c669b8a007a47f7972a85652c8ea7c18 Mon Sep 17 00:00:00 2001 From: K D Hedger Date: Tue, 6 Sep 2022 20:41:51 +0100 Subject: [PATCH] fixed spaces in filenames for lfsdesktop, minor bug fixes etc ... --- .../LFSApplications/src/lfsbackdropprefs.cpp | 8 ++++---- LFSDesktop/LFSDesktop/src/main.cpp | 2 +- LFSSetWallpaper/LFSSetWallpaper/src/main.cpp | 10 ++++++---- LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp | 2 ++ LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp | 6 ++++-- LFSToolKit/examples/RunExamples.cpp | 2 +- LFSWManager/LFSWManager/src/atoms.cpp | 1 + buildall | 2 +- 8 files changed, 20 insertions(+), 13 deletions(-) diff --git a/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp b/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp index adb9069..f3ec459 100644 --- a/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp +++ b/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp @@ -283,7 +283,7 @@ int main(int argc, char **argv) }; prefs.LFSTK_loadVarsFromFile(mainPrefs); - prefs.LFSTK_saveVarsToFile("-"); + //prefs.LFSTK_saveVarsToFile("-"); copyrite=new LFSTK_labelClass(wc,COPYRITE,0,sy,DIALOGWIDTH,GADGETHITE); sy+=HALFYSPACING; @@ -398,9 +398,9 @@ int main(int argc, char **argv) fprintf(stderr,"Can't create message queue :( ...\n"); free(buffer); - bool flag=false; - int retcode; - int receiveType=IPC_NOWAIT; + bool flag=false; + int retcode; + int receiveType=IPC_NOWAIT; msgBuffer mbuffer; while(flag==false) diff --git a/LFSDesktop/LFSDesktop/src/main.cpp b/LFSDesktop/LFSDesktop/src/main.cpp index 9b5760b..f029ca7 100644 --- a/LFSDesktop/LFSDesktop/src/main.cpp +++ b/LFSDesktop/LFSDesktop/src/main.cpp @@ -63,7 +63,7 @@ void readMsg(void) retcode=msgrcv(queueID,&buffer,MAX_MSG_SIZE,DESKTOP_MSG,IPC_NOWAIT); if(retcode>0) { - if(strcmp(buffer.mText,"reloadbg")==0) + if(strcmp(buffer.mText,"reloaddesk")==0) { wc->LFSTK_setWindowPixmap(apc->globalLib->LFSTK_getWindowPixmap(apc->display,apc->rootWindow),apc->displayWidth,apc->displayHeight,true); wc->LFSTK_clearWindow(true); diff --git a/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp b/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp index 8c008df..a08403b 100644 --- a/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp +++ b/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp @@ -49,7 +49,7 @@ struct monitors char *monitorPath; }; -const char *wallpaperPath=NULL; +char *wallpaperPath=NULL; Imlib_Image buffer; @@ -275,7 +275,7 @@ void loadPrefs(void) }; prefs.LFSTK_loadVarsFromFile(prefsPath); - wallpaperPath=prefs.LFSTK_getCString("backdrop"); + wallpaperPath=strdup(prefs.LFSTK_getCString("backdrop")); backdropMode=prefs.LFSTK_getInt("mainmode"); mainColour=prefs.LFSTK_getInt("colour"); multiMode=prefs.LFSTK_getBool("multimode"); @@ -334,7 +334,8 @@ int main(int argc,char **argv) } free(p); } - loadPrefs(); + + loadPrefs(); currentMonitor=-1; loadMonitorData(); @@ -349,7 +350,7 @@ int main(int argc,char **argv) { case 'w': if(currentMonitor==-1) - wallpaperPath=optarg; + wallpaperPath=strdup(optarg); else monitorData[currentMonitor].monitorPath=strdup(optarg); break; @@ -403,6 +404,7 @@ int main(int argc,char **argv) XFlush(display); free(monitorRCPath); free(prefsPath); + free(wallpaperPath); fflush(NULL); return(0); diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp index 4243a44..57f627a 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp @@ -79,6 +79,8 @@ void LFSTK_menuClass::LFSTK_showMenu(void) unsigned int buttonmask; this->mainMenuWindow->LFSTK_showWindow(true); + this->mainMenuWindow->LFSTK_setKeepAbove(true); + this->mainLoop=true; XTranslateCoordinates(this->parentwc->app->display,this->parentwc->window,this->parentwc->app->rootWindow,this->x,this->y,&x,&y,&dw); diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp index 8ca2055..d56f4d0 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp @@ -438,7 +438,8 @@ void LFSTK_windowClass::LFSTK_setDecorated(bool isDecorated) hints.inputMode=0; hints.status=0; xa_prop[9]=XInternAtom(this->app->display,"_MOTIF_WM_HINTS",True); - XChangeProperty(this->app->display,this->window,xa_prop[9],xa_prop[9],32,PropModeReplace,(unsigned char *)&hints,5); + if(xa_prop[9]!=None) + XChangeProperty(this->app->display,this->window,xa_prop[9],xa_prop[9],32,PropModeReplace,(unsigned char *)&hints,5); } } @@ -555,7 +556,8 @@ void LFSTK_windowClass::LFSTK_setKeepAbove(bool set) xclient.data.l[0] =_NET_WM_STATE_REMOVE; xclient.data.l[1] =xa1; xclient.data.l[2]=0; - XSendEvent(this->app->display,this->app->rootWindow,False,SubstructureRedirectMask | SubstructureNotifyMask,(XEvent *)&xclient); +// XSendEvent(this->app->display,this->app->rootWindow,False,SubstructureRedirectMask | SubstructureNotifyMask,(XEvent *)&xclient); + XSendEvent(this->app->display,this->window,False,SubstructureRedirectMask | SubstructureNotifyMask,(XEvent *)&xclient); } /** diff --git a/LFSToolKit/examples/RunExamples.cpp b/LFSToolKit/examples/RunExamples.cpp index 23e7782..19d16ba 100755 --- a/LFSToolKit/examples/RunExamples.cpp +++ b/LFSToolKit/examples/RunExamples.cpp @@ -57,7 +57,7 @@ bool buttonCB(void *p,void* ud) free(command); if(openFile->LFSTK_getValue()==true) { - asprintf(&command,"xdg-open %s &",(const char*)ud); + asprintf(&command,"xdg-open $(pwd)/%s &",(const char*)ud); system(command); free(command); } diff --git a/LFSWManager/LFSWManager/src/atoms.cpp b/LFSWManager/LFSWManager/src/atoms.cpp index d2fc0d2..2ff4707 100644 --- a/LFSWManager/LFSWManager/src/atoms.cpp +++ b/LFSWManager/LFSWManager/src/atoms.cpp @@ -64,6 +64,7 @@ Atom NET_WM_WINDOW_TYPE; Atom NET_WM_WINDOW_TYPE_DOCK; Atom NET_WORKAREA; Atom NET_WM_WINDOW_TYPE_DESKTOP; +Atom NET_WM_WINDOW_TYPE_NORMAL; Atom NET_WM_STATE_STICKY; Atom NET_WM_ACTION_MAXIMIZE_HORZ; Atom NET_WM_ACTION_MAXIMIZE_VERT; diff --git a/buildall b/buildall index bc54acf..6d7dffe 100755 --- a/buildall +++ b/buildall @@ -25,7 +25,7 @@ LDCONFIG="/sbin/ldconfig" for arg in LFSToolKit LFSSetWallpaper LFSDesktop LFSWManager LFSPanel LFSApplications do - tar -xvf ${arg}-*.tar.gz +# tar -xvf ${arg}-*.tar.gz pushd ${arg} ./configure --prefix=${PREFIX}||./autogen.sh --prefix=${PREFIX}||(echo "Configure Error...";exit 1) make