don't apply rounded corners to windows without decorations
This commit is contained in:
parent
2f3a48f17f
commit
8681220f53
3 changed files with 12 additions and 26 deletions
|
@ -91,8 +91,7 @@ FbWinFrame::FbWinFrame(BScreen &screen,
|
||||||
m_height_before_shade(1),
|
m_height_before_shade(1),
|
||||||
m_focused_alpha(AlphaAcc(*theme.focusedTheme(), &FbWinFrameTheme::alpha)),
|
m_focused_alpha(AlphaAcc(*theme.focusedTheme(), &FbWinFrameTheme::alpha)),
|
||||||
m_unfocused_alpha(AlphaAcc(*theme.unfocusedTheme(), &FbWinFrameTheme::alpha)),
|
m_unfocused_alpha(AlphaAcc(*theme.unfocusedTheme(), &FbWinFrameTheme::alpha)),
|
||||||
m_shape(m_window, theme->shapePlace()),
|
m_shape(m_window, theme->shapePlace()) {
|
||||||
m_disable_themeshape(false) {
|
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -994,26 +993,12 @@ void FbWinFrame::reconfigure() {
|
||||||
m_need_render = true;
|
m_need_render = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_disable_themeshape)
|
m_shape.setPlaces(getShape());
|
||||||
m_shape.setPlaces(FbTk::Shape::NONE);
|
|
||||||
else
|
|
||||||
m_shape.setPlaces(theme()->shapePlace());
|
|
||||||
|
|
||||||
m_shape.setShapeOffsets(0, titlebarHeight());
|
m_shape.setShapeOffsets(0, titlebarHeight());
|
||||||
|
|
||||||
// titlebar stuff rendered already by reconftitlebar
|
// 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) {
|
void FbWinFrame::setShapingClient(FbTk::FbWindow *win, bool always_update) {
|
||||||
m_shape.setShapeSource(win, 0, titlebarHeight(), always_update);
|
m_shape.setShapeSource(win, 0, titlebarHeight(), always_update);
|
||||||
}
|
}
|
||||||
|
@ -1319,8 +1304,6 @@ void FbWinFrame::init() {
|
||||||
if (theme()->handleWidth() == 0)
|
if (theme()->handleWidth() == 0)
|
||||||
m_use_handle = false;
|
m_use_handle = false;
|
||||||
|
|
||||||
m_disable_themeshape = false;
|
|
||||||
|
|
||||||
m_handle.showSubwindows();
|
m_handle.showSubwindows();
|
||||||
|
|
||||||
// clear pixmaps
|
// clear pixmaps
|
||||||
|
@ -1483,6 +1466,15 @@ bool FbWinFrame::useHandle() const {
|
||||||
return !m_state.fullscreen && m_state.deco_mask & DECORM_HANDLE;
|
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() {
|
void FbWinFrame::applyDecorations() {
|
||||||
int grav_x=0, grav_y=0;
|
int grav_x=0, grav_y=0;
|
||||||
// negate gravity
|
// negate gravity
|
||||||
|
|
|
@ -243,6 +243,7 @@ public:
|
||||||
bool useTabs() const;
|
bool useTabs() const;
|
||||||
bool useTitlebar() const;
|
bool useTitlebar() const;
|
||||||
bool useHandle() const;
|
bool useHandle() const;
|
||||||
|
int getShape() const;
|
||||||
|
|
||||||
// this function translates its arguments according to win_gravity
|
// this function translates its arguments according to win_gravity
|
||||||
// if win_gravity is negative, it does an inverse translation
|
// if win_gravity is negative, it does an inverse translation
|
||||||
|
@ -259,7 +260,6 @@ public:
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void setUseShape(bool value);
|
|
||||||
void setShapingClient(FbTk::FbWindow *win, bool always_update);
|
void setShapingClient(FbTk::FbWindow *win, bool always_update);
|
||||||
void updateShape() { m_shape.update(); }
|
void updateShape() { m_shape.update(); }
|
||||||
|
|
||||||
|
@ -455,8 +455,6 @@ private:
|
||||||
FbTk::DefaultValue<unsigned char, AlphaAcc> m_unfocused_alpha;
|
FbTk::DefaultValue<unsigned char, AlphaAcc> m_unfocused_alpha;
|
||||||
|
|
||||||
FbTk::Shape m_shape;
|
FbTk::Shape m_shape;
|
||||||
|
|
||||||
bool m_disable_themeshape;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FBWINFRAME_HH
|
#endif // FBWINFRAME_HH
|
||||||
|
|
|
@ -1451,8 +1451,6 @@ void FluxboxWindow::setFullscreen(bool flag) {
|
||||||
if (isShaded())
|
if (isShaded())
|
||||||
shade();
|
shade();
|
||||||
|
|
||||||
frame().setUseShape(false);
|
|
||||||
|
|
||||||
m_old_layernum = layerNum();
|
m_old_layernum = layerNum();
|
||||||
if (!maximized) {
|
if (!maximized) {
|
||||||
m_old_pos_x = frame().x();
|
m_old_pos_x = frame().x();
|
||||||
|
@ -1483,8 +1481,6 @@ void FluxboxWindow::setFullscreen(bool flag) {
|
||||||
fullscreen = false;
|
fullscreen = false;
|
||||||
frame().setFullscreen(false);
|
frame().setFullscreen(false);
|
||||||
|
|
||||||
frame().setUseShape(true);
|
|
||||||
|
|
||||||
// ensure we apply the sizehints here, otherwise some
|
// ensure we apply the sizehints here, otherwise some
|
||||||
// apps (eg xterm) end up a little bit .. crappy (visually)
|
// apps (eg xterm) end up a little bit .. crappy (visually)
|
||||||
frame().applySizeHints(m_old_width, m_old_height);
|
frame().applySizeHints(m_old_width, m_old_height);
|
||||||
|
|
Loading…
Reference in a new issue