From 6fcc661ff72af5a957a1a8d2737d2327dba8841e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 31 Mar 2020 22:41:41 +0900 Subject: 1) fixed bug when invoking tdedocker with options, which were not passed to an existing instance 2) code restructure for tray label object 3) dockWhenLostFocus option is now saved/restored correctly 4) fixed issues with popup menu actions status Signed-off-by: Michele Calgaro --- src/traylabelmgr.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/traylabelmgr.cpp') diff --git a/src/traylabelmgr.cpp b/src/traylabelmgr.cpp index 54e8fbd..54b98bd 100644 --- a/src/traylabelmgr.cpp +++ b/src/traylabelmgr.cpp @@ -327,9 +327,7 @@ bool TrayLabelMgr::processCommand(int argc, char** argv) } // while (getopt) // Launch an application if present in command line. else request from user - CustomTrayLabel *t = (CustomTrayLabel *) // this should be dynamic_cast - ((optind < argc) ? dockApplication(&argv[optind]) - : selectAndDock(w, check_normality)); + TQTrayLabel *t = (optind < argc) ? dockApplication(&argv[optind]) : selectAndDock(w, check_normality); if (t == NULL) return false; // apply settings and add to tray manageTrayLabel(t); @@ -338,7 +336,7 @@ bool TrayLabelMgr::processCommand(int argc, char** argv) t->setBalloonTimeout(balloon_timeout); t->setDockWhenObscured(dock_obscure); if (withdraw) t->withdraw(); else t->map(); - t->enableSessionManagement(enable_sm); + t->setSessionManagement(enable_sm); t->dock(); return true; } @@ -379,7 +377,10 @@ TQTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality) } } - if (!isWindowDocked(w)) return new CustomTrayLabel(w); + if (!isWindowDocked(w)) + { + return new TQTrayLabel(w); + } TRACE("0x%x is alredy docked", (unsigned) w); @@ -438,10 +439,14 @@ TQTrayLabel *TrayLabelMgr::dockApplication(char *argv[]) } TQStringList cmd_line; - for(int i=0;;i++) - if (argv[i]) cmd_line << argv[i]; else break; + int i = 0; + while (argv[i]) + { + cmd_line.append(argv[i]); + ++i; + } - TQTrayLabel *label = new CustomTrayLabel(cmd_line, pid); + TQTrayLabel *label = new TQTrayLabel(cmd_line, pid); TDEApplication::kApplication()->syncX(); write(filedes[1], buf, sizeof(buf)); close(filedes[0]); @@ -537,7 +542,7 @@ void TrayLabelMgr::doRestoreSession() if (!pname.isEmpty()) { TRACE("Restoring Application[%s]", pname.ascii()); - manageTrayLabel(new CustomTrayLabel(TQStringList::split(" ", pname), 0)); + manageTrayLabel(new TQTrayLabel(TQStringList::split(" ", pname), 0)); mTrayLabels.getFirst()->restoreState(config); } } -- cgit v1.2.1