diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-03-31 22:41:41 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-03-31 22:41:41 +0900 |
commit | 6fcc661ff72af5a957a1a8d2737d2327dba8841e (patch) | |
tree | 284b56632512e37875a8a19a5792551e147402d1 /src/traylabelmgr.cpp | |
parent | 05add324c22f8fb2d1824a8a6145b2b8821e95bb (diff) | |
download | tdedocker-6fcc661ff72af5a957a1a8d2737d2327dba8841e.tar.gz tdedocker-6fcc661ff72af5a957a1a8d2737d2327dba8841e.zip |
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 <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/traylabelmgr.cpp')
-rw-r--r-- | src/traylabelmgr.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
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); } } |