diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/FbWinFrame.cc | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index bd44467..9b8b7e7 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWinFrame.cc,v 1.75 2004/02/27 12:20:01 fluxgen Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.76 2004/02/28 16:54:04 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | 25 | ||
@@ -28,6 +28,7 @@ | |||
28 | #include "FbTk/TextButton.hh" | 28 | #include "FbTk/TextButton.hh" |
29 | #include "FbTk/App.hh" | 29 | #include "FbTk/App.hh" |
30 | #include "FbTk/SimpleCommand.hh" | 30 | #include "FbTk/SimpleCommand.hh" |
31 | #include "FbTk/Compose.hh" | ||
31 | #include "CompareWindow.hh" | 32 | #include "CompareWindow.hh" |
32 | #include "FbWinFrameTheme.hh" | 33 | #include "FbWinFrameTheme.hh" |
33 | 34 | ||
@@ -140,6 +141,7 @@ void FbWinFrame::show() { | |||
140 | m_visible = true; | 141 | m_visible = true; |
141 | m_window.showSubwindows(); | 142 | m_window.showSubwindows(); |
142 | m_window.show(); | 143 | m_window.show(); |
144 | updateTransparent(); | ||
143 | } | 145 | } |
144 | 146 | ||
145 | /** | 147 | /** |
@@ -551,7 +553,6 @@ void FbWinFrame::buttonReleaseEvent(XButtonEvent &event) { | |||
551 | if (button_it != m_labelbuttons.end()) | 553 | if (button_it != m_labelbuttons.end()) |
552 | (*button_it)->buttonReleaseEvent(event); | 554 | (*button_it)->buttonReleaseEvent(event); |
553 | 555 | ||
554 | |||
555 | if (event.window == m_grip_right.window() || | 556 | if (event.window == m_grip_right.window() || |
556 | event.window == m_grip_left.window() || | 557 | event.window == m_grip_left.window() || |
557 | event.window == m_clientarea.window() || | 558 | event.window == m_clientarea.window() || |
@@ -1223,23 +1224,74 @@ void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) { | |||
1223 | button.setBackgroundColor(m_label_unfocused_color); | 1224 | button.setBackgroundColor(m_label_unfocused_color); |
1224 | 1225 | ||
1225 | } | 1226 | } |
1227 | namespace { | ||
1228 | class IgnoreEvent { | ||
1229 | public: | ||
1230 | typedef void result_type; | ||
1231 | typedef Window argument_type; | ||
1232 | explicit IgnoreEvent(long eventmask): | ||
1233 | m_display(FbTk::App::instance()->display()), | ||
1234 | m_event_mask(eventmask) { | ||
1235 | } | ||
1236 | |||
1237 | void operator()(Window win) const { | ||
1238 | static XEvent event; | ||
1239 | while (XCheckWindowEvent(m_display, win, m_event_mask, &event)) | ||
1240 | continue; | ||
1241 | } | ||
1242 | private: | ||
1243 | Display *m_display; | ||
1244 | long m_event_mask; | ||
1245 | }; | ||
1246 | } | ||
1226 | 1247 | ||
1227 | void FbWinFrame::updateTransparent() { | 1248 | void FbWinFrame::updateTransparent() { |
1228 | redrawTitlebar(); | 1249 | |
1250 | m_label.clear(); | ||
1251 | m_label.updateTransparent(); | ||
1252 | m_titlebar.clear(); | ||
1253 | m_titlebar.updateTransparent(); | ||
1229 | 1254 | ||
1255 | for_each(m_labelbuttons.begin(), | ||
1256 | m_labelbuttons.end(), | ||
1257 | mem_fun(&FbTk::Button::clear)); | ||
1258 | |||
1230 | for_each(m_buttons_left.begin(), | 1259 | for_each(m_buttons_left.begin(), |
1231 | m_buttons_left.end(), | 1260 | m_buttons_left.end(), |
1232 | mem_fun(&FbTk::Button::clear)); | 1261 | mem_fun(&FbTk::Button::clear)); |
1262 | |||
1233 | for_each(m_buttons_right.begin(), | 1263 | for_each(m_buttons_right.begin(), |
1234 | m_buttons_right.end(), | 1264 | m_buttons_right.end(), |
1235 | mem_fun(&FbTk::Button::clear)); | 1265 | mem_fun(&FbTk::Button::clear)); |
1266 | // ignore exposure events, since we already cleared | ||
1267 | // and redrawn the windows | ||
1268 | IgnoreEvent ign(ExposureMask); | ||
1269 | |||
1270 | // base windows | ||
1271 | ign(m_label.window()); | ||
1272 | ign(m_titlebar.window()); | ||
1273 | |||
1274 | // labels | ||
1275 | for_each(m_labelbuttons.begin(), | ||
1276 | m_labelbuttons.end(), | ||
1277 | FbTk::Compose(ign, mem_fun(&FbTk::Button::window))); | ||
1278 | // win buttons | ||
1279 | for_each(m_buttons_right.begin(), | ||
1280 | m_buttons_right.end(), | ||
1281 | FbTk::Compose(ign, mem_fun(&FbTk::Button::window))); | ||
1282 | for_each(m_buttons_left.begin(), | ||
1283 | m_buttons_left.end(), | ||
1284 | FbTk::Compose(ign, mem_fun(&FbTk::Button::window))); | ||
1236 | 1285 | ||
1237 | m_grip_left.clear(); | 1286 | m_grip_left.clear(); |
1238 | m_grip_left.updateTransparent(); | 1287 | m_grip_left.updateTransparent(); |
1288 | ign(m_grip_left.window()); | ||
1239 | m_grip_right.clear(); | 1289 | m_grip_right.clear(); |
1240 | m_grip_right.updateTransparent(); | 1290 | m_grip_right.updateTransparent(); |
1291 | ign(m_grip_right.window()); | ||
1241 | m_handle.clear(); | 1292 | m_handle.clear(); |
1242 | m_handle.updateTransparent(); | 1293 | m_handle.updateTransparent(); |
1294 | ign(m_handle.window()); | ||
1243 | } | 1295 | } |
1244 | 1296 | ||
1245 | 1297 | ||