aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-07-26 16:17:02 (GMT)
committerrathnor <rathnor>2003-07-26 16:17:02 (GMT)
commit2585aefafe99591a6d3fa20fd09f079ddfa897c1 (patch)
tree98dfce1ebc1e0e3537360aaa3953cb8abba3c6dc /src/Window.cc
parent2b7aace6b304fc46ae4f948feb531ae60b39251e (diff)
downloadfluxbox-2585aefafe99591a6d3fa20fd09f079ddfa897c1.zip
fluxbox-2585aefafe99591a6d3fa20fd09f079ddfa897c1.tar.bz2
fix window size when varying borderWidth
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 0ba7a4a..ba5b346 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.210 2003/07/24 03:19:02 rathnor Exp $ 25// $Id: Window.cc,v 1.211 2003/07/26 16:17:01 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -504,7 +504,7 @@ void FluxboxWindow::init() {
504 504
505 grabButtons(); 505 grabButtons();
506 506
507 applyDecorations(); 507 applyDecorations(true);
508 508
509 if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) 509 if (m_workspace_number < 0 || m_workspace_number >= screen().getCount())
510 m_workspace_number = screen().currentWorkspaceID(); 510 m_workspace_number = screen().currentWorkspaceID();
@@ -2678,21 +2678,15 @@ void FluxboxWindow::setDecoration(Decoration decoration) {
2678} 2678}
2679 2679
2680// commit current decoration values to actual displayed things 2680// commit current decoration values to actual displayed things
2681void FluxboxWindow::applyDecorations() { 2681void FluxboxWindow::applyDecorations(bool initial) {
2682 frame().clientArea().setBorderWidth(0); // client area bordered by other things 2682 frame().clientArea().setBorderWidth(0); // client area bordered by other things
2683 2683
2684 unsigned int borderW = 0; 2684 unsigned int borderW = 0;
2685 if (decorations.border) 2685 if (decorations.border)
2686 borderW = screen().rootTheme().borderWidth(); 2686 borderW = screen().rootTheme().borderWidth();
2687 2687
2688 if (frame().window().borderWidth() != borderW) { 2688 if (initial || frame().window().borderWidth() != borderW)
2689 frame().window().setBorderWidth(borderW); 2689 frame().setBorderWidth(borderW);
2690 frame().titlebar().setBorderWidth(borderW);
2691 frame().handle().setBorderWidth(borderW);
2692 frame().gripLeft().setBorderWidth(borderW);
2693 frame().gripRight().setBorderWidth(borderW);
2694 frame().reconfigure();
2695 }
2696 2690
2697 // we rely on frame not doing anything if it is already shown/hidden 2691 // we rely on frame not doing anything if it is already shown/hidden
2698 if (decorations.titlebar) 2692 if (decorations.titlebar)
@@ -2700,9 +2694,10 @@ void FluxboxWindow::applyDecorations() {
2700 else 2694 else
2701 frame().hideTitlebar(); 2695 frame().hideTitlebar();
2702 2696
2703 if (decorations.handle) 2697 if (decorations.handle) {
2704 frame().showHandle(); 2698 frame().showHandle();
2705 else 2699 frame().reconfigure(); // show handle requires reconfigure
2700 } else
2706 frame().hideHandle(); 2701 frame().hideHandle();
2707 2702
2708} 2703}
@@ -2713,15 +2708,15 @@ void FluxboxWindow::toggleDecoration() {
2713 return; 2708 return;
2714 2709
2715 if (decorations.enabled) { //remove decorations 2710 if (decorations.enabled) { //remove decorations
2716 setDecoration(DECOR_NONE);
2717 decorations.enabled = false; 2711 decorations.enabled = false;
2712 setDecoration(DECOR_NONE);
2718 } else { //revert back to old decoration 2713 } else { //revert back to old decoration
2714 decorations.enabled = true;
2719 if (m_old_decoration == DECOR_NONE) { // make sure something happens 2715 if (m_old_decoration == DECOR_NONE) { // make sure something happens
2720 setDecoration(DECOR_NORMAL); 2716 setDecoration(DECOR_NORMAL);
2721 } else { 2717 } else {
2722 setDecoration(m_old_decoration); 2718 setDecoration(m_old_decoration);
2723 } 2719 }
2724 decorations.enabled = true;
2725 } 2720 }
2726} 2721}
2727 2722