diff options
author | simonb <simonb> | 2007-08-09 03:45:31 (GMT) |
---|---|---|
committer | simonb <simonb> | 2007-08-09 03:45:31 (GMT) |
commit | a0f44b9e9a7c2e401e2cf1ef80fed98acf1d7e44 (patch) | |
tree | 2c2658372e5e85c2d0c186f7080e9534430af633 /src/FbWinFrame.cc | |
parent | a04eed16c5287c11e565ecb25f465b96d6f61279 (diff) | |
download | fluxbox_pavel-a0f44b9e9a7c2e401e2cf1ef80fed98acf1d7e44.zip fluxbox_pavel-a0f44b9e9a7c2e401e2cf1ef80fed98acf1d7e44.tar.bz2 |
Fix handling of Shape, stage 2 (more involved/complete handling)
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r-- | src/FbWinFrame.cc | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index d3b3d2f..fbf1102 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -96,8 +96,8 @@ FbWinFrame::FbWinFrame(BScreen &screen, FbWinFrameTheme &theme, FbTk::ImageContr | |||
96 | m_unfocused_alpha(0), | 96 | m_unfocused_alpha(0), |
97 | m_double_click_time(0), | 97 | m_double_click_time(0), |
98 | m_themelistener(*this), | 98 | m_themelistener(*this), |
99 | m_shape(new Shape(m_window, theme.shapePlace())), | 99 | m_shape(m_window, theme.shapePlace()), |
100 | m_disable_shape(false) { | 100 | m_disable_themeshape(false) { |
101 | m_theme.reconfigSig().attach(&m_themelistener); | 101 | m_theme.reconfigSig().attach(&m_themelistener); |
102 | init(); | 102 | init(); |
103 | } | 103 | } |
@@ -210,7 +210,7 @@ void FbWinFrame::show() { | |||
210 | 210 | ||
211 | if (m_need_render) { | 211 | if (m_need_render) { |
212 | renderAll(); | 212 | renderAll(); |
213 | applyAll(); | 213 | applyAll(); |
214 | clearAll(); | 214 | clearAll(); |
215 | } | 215 | } |
216 | 216 | ||
@@ -235,8 +235,7 @@ void FbWinFrame::shade() { | |||
235 | m_window.resize(m_window.width(), m_titlebar.height()); | 235 | m_window.resize(m_window.width(), m_titlebar.height()); |
236 | alignTabs(); | 236 | alignTabs(); |
237 | // need to update our shape | 237 | // need to update our shape |
238 | if ( m_shape.get() ) | 238 | m_shape.update(); |
239 | m_shape->update(); | ||
240 | } else { // should be unshaded | 239 | } else { // should be unshaded |
241 | m_window.resize(m_window.width(), m_height_before_shade); | 240 | m_window.resize(m_window.width(), m_height_before_shade); |
242 | reconfigure(); | 241 | reconfigure(); |
@@ -1122,26 +1121,28 @@ void FbWinFrame::reconfigure() { | |||
1122 | m_need_render = true; | 1121 | m_need_render = true; |
1123 | } | 1122 | } |
1124 | 1123 | ||
1125 | if (m_shape.get() && theme().shapePlace() == Shape::NONE || m_disable_shape) | 1124 | if (m_disable_themeshape) |
1126 | m_shape.reset(0); | 1125 | m_shape.setPlaces(Shape::NONE); |
1127 | else if (m_shape.get() == 0 && theme().shapePlace() != Shape::NONE) | 1126 | else |
1128 | m_shape.reset(new Shape(window(), theme().shapePlace())); | 1127 | m_shape.setPlaces(theme().shapePlace()); |
1129 | else if (m_shape.get()) | ||
1130 | m_shape->setPlaces(theme().shapePlace()); | ||
1131 | 1128 | ||
1132 | if (m_shape.get()) | 1129 | m_shape.setShapeOffsets(0, titlebarHeight()); |
1133 | m_shape->update(); | ||
1134 | 1130 | ||
1135 | // titlebar stuff rendered already by reconftitlebar | 1131 | // titlebar stuff rendered already by reconftitlebar |
1136 | } | 1132 | } |
1137 | 1133 | ||
1138 | void FbWinFrame::setUseShape(bool value) { | 1134 | void FbWinFrame::setUseShape(bool value) { |
1139 | m_disable_shape = !value; | 1135 | m_disable_themeshape = !value; |
1136 | |||
1137 | if (m_disable_themeshape) | ||
1138 | m_shape.setPlaces(Shape::NONE); | ||
1139 | else | ||
1140 | m_shape.setPlaces(theme().shapePlace()); | ||
1141 | |||
1142 | } | ||
1140 | 1143 | ||
1141 | if (m_shape.get() && m_disable_shape) | 1144 | void FbWinFrame::setShapingClient(FbTk::FbWindow *win, bool always_update) { |
1142 | m_shape.reset(0); | 1145 | m_shape.setShapeSource(win, 0, titlebarHeight(), always_update); |
1143 | else if (m_shape.get() == 0 && !m_disable_shape) | ||
1144 | m_shape.reset(new Shape(window(), theme().shapePlace())); | ||
1145 | } | 1146 | } |
1146 | 1147 | ||
1147 | unsigned int FbWinFrame::buttonHeight() const { | 1148 | unsigned int FbWinFrame::buttonHeight() const { |
@@ -1452,7 +1453,7 @@ void FbWinFrame::init() { | |||
1452 | if (theme().handleWidth() == 0) | 1453 | if (theme().handleWidth() == 0) |
1453 | m_use_handle = false; | 1454 | m_use_handle = false; |
1454 | 1455 | ||
1455 | m_disable_shape = false; | 1456 | m_disable_themeshape = false; |
1456 | 1457 | ||
1457 | m_current_label = 0; // no focused button at first | 1458 | m_current_label = 0; // no focused button at first |
1458 | 1459 | ||