aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc50
1 files changed, 15 insertions, 35 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 438cfb4..f5aac4c 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.88 2002/10/13 21:54:36 fluxgen Exp $ 25// $Id: Window.cc,v 1.89 2002/10/15 17:17:00 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -1014,15 +1014,7 @@ void FluxboxWindow::reconfigure() {
1014 screen->getBorderWidth(); 1014 screen->getBorderWidth();
1015 1015
1016 if (getTitle().size() > 0) { 1016 if (getTitle().size() > 0) {
1017 if (I18n::instance()->multibyte()) { 1017 client.title_text_w = screen->getWindowStyle()->font.textWidth(getTitle().c_str(), getTitle().size());
1018 XRectangle ink, logical;
1019 XmbTextExtents(screen->getWindowStyle()->font.set,
1020 getTitle().c_str(), getTitle().size(), &ink, &logical);
1021 client.title_text_w = logical.width;
1022 } else {
1023 client.title_text_w = XTextWidth(screen->getWindowStyle()->font.fontstruct,
1024 getTitle().c_str(), getTitle().size());
1025 }
1026 1018
1027 client.title_text_w += (frame.bevel_w * 4); 1019 client.title_text_w += (frame.bevel_w * 4);
1028 } 1020 }
@@ -1121,17 +1113,8 @@ void FluxboxWindow::getWMName() {
1121 FBNLS::WindowSet, FBNLS::WindowUnnamed, 1113 FBNLS::WindowSet, FBNLS::WindowUnnamed,
1122 "Unnamed"); 1114 "Unnamed");
1123 } 1115 }
1124 1116 //Note: repeated?
1125 if (i18n->multibyte()) { 1117 client.title_text_w = screen->getWindowStyle()->font.textWidth(getTitle().c_str(), getTitle().size());
1126 XRectangle ink, logical;
1127 XmbTextExtents(screen->getWindowStyle()->font.set,
1128 getTitle().c_str(), getTitle().size(), &ink, &logical);
1129 client.title_text_w = logical.width;
1130 } else {
1131 client.title_text_w = XTextWidth(screen->getWindowStyle()->font.fontstruct,
1132 getTitle().c_str(), getTitle().size());
1133 }
1134
1135 client.title_text_w += (frame.bevel_w * 4); 1118 client.title_text_w += (frame.bevel_w * 4);
1136 1119
1137} 1120}
@@ -2445,15 +2428,18 @@ void FluxboxWindow::redrawLabel() {
2445 XSetWindowBackground(display, frame.label, frame.ulabel_pixel); 2428 XSetWindowBackground(display, frame.label, frame.ulabel_pixel);
2446 } 2429 }
2447 2430
2431 XClearWindow(display, frame.label);
2432
2448 //no need to draw the title if we don't have any 2433 //no need to draw the title if we don't have any
2449 if (getTitle().size()!=0) { 2434 if (getTitle().size() != 0) {
2450 GC gc = ((focused) ? screen->getWindowStyle()->l_text_focus_gc : 2435 GC gc = ((focused) ? screen->getWindowStyle()->l_text_focus_gc :
2451 screen->getWindowStyle()->l_text_unfocus_gc); 2436 screen->getWindowStyle()->l_text_unfocus_gc);
2452 2437 screen->getWindowStyle()->font.drawText(
2453 DrawUtil::DrawString(display, frame.label, gc, 2438 frame.label,
2454 &screen->getWindowStyle()->font, 2439 screen->getScreenNumber(),
2455 client.title_text_w, frame.label_w, 2440 gc,
2456 frame.bevel_w, getTitle().c_str()); 2441 getTitle().c_str(), getTitle().size(),
2442 frame.bevel_w, frame.bevel_w + screen->getWindowStyle()->font.height());
2457 } 2443 }
2458} 2444}
2459 2445
@@ -3633,14 +3619,8 @@ void FluxboxWindow::upsize() {
3633 frame.bevel_w = screen->getBevelWidth(); 3619 frame.bevel_w = screen->getBevelWidth();
3634 frame.mwm_border_w = screen->getFrameWidth() * decorations.border; 3620 frame.mwm_border_w = screen->getFrameWidth() * decorations.border;
3635 3621
3636 if (I18n::instance()->multibyte()) { 3622 frame.title_h = screen->getWindowStyle()->font.height() +
3637 frame.title_h = (screen->getWindowStyle()->font.set_extents-> 3623 (frame.bevel_w*2 + 2)*decorations.titlebar;
3638 max_ink_extent.height +
3639 (frame.bevel_w * 2) + 2) * decorations.titlebar;
3640 } else
3641 frame.title_h = (screen->getWindowStyle()->font.fontstruct->ascent +
3642 screen->getWindowStyle()->font.fontstruct->descent +
3643 (frame.bevel_w * 2) + 2) * decorations.titlebar;
3644 3624
3645 frame.label_h = (frame.title_h - (frame.bevel_w * 2)) * decorations.titlebar; 3625 frame.label_h = (frame.title_h - (frame.bevel_w * 2)) * decorations.titlebar;
3646 frame.button_w = frame.button_h = frame.label_h - 2; 3626 frame.button_w = frame.button_h = frame.label_h - 2;