diff options
author | fluxgen <fluxgen> | 2004-01-21 19:47:30 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-01-21 19:47:30 (GMT) |
commit | d1b45b69c6cd4b446fa1fc989e48b7bc4f5d29b1 (patch) | |
tree | 90afd9a948afad57cdd652ba3cece928c587d7ec /src | |
parent | f7f454524d711624f44eedfc84c2eeab0c144c56 (diff) | |
download | fluxbox_paul-d1b45b69c6cd4b446fa1fc989e48b7bc4f5d29b1.zip fluxbox_paul-d1b45b69c6cd4b446fa1fc989e48b7bc4f5d29b1.tar.bz2 |
fixed window size bug, it could been negative in hideHandle and hideTitlebar
Diffstat (limited to 'src')
-rw-r--r-- | src/FbWinFrame.cc | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index cbcdbaf..d310f24 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -1,5 +1,5 @@ | |||
1 | // FbWinFrame.cc for Fluxbox Window Manager | 1 | // FbWinFrame.cc for Fluxbox Window Manager |
2 | // Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) | 2 | // Copyright (c) 2003-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) |
3 | // | 3 | // |
4 | // Permission is hereby granted, free of charge, to any person obtaining a | 4 | // Permission is hereby granted, free of charge, to any person obtaining a |
5 | // copy of this software and associated documentation files (the "Software"), | 5 | // copy of this software and associated documentation files (the "Software"), |
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWinFrame.cc,v 1.71 2004/01/21 14:12:31 fluxgen Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.72 2004/01/21 19:47:30 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | 25 | ||
@@ -404,10 +404,15 @@ bool FbWinFrame::hideTitlebar() { | |||
404 | 404 | ||
405 | m_titlebar.hide(); | 405 | m_titlebar.hide(); |
406 | m_use_titlebar = false; | 406 | m_use_titlebar = false; |
407 | if (static_cast<signed int>(m_window.height() - m_titlebar.height() - | ||
408 | m_titlebar.borderWidth()) <= 0) { | ||
409 | m_window.resize(m_window.width(), 1); | ||
410 | } else { | ||
411 | // only take away one borderwidth (as the other border is still the "top" border) | ||
412 | m_window.resize(m_window.width(), m_window.height() - m_titlebar.height() - | ||
413 | m_titlebar.borderWidth()); | ||
414 | } | ||
407 | 415 | ||
408 | // only take away one borderwidth (as the other border is still the "top" border) | ||
409 | m_window.resize(m_window.width(), m_window.height() - m_titlebar.height() - | ||
410 | m_titlebar.borderWidth()); | ||
411 | return true; | 416 | return true; |
412 | } | 417 | } |
413 | 418 | ||
@@ -432,8 +437,16 @@ bool FbWinFrame::hideHandle() { | |||
432 | m_grip_left.hide(); | 437 | m_grip_left.hide(); |
433 | m_grip_right.hide(); | 438 | m_grip_right.hide(); |
434 | m_use_handle = false; | 439 | m_use_handle = false; |
435 | m_window.resize(m_window.width(), m_window.height() - m_handle.height() - | 440 | |
436 | m_handle.borderWidth()); | 441 | if (static_cast<signed int>(m_window.height() - m_handle.height() - |
442 | m_handle.borderWidth())) { | ||
443 | m_window.resize(m_window.width(), 1); | ||
444 | } else { | ||
445 | // only take away one borderwidth (as the other border is still the "top" border) | ||
446 | m_window.resize(m_window.width(), m_window.height() - m_handle.height() - | ||
447 | m_handle.borderWidth()); | ||
448 | } | ||
449 | |||
437 | return true; | 450 | return true; |
438 | 451 | ||
439 | } | 452 | } |
@@ -695,7 +708,6 @@ void FbWinFrame::reconfigure() { | |||
695 | m_shape->update(); | 708 | m_shape->update(); |
696 | 709 | ||
697 | // titlebar stuff rendered already by reconftitlebar | 710 | // titlebar stuff rendered already by reconftitlebar |
698 | |||
699 | } | 711 | } |
700 | 712 | ||
701 | void FbWinFrame::setUseShape(bool value) { | 713 | void FbWinFrame::setUseShape(bool value) { |