all repos — fluxbox @ 8681220f5361fef500d7eda28d9f22bbf0a006e4

custom fork of the fluxbox windowmanager

don't apply rounded corners to windows without decorations
Mark Tiefenbruck mark@fluxbox.org
commit

8681220f5361fef500d7eda28d9f22bbf0a006e4

parent

2f3a48f17fead42b6b2ed906318641e279bb9505

3 files changed, 12 insertions(+), 26 deletions(-)

jump to
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -91,8 +91,7 @@ m_button_size(1),

m_height_before_shade(1), m_focused_alpha(AlphaAcc(*theme.focusedTheme(), &FbWinFrameTheme::alpha)), m_unfocused_alpha(AlphaAcc(*theme.unfocusedTheme(), &FbWinFrameTheme::alpha)), - m_shape(m_window, theme->shapePlace()), - m_disable_themeshape(false) { + m_shape(m_window, theme->shapePlace()) { init(); }

@@ -994,24 +993,10 @@ } else {

m_need_render = true; } - if (m_disable_themeshape) - m_shape.setPlaces(FbTk::Shape::NONE); - else - m_shape.setPlaces(theme()->shapePlace()); - + m_shape.setPlaces(getShape()); m_shape.setShapeOffsets(0, titlebarHeight()); // titlebar stuff rendered already by reconftitlebar -} - -void FbWinFrame::setUseShape(bool value) { - m_disable_themeshape = !value; - - if (m_disable_themeshape) - m_shape.setPlaces(FbTk::Shape::NONE); - else - m_shape.setPlaces(theme()->shapePlace()); - } void FbWinFrame::setShapingClient(FbTk::FbWindow *win, bool always_update) {

@@ -1319,8 +1304,6 @@

if (theme()->handleWidth() == 0) m_use_handle = false; - m_disable_themeshape = false; - m_handle.showSubwindows(); // clear pixmaps

@@ -1481,6 +1464,15 @@ }

bool FbWinFrame::useHandle() const { return !m_state.fullscreen && m_state.deco_mask & DECORM_HANDLE; +} + +int FbWinFrame::getShape() const { + int shape = theme()->shapePlace(); + if (!useTitlebar()) + shape &= ~(FbTk::Shape::TOPRIGHT|FbTk::Shape::TOPLEFT); + if (!useHandle()) + shape &= ~(FbTk::Shape::BOTTOMRIGHT|FbTk::Shape::BOTTOMLEFT); + return shape; } void FbWinFrame::applyDecorations() {
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -243,6 +243,7 @@ bool useBorder() const;

bool useTabs() const; bool useTitlebar() const; bool useHandle() const; + int getShape() const; // this function translates its arguments according to win_gravity // if win_gravity is negative, it does an inverse translation

@@ -259,7 +260,6 @@ void handleEvent(XEvent &event);

//@} void reconfigure(); - void setUseShape(bool value); void setShapingClient(FbTk::FbWindow *win, bool always_update); void updateShape() { m_shape.update(); }

@@ -455,8 +455,6 @@ FbTk::DefaultValue<unsigned char, AlphaAcc> m_focused_alpha;

FbTk::DefaultValue<unsigned char, AlphaAcc> m_unfocused_alpha; FbTk::Shape m_shape; - - bool m_disable_themeshape; }; #endif // FBWINFRAME_HH
M src/Window.ccsrc/Window.cc

@@ -1451,8 +1451,6 @@

if (isShaded()) shade(); - frame().setUseShape(false); - m_old_layernum = layerNum(); if (!maximized) { m_old_pos_x = frame().x();

@@ -1482,8 +1480,6 @@ } else if (!flag && isFullscreen()) {

fullscreen = false; frame().setFullscreen(false); - - frame().setUseShape(true); // ensure we apply the sizehints here, otherwise some // apps (eg xterm) end up a little bit .. crappy (visually)