aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 94e4250..24e0607 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -759,6 +759,7 @@ void BScreen::reconfigure() {
759 m_root_theme->screenNum()); 759 m_root_theme->screenNum());
760 760
761 reconfigureTabs(); 761 reconfigureTabs();
762 reconfigureStruts();
762} 763}
763 764
764void BScreen::reconfigureTabs() { 765void BScreen::reconfigureTabs() {
@@ -770,6 +771,42 @@ void BScreen::reconfigureTabs() {
770 (*it)->fbwindow()->applyDecorations(); 771 (*it)->fbwindow()->applyDecorations();
771} 772}
772 773
774static void parseStruts(const std::string &s, int &l, int &r, int &t, int &b) {
775 std::list<std::string> v;
776 FbTk::StringUtil::stringtok(v, s, " ,");
777 std::list<std::string>::iterator it = v.begin();
778 if (it != v.end()) l = std::max(0, atoi(it->c_str()));
779 if (++it != v.end()) r = std::max(0, atoi(it->c_str()));
780 if (++it != v.end()) t = std::max(0, atoi(it->c_str()));
781 if (++it != v.end()) b = std::max(0, atoi(it->c_str()));
782}
783
784void BScreen::reconfigureStruts() {
785 for (std::vector<Strut*>::iterator it = m_head_struts.begin(),
786 end = m_head_struts.end(); it != end; ++it) {
787 clearStrut(*it);
788 }
789
790 m_head_struts.clear();
791
792 int gl = 0, gr = 0, gt = 0, gb = 0;
793 parseStruts(FbTk::Resource<std::string>(resourceManager(), "",
794 name() + ".struts",
795 altName() + ".Struts"), gl, gr, gt, gb);
796 const int nh = std::max(1, numHeads());
797 for (int i = 1; i <= nh; ++i) {
798 int l = gl, r = gr, t = gt, b = gb;
799 char ai[16];
800 sprintf(ai, "%d", i);
801 parseStruts(FbTk::Resource<std::string>(resourceManager(), "",
802 name() + ".struts." + ai,
803 altName() + ".Struts." + ai), l, r, t, b);
804 if (l+t+r+b)
805 m_head_struts.push_back(requestStrut(i, l, r, t, b));
806 }
807 updateAvailableWorkspaceArea();
808}
809
773void BScreen::updateWorkspaceName(unsigned int w) { 810void BScreen::updateWorkspaceName(unsigned int w) {
774 Workspace *space = getWorkspace(w); 811 Workspace *space = getWorkspace(w);
775 if (space) { 812 if (space) {
@@ -1621,6 +1658,8 @@ void BScreen::initXinerama() {
1621#else // XINERAMA 1658#else // XINERAMA
1622 m_xinerama.avail = false; 1659 m_xinerama.avail = false;
1623#endif // XINERAMA 1660#endif // XINERAMA
1661
1662 reconfigureStruts();
1624} 1663}
1625 1664
1626/* Move windows out of inactive heads */ 1665/* Move windows out of inactive heads */