aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ButtonTheme.hh2
-rw-r--r--src/ColSmartPlacement.cc2
-rw-r--r--src/CommandDialog.cc2
-rw-r--r--src/CommandDialog.hh2
-rw-r--r--src/FbTk/FbString.cc14
-rw-r--r--src/FbTk/Layer.hh2
-rw-r--r--src/FbTk/MenuSearch.cc37
-rw-r--r--src/FbTk/MenuSearch.hh5
-rw-r--r--src/FbTk/StringUtil.hh4
-rw-r--r--src/FbTk/TextBox.hh2
-rw-r--r--src/FocusableList.cc4
-rw-r--r--src/MinOverlapPlacement.cc3
-rw-r--r--src/RowSmartPlacement.cc1
-rw-r--r--src/Toolbar.cc40
-rw-r--r--src/tests/menutest.cc2
15 files changed, 70 insertions, 52 deletions
diff --git a/src/ButtonTheme.hh b/src/ButtonTheme.hh
index a293b71..50358fa 100644
--- a/src/ButtonTheme.hh
+++ b/src/ButtonTheme.hh
@@ -41,7 +41,7 @@ public:
41 const FbTk::Texture &pressed() const { return *m_pressed_texture; } 41 const FbTk::Texture &pressed() const { return *m_pressed_texture; }
42 GC gc() const { return m_gc.gc(); } 42 GC gc() const { return m_gc.gc(); }
43 int scale() const { return *m_scale; } // scale factor for inside objects 43 int scale() const { return *m_scale; } // scale factor for inside objects
44 const std::string &name() { return m_name; } 44 const std::string &name() const { return m_name; }
45 45
46 virtual FbTk::Signal<> &reconfigSig() { return FbTk::Theme::reconfigSig(); } 46 virtual FbTk::Signal<> &reconfigSig() { return FbTk::Theme::reconfigSig(); }
47 47
diff --git a/src/ColSmartPlacement.cc b/src/ColSmartPlacement.cc
index b0bcf68..66f3a02 100644
--- a/src/ColSmartPlacement.cc
+++ b/src/ColSmartPlacement.cc
@@ -99,6 +99,8 @@ bool ColSmartPlacement::placeWindow(const FluxboxWindow &win, int head,
99 std::list<FluxboxWindow *>::const_iterator it_end = windowlist.end(); 99 std::list<FluxboxWindow *>::const_iterator it_end = windowlist.end();
100 for (; it != it_end && placed; ++it) { 100 for (; it != it_end && placed; ++it) {
101 if (*it == &win) continue; 101 if (*it == &win) continue;
102 if ((*it)->layerNum() != win.layerNum() ){ continue; } //windows are in different layers - skip it
103
102 int bw = 2 * (*it)->fbWindow().borderWidth(); 104 int bw = 2 * (*it)->fbWindow().borderWidth();
103 int curr_x = (*it)->x() - (*it)->xOffset(); 105 int curr_x = (*it)->x() - (*it)->xOffset();
104 int curr_y = (*it)->y() - (*it)->yOffset(); 106 int curr_y = (*it)->y() - (*it)->yOffset();
diff --git a/src/CommandDialog.cc b/src/CommandDialog.cc
index 023c22f..e777390 100644
--- a/src/CommandDialog.cc
+++ b/src/CommandDialog.cc
@@ -40,7 +40,7 @@ using std::less;
40using std::out_of_range; 40using std::out_of_range;
41 41
42CommandDialog::CommandDialog(BScreen &screen, const string &title, 42CommandDialog::CommandDialog(BScreen &screen, const string &title,
43 const string precommand) : 43 const string &precommand) :
44 TextDialog(screen, title), 44 TextDialog(screen, title),
45 m_precommand(precommand) { } 45 m_precommand(precommand) { }
46 46
diff --git a/src/CommandDialog.hh b/src/CommandDialog.hh
index 0e12ce3..a976bc4 100644
--- a/src/CommandDialog.hh
+++ b/src/CommandDialog.hh
@@ -35,7 +35,7 @@ class Command;
35class CommandDialog: public TextDialog { 35class CommandDialog: public TextDialog {
36public: 36public:
37 CommandDialog(BScreen &screen, const std::string &title, 37 CommandDialog(BScreen &screen, const std::string &title,
38 const std::string pre_command = ""); 38 const std::string &pre_command = "");
39 39
40 /** 40 /**
41 * Sets the command to be executed after the command is done. 41 * Sets the command to be executed after the command is done.
diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc
index 2bc7516..9c7fca7 100644
--- a/src/FbTk/FbString.cc
+++ b/src/FbTk/FbString.cc
@@ -168,6 +168,10 @@ void init() {
168 s_inited = true; 168 s_inited = true;
169 setlocale(LC_CTYPE, ""); 169 setlocale(LC_CTYPE, "");
170 170
171 for (int i = 0; i < CONVSIZE; i++) {
172 s_iconv_convs[i] = ICONV_NULL;
173 }
174
171#ifdef HAVE_ICONV 175#ifdef HAVE_ICONV
172#if defined(CODESET) && !defined(_WIN32) 176#if defined(CODESET) && !defined(_WIN32)
173 s_locale_codeset = nl_langinfo(CODESET); 177 s_locale_codeset = nl_langinfo(CODESET);
@@ -186,8 +190,6 @@ void init() {
186 s_iconv_convs[X2FB] = iconv_open("UTF-8", "ISO8859-1"); 190 s_iconv_convs[X2FB] = iconv_open("UTF-8", "ISO8859-1");
187 s_iconv_convs[FB2LOCALE] = iconv_open(s_locale_codeset.c_str(), "UTF-8"); 191 s_iconv_convs[FB2LOCALE] = iconv_open(s_locale_codeset.c_str(), "UTF-8");
188 s_iconv_convs[LOCALE2FB] = iconv_open("UTF-8", s_locale_codeset.c_str()); 192 s_iconv_convs[LOCALE2FB] = iconv_open("UTF-8", s_locale_codeset.c_str());
189#else
190 memset(s_iconv_convs, 0, sizeof(s_iconv_convs));
191#endif // HAVE_ICONV 193#endif // HAVE_ICONV
192 194
193} 195}
@@ -195,11 +197,13 @@ void init() {
195void shutdown() { 197void shutdown() {
196#ifdef HAVE_ICONV 198#ifdef HAVE_ICONV
197 int i; 199 int i;
198 for (i = 0; i < CONVSIZE; ++i) 200 for (i = 0; i < CONVSIZE; ++i) {
199 if (s_iconv_convs[i] != ICONV_NULL) 201 if (s_iconv_convs[i] != ICONV_NULL) {
200 iconv_close(s_iconv_convs[i]); 202 iconv_close(s_iconv_convs[i]);
203 s_iconv_convs[i] = ICONV_NULL;
204 }
205 }
201 206
202 memset(s_iconv_convs, 0, sizeof(s_iconv_convs));
203 s_inited = false; 207 s_inited = false;
204#endif // HAVE_ICONV 208#endif // HAVE_ICONV
205} 209}
diff --git a/src/FbTk/Layer.hh b/src/FbTk/Layer.hh
index 536ce00..ed28ec6 100644
--- a/src/FbTk/Layer.hh
+++ b/src/FbTk/Layer.hh
@@ -43,7 +43,7 @@ public:
43 //typedef std::list<LayerItem *>::reverse_iterator reverse_iterator; 43 //typedef std::list<LayerItem *>::reverse_iterator reverse_iterator;
44 44
45 void setLayerNum(int layernum) { m_layernum = layernum; }; 45 void setLayerNum(int layernum) { m_layernum = layernum; };
46 int getLayerNum() { return m_layernum; }; 46 int getLayerNum() const { return m_layernum; };
47 // Put all items on the same layer (called when layer item added to) 47 // Put all items on the same layer (called when layer item added to)
48 void alignItem(LayerItem &item); 48 void alignItem(LayerItem &item);
49 int countWindows(); 49 int countWindows();
diff --git a/src/FbTk/MenuSearch.cc b/src/FbTk/MenuSearch.cc
index d87bfaf..689323c 100644
--- a/src/FbTk/MenuSearch.cc
+++ b/src/FbTk/MenuSearch.cc
@@ -19,7 +19,7 @@ size_t search_str_textstart(const std::string& text, const std::string& pattern)
19 19
20 size_t i; 20 size_t i;
21 for (i = l; i > 0; i--) { 21 for (i = l; i > 0; i--) {
22 if (std::tolower(text[i-1]) != std::tolower(pattern[i-1])) { 22 if (std::tolower(text[i-1]) != pattern[i-1]) {
23 return std::string::npos; 23 return std::string::npos;
24 } 24 }
25 } 25 }
@@ -40,12 +40,13 @@ size_t search_str_bmh(const std::string& text, const std::string& pattern) {
40 return std::string::npos; 40 return std::string::npos;
41 } 41 }
42 42
43 size_t t; 43 const size_t tlen = text.size();
44 size_t tlen = text.size(); 44 const size_t plen = pattern.size();
45 size_t t; // index in text
45 46
46 // simple case, no need to be too clever 47 // simple case, no need to be too clever
47 if (pattern.size() == 1) { 48 if (plen == 1) {
48 int b = std::tolower(pattern[0]); 49 int b = pattern[0];
49 for (t = 0; t < tlen; t++) { 50 for (t = 0; t < tlen; t++) {
50 if (b == std::tolower(text[t])) { 51 if (b == std::tolower(text[t])) {
51 return t; 52 return t;
@@ -54,28 +55,28 @@ size_t search_str_bmh(const std::string& text, const std::string& pattern) {
54 return std::string::npos; 55 return std::string::npos;
55 } 56 }
56 57
57
58 size_t plast = pattern.size() - 1;
59 size_t p;
60
61 // prepare skip-table 58 // prepare skip-table
62 // 59 //
63 size_t skip[256]; 60 size_t skip[256];
61 const size_t pe = plen - 1; // end index in pattern
62 size_t p; // index in pattern
63
64 for (p = 0; p < sizeof(skip)/sizeof(skip[0]); p++) { 64 for (p = 0; p < sizeof(skip)/sizeof(skip[0]); p++) {
65 skip[p] = plast + 1; 65 skip[p] = plen;
66 } 66 }
67 for (p = 0; p < plast; p++) { 67 for (p = 0; p < pe; p++) {
68 skip[std::tolower(pattern[p])] = plast - p; 68 skip[pattern[p]] = pe - p;
69 } 69 }
70 70
71 // match 71 // match
72 for (t = 0; t + plast < tlen; ) { 72 //
73 for (p = plast; std::tolower(text[t+p]) == std::tolower(pattern[p]); p--) { 73 for (t = 0; (t+pe) < tlen; ) {
74 for (p = pe; std::tolower(text[t+p]) == pattern[p]; p--) {
74 if (p == 0) { 75 if (p == 0) {
75 return t+p; 76 return t;
76 } 77 }
77 } 78 }
78 t += skip[std::tolower(text[t+p])]; 79 t += skip[std::tolower(text[t+pe])];
79 } 80 }
80 81
81 return std::string::npos; 82 return std::string::npos;
@@ -117,7 +118,7 @@ void MenuSearch::clear() {
117} 118}
118 119
119void MenuSearch::add(char c) { 120void MenuSearch::add(char c) {
120 pattern.push_back(c); 121 pattern.push_back(std::tolower(c));
121} 122}
122 123
123void MenuSearch::backspace() { 124void MenuSearch::backspace() {
diff --git a/src/FbTk/MenuSearch.hh b/src/FbTk/MenuSearch.hh
index d642929..e06b39b 100644
--- a/src/FbTk/MenuSearch.hh
+++ b/src/FbTk/MenuSearch.hh
@@ -13,9 +13,10 @@ class MenuItem;
13// a small helper which applies search operations on a list of MenuItems*. 13// a small helper which applies search operations on a list of MenuItems*.
14// the former incarnation of this class was FbTk::TypeAhead in combination with 14// the former incarnation of this class was FbTk::TypeAhead in combination with
15// the now non-existent FbTk::SearchResults, but the complexity of these 15// the now non-existent FbTk::SearchResults, but the complexity of these
16// are not needed for our use case. as a bonus we have less lose parts 16// are not needed for our use case. as a bonus, we have less lose parts
17// flying around. 17// flying around.
18 18//
19// MenuSearch is case insensitive.
19class MenuSearch { 20class MenuSearch {
20public: 21public:
21 22
diff --git a/src/FbTk/StringUtil.hh b/src/FbTk/StringUtil.hh
index b3908d8..2f7c6fc 100644
--- a/src/FbTk/StringUtil.hh
+++ b/src/FbTk/StringUtil.hh
@@ -98,10 +98,10 @@ static void stringTokensBetween(Container &container, const std::string &in,
98 const char *ok_chars = " \t\n", bool allow_nesting = true) { 98 const char *ok_chars = " \t\n", bool allow_nesting = true) {
99 99
100 std::string token; 100 std::string token;
101 int err = 0, pos = 0; 101 int pos = 0;
102 102
103 while (true) { 103 while (true) {
104 err = getStringBetween(token, in.c_str() + pos, first, last, ok_chars, 104 int err = getStringBetween(token, in.c_str() + pos, first, last, ok_chars,
105 allow_nesting); 105 allow_nesting);
106 if (err <= 0) 106 if (err <= 0)
107 break; 107 break;
diff --git a/src/FbTk/TextBox.hh b/src/FbTk/TextBox.hh
index 7b42bd1..40a7c3c 100644
--- a/src/FbTk/TextBox.hh
+++ b/src/FbTk/TextBox.hh
@@ -63,7 +63,7 @@ public:
63 const Font &font() const { return *m_font; } 63 const Font &font() const { return *m_font; }
64 GC gc() const { return m_gc; } 64 GC gc() const { return m_gc; }
65 int cursorPosition() const { return m_cursor_pos; } 65 int cursorPosition() const { return m_cursor_pos; }
66 int textStartPos(){ return m_start_pos; } 66 int textStartPos() const { return m_start_pos; }
67 67
68 unsigned int findEmptySpaceLeft(); 68 unsigned int findEmptySpaceLeft();
69 unsigned int findEmptySpaceRight(); 69 unsigned int findEmptySpaceRight();
diff --git a/src/FocusableList.cc b/src/FocusableList.cc
index 0850943..3689283 100644
--- a/src/FocusableList.cc
+++ b/src/FocusableList.cc
@@ -164,7 +164,7 @@ void FocusableList::checkUpdate(Focusable &win) {
164 164
165// returns whether or not the window was moved 165// returns whether or not the window was moved
166bool FocusableList::insertFromParent(Focusable &win) { 166bool FocusableList::insertFromParent(Focusable &win) {
167 const Focusables list = m_parent->clientList(); 167 const Focusables &list = m_parent->clientList();
168 Focusables::const_iterator p_it = list.begin(), p_it_end = list.end(); 168 Focusables::const_iterator p_it = list.begin(), p_it_end = list.end();
169 Focusables::iterator our_it = m_list.begin(), our_it_end = m_list.end(); 169 Focusables::iterator our_it = m_list.begin(), our_it_end = m_list.end();
170 // walk through our list looking for corresponding entries in 170 // walk through our list looking for corresponding entries in
@@ -189,7 +189,7 @@ void FocusableList::addMatching() {
189 if (!m_parent) 189 if (!m_parent)
190 return; 190 return;
191 191
192 const Focusables list = m_parent->clientList(); 192 const Focusables &list = m_parent->clientList();
193 Focusables::const_iterator it = list.begin(), it_end = list.end(); 193 Focusables::const_iterator it = list.begin(), it_end = list.end();
194 for (; it != it_end; ++it) { 194 for (; it != it_end; ++it) {
195 if (m_pat->match(**it)) { 195 if (m_pat->match(**it)) {
diff --git a/src/MinOverlapPlacement.cc b/src/MinOverlapPlacement.cc
index 78cadb4..b715f70 100644
--- a/src/MinOverlapPlacement.cc
+++ b/src/MinOverlapPlacement.cc
@@ -144,7 +144,8 @@ bool MinOverlapPlacement::placeWindow(const FluxboxWindow &win, int head,
144 it_end = const_windowlist.rend(); 144 it_end = const_windowlist.rend();
145 for (; it != it_end; ++it) { 145 for (; it != it_end; ++it) {
146 if (*it == &win) continue; 146 if (*it == &win) continue;
147 147 if ((*it)->layerNum() != win.layerNum() ){ continue; } //windows are in different layers - skip it
148
148 getWindowDimensions(*(*it), left, top, right, bottom); 149 getWindowDimensions(*(*it), left, top, right, bottom);
149 150
150 // go through the list of regions 151 // go through the list of regions
diff --git a/src/RowSmartPlacement.cc b/src/RowSmartPlacement.cc
index eca867f..95a8257 100644
--- a/src/RowSmartPlacement.cc
+++ b/src/RowSmartPlacement.cc
@@ -115,6 +115,7 @@ bool RowSmartPlacement::placeWindow(const FluxboxWindow &win, int head,
115 for (; win_it != win_it_end && placed; ++win_it) { 115 for (; win_it != win_it_end && placed; ++win_it) {
116 FluxboxWindow &window = **win_it; 116 FluxboxWindow &window = **win_it;
117 if (&window == &win) continue; 117 if (&window == &win) continue;
118 if (window.layerNum() != win.layerNum() ){ continue; } //windows are in different layers - skip it
118 119
119 int curr_x = window.x() - window.xOffset(); // minus offset to get back up to fake place 120 int curr_x = window.x() - window.xOffset(); // minus offset to get back up to fake place
120 int curr_y = window.y() - window.yOffset(); 121 int curr_y = window.y() - window.yOffset();
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 933c217..b607f21 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -80,18 +80,18 @@ const struct {
80 unsigned int shape; 80 unsigned int shape;
81} _values[] = { 81} _values[] = {
82 { /* unused */ }, 82 { /* unused */ },
83 { Toolbar::TOPLEFT, "TopLeft", FbTk::ROT0, FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT}, 83 { Toolbar::TOPLEFT, "TopLeft", FbTk::ROT0, FbTk::Shape::BOTTOMRIGHT },
84 { Toolbar::TOPCENTER, "TopCenter", FbTk::ROT0, FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT}, 84 { Toolbar::TOPCENTER, "TopCenter", FbTk::ROT0, FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT },
85 { Toolbar::TOPRIGHT, "TopRight", FbTk::ROT0, FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT}, 85 { Toolbar::TOPRIGHT, "TopRight", FbTk::ROT0, FbTk::Shape::BOTTOMLEFT },
86 { Toolbar::BOTTOMLEFT, "BottomLeft", FbTk::ROT0, FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT}, 86 { Toolbar::BOTTOMLEFT, "BottomLeft", FbTk::ROT0, FbTk::Shape::TOPRIGHT },
87 { Toolbar::BOTTOMCENTER, "BottomCenter", FbTk::ROT0, FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT}, 87 { Toolbar::BOTTOMCENTER, "BottomCenter", FbTk::ROT0, FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT },
88 { Toolbar::BOTTOMRIGHT, "BottomRight", FbTk::ROT0, FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT}, 88 { Toolbar::BOTTOMRIGHT, "BottomRight", FbTk::ROT0, FbTk::Shape::TOPLEFT },
89 { Toolbar::LEFTBOTTOM, "LeftBottom", FbTk::ROT270, FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT}, 89 { Toolbar::LEFTBOTTOM, "LeftBottom", FbTk::ROT270, FbTk::Shape::TOPRIGHT },
90 { Toolbar::LEFTCENTER, "LeftCenter", FbTk::ROT270, FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT}, 90 { Toolbar::LEFTCENTER, "LeftCenter", FbTk::ROT270, FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT },
91 { Toolbar::LEFTTOP, "LeftTop", FbTk::ROT270, FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT}, 91 { Toolbar::LEFTTOP, "LeftTop", FbTk::ROT270, FbTk::Shape::BOTTOMRIGHT },
92 { Toolbar::RIGHTBOTTOM, "RightBottom", FbTk::ROT90, FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT}, 92 { Toolbar::RIGHTBOTTOM, "RightBottom", FbTk::ROT90, FbTk::Shape::TOPLEFT },
93 { Toolbar::RIGHTCENTER, "RightCenter", FbTk::ROT90, FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT}, 93 { Toolbar::RIGHTCENTER, "RightCenter", FbTk::ROT90, FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT },
94 { Toolbar::RIGHTTOP, "RightTop", FbTk::ROT90, FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT}, 94 { Toolbar::RIGHTTOP, "RightTop", FbTk::ROT90, FbTk::Shape::BOTTOMLEFT },
95}; 95};
96 96
97} 97}
@@ -648,24 +648,29 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
648 break; 648 break;
649 case TOPCENTER: 649 case TOPCENTER:
650 frame.x += (head_w - static_cast<int>(frame.width))/2 - bw; 650 frame.x += (head_w - static_cast<int>(frame.width))/2 - bw;
651 frame.x_hidden = frame.x;
651 frame.y_hidden += pixel - bw - static_cast<int>(frame.height); 652 frame.y_hidden += pixel - bw - static_cast<int>(frame.height);
652 break; 653 break;
653 case TOPRIGHT: 654 case TOPRIGHT:
654 frame.x += head_w - static_cast<int>(frame.width) - bw*2; 655 frame.x += head_w - static_cast<int>(frame.width) - bw*2;
656 frame.x_hidden = frame.x;
655 frame.y_hidden += pixel - bw - static_cast<int>(frame.height); 657 frame.y_hidden += pixel - bw - static_cast<int>(frame.height);
656 break; 658 break;
657 case BOTTOMRIGHT: 659 case BOTTOMRIGHT:
658 frame.x += head_w - static_cast<int>(frame.width) - bw*2; 660 frame.x += head_w - static_cast<int>(frame.width) - bw*2;
659 frame.y += head_h - static_cast<int>(frame.height) - bw*2; 661 frame.y += head_h - static_cast<int>(frame.height) - bw*2;
662 frame.x_hidden = frame.x;
660 frame.y_hidden += head_h - bw - pixel; 663 frame.y_hidden += head_h - bw - pixel;
661 break; 664 break;
662 case BOTTOMCENTER: // default is BOTTOMCENTER 665 case BOTTOMCENTER: // default is BOTTOMCENTER
663 frame.x += (head_w - static_cast<int>(frame.width))/2 - bw; 666 frame.x += (head_w - static_cast<int>(frame.width))/2 - bw;
664 frame.y += head_h - static_cast<int>(frame.height) - bw*2; 667 frame.y += head_h - static_cast<int>(frame.height) - bw*2;
668 frame.x_hidden = frame.x;
665 frame.y_hidden += head_h - bw - pixel; 669 frame.y_hidden += head_h - bw - pixel;
666 break; 670 break;
667 case LEFTCENTER: 671 case LEFTCENTER:
668 frame.y += (head_h - static_cast<int>(frame.height))/2 - bw; 672 frame.y += (head_h - static_cast<int>(frame.height))/2 - bw;
673 frame.y_hidden = frame.y;
669 frame.x_hidden += pixel - static_cast<int>(frame.width) - bw; 674 frame.x_hidden += pixel - static_cast<int>(frame.width) - bw;
670 break; 675 break;
671 case LEFTTOP: 676 case LEFTTOP:
@@ -673,21 +678,24 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
673 break; 678 break;
674 case LEFTBOTTOM: 679 case LEFTBOTTOM:
675 frame.y = head_h - static_cast<int>(frame.height) - bw*2; 680 frame.y = head_h - static_cast<int>(frame.height) - bw*2;
681 frame.y_hidden = frame.y;
676 frame.x_hidden += pixel - static_cast<int>(frame.width) - bw; 682 frame.x_hidden += pixel - static_cast<int>(frame.width) - bw;
677 break; 683 break;
678 case RIGHTCENTER: 684 case RIGHTCENTER:
679 frame.x += head_w - static_cast<int>(frame.width) - bw*2; 685 frame.x += head_w - static_cast<int>(frame.width) - bw*2;
680 frame.y += (head_h - static_cast<int>(frame.height))/2 * bw; 686 frame.y += (head_h - static_cast<int>(frame.height))/2 - bw;
681 frame.x_hidden += static_cast<int>(frame.width) + bw - pixel; 687 frame.x_hidden += head_w - bw - pixel;
688 frame.y_hidden = frame.y;
682 break; 689 break;
683 case RIGHTTOP: 690 case RIGHTTOP:
684 frame.x += head_w - static_cast<int>(frame.width) - bw*2; 691 frame.x += head_w - static_cast<int>(frame.width) - bw*2;
685 frame.x_hidden += static_cast<int>(frame.width) + bw - pixel; 692 frame.x_hidden += head_w - bw - pixel;
686 break; 693 break;
687 case RIGHTBOTTOM: 694 case RIGHTBOTTOM:
688 frame.x += head_w - static_cast<int>(frame.width) - bw*2; 695 frame.x += head_w - static_cast<int>(frame.width) - bw*2;
689 frame.y += head_h - static_cast<int>(frame.height) - bw*2; 696 frame.y += head_h - static_cast<int>(frame.height) - bw*2;
690 frame.x_hidden += static_cast<int>(frame.width) + bw - pixel; 697 frame.x_hidden += head_w - bw - pixel;
698 frame.y_hidden = frame.y;
691 break; 699 break;
692 } 700 }
693 701
diff --git a/src/tests/menutest.cc b/src/tests/menutest.cc
index 0008ff0..6a8bd43 100644
--- a/src/tests/menutest.cc
+++ b/src/tests/menutest.cc
@@ -44,7 +44,7 @@ using namespace std;
44void doSubmenu(Parser &parser, FbTk::Menu &menu, 44void doSubmenu(Parser &parser, FbTk::Menu &menu,
45 FbTk::MenuTheme &theme, 45 FbTk::MenuTheme &theme,
46 FbTk::ImageControl &image_ctrl, 46 FbTk::ImageControl &image_ctrl,
47 const std::string labelstr) { 47 const std::string &labelstr) {
48 48
49 Parser::Item key, label, cmd, icon; 49 Parser::Item key, label, cmd, icon;
50 50