all repos — fluxbox @ 2585aefafe99591a6d3fa20fd09f079ddfa897c1

custom fork of the fluxbox windowmanager

fix window size when varying borderWidth
rathnor rathnor
commit

2585aefafe99591a6d3fa20fd09f079ddfa897c1

parent

2b7aace6b304fc46ae4f948feb531ae60b39251e

5 files changed, 37 insertions(+), 19 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.5: *03/07/26: + * Fix window size when changing borderWidth [borderless wins] (Simon) + Window.hh/cc FbWinFrame.hh/cc * Fix some keybinding issues with ShadeWindow, StickWindow, SendToWorkspace, NextGroup, PrevGroup (Simon) CurrentWindowCmd.cc FbCommandFactory.cc
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.30 2003/07/10 11:36:21 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.31 2003/07/26 16:17:01 rathnor Exp $ #include "FbWinFrame.hh" #include "ImageControl.hh"

@@ -914,3 +914,22 @@ m_current_label->clear();

} } + +void FbWinFrame::setBorderWidth(unsigned int borderW) { + int bw_changes = 0; + // we need to change the size of the window + // if the border width changes... + if (m_use_titlebar) + bw_changes += (signed) borderW - titlebar().borderWidth(); + if (m_use_handle) + bw_changes += (signed) borderW - handle().borderWidth(); + + window().setBorderWidth(borderW); + titlebar().setBorderWidth(borderW); + handle().setBorderWidth(borderW); + gripLeft().setBorderWidth(borderW); + gripRight().setBorderWidth(borderW); + + if (bw_changes != 0) + resize(width(), height() + bw_changes); +}
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.hh,v 1.9 2003/07/10 11:36:21 fluxgen Exp $ +// $Id: FbWinFrame.hh,v 1.10 2003/07/26 16:17:01 rathnor Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH

@@ -112,6 +112,8 @@ void hideHandle();

void showHandle(); void hideAllDecorations(); void showAllDecorations(); + + void setBorderWidth(unsigned int borderW); /** @name Event handlers
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.210 2003/07/24 03:19:02 rathnor Exp $ +// $Id: Window.cc,v 1.211 2003/07/26 16:17:01 rathnor Exp $ #include "Window.hh"

@@ -504,7 +504,7 @@ associateClientWindow();

grabButtons(); - applyDecorations(); + applyDecorations(true); if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) m_workspace_number = screen().currentWorkspaceID();

@@ -2678,21 +2678,15 @@

} // commit current decoration values to actual displayed things -void FluxboxWindow::applyDecorations() { +void FluxboxWindow::applyDecorations(bool initial) { frame().clientArea().setBorderWidth(0); // client area bordered by other things unsigned int borderW = 0; if (decorations.border) borderW = screen().rootTheme().borderWidth(); - if (frame().window().borderWidth() != borderW) { - frame().window().setBorderWidth(borderW); - frame().titlebar().setBorderWidth(borderW); - frame().handle().setBorderWidth(borderW); - frame().gripLeft().setBorderWidth(borderW); - frame().gripRight().setBorderWidth(borderW); - frame().reconfigure(); - } + if (initial || frame().window().borderWidth() != borderW) + frame().setBorderWidth(borderW); // we rely on frame not doing anything if it is already shown/hidden if (decorations.titlebar)

@@ -2700,9 +2694,10 @@ frame().showTitlebar();

else frame().hideTitlebar(); - if (decorations.handle) + if (decorations.handle) { frame().showHandle(); - else + frame().reconfigure(); // show handle requires reconfigure + } else frame().hideHandle(); }

@@ -2713,15 +2708,15 @@ if (isShaded())

return; if (decorations.enabled) { //remove decorations - setDecoration(DECOR_NONE); decorations.enabled = false; + setDecoration(DECOR_NONE); } else { //revert back to old decoration + decorations.enabled = true; if (m_old_decoration == DECOR_NONE) { // make sure something happens setDecoration(DECOR_NORMAL); } else { setDecoration(m_old_decoration); } - decorations.enabled = true; } }
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.86 2003/07/24 03:19:02 rathnor Exp $ +// $Id: Window.hh,v 1.87 2003/07/26 16:17:02 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -241,7 +241,7 @@ void leaveNotifyEvent(XCrossingEvent &ev);

//@} void setDecoration(Decoration decoration); - void applyDecorations(); + void applyDecorations(bool initial = false); void toggleDecoration();