aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-05-17 15:20:32 (GMT)
committerrathnor <rathnor>2004-05-17 15:20:32 (GMT)
commit15fe67e21e0529fbced36bea3d938611ea1a128a (patch)
tree124c18c1cd6f6d6400c8b2297f9ba24e361545ee
parentc1fb3b3e1a08ef8ad479cf76ba2520bc72591c6c (diff)
downloadfluxbox-15fe67e21e0529fbced36bea3d938611ea1a128a.zip
fluxbox-15fe67e21e0529fbced36bea3d938611ea1a128a.tar.bz2
fix up slit transparency redraw issues
-rw-r--r--ChangeLog2
-rw-r--r--src/Slit.cc45
-rw-r--r--src/Slit.hh3
3 files changed, 9 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index 93d57cd..e1346b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@ Changes for 0.9.10:
9 how it goes :) It basically means we don't have to refresh 9 how it goes :) It basically means we don't have to refresh
10 menus as much, but uses more memory. Shouldn't break anything new. 10 menus as much, but uses more memory. Shouldn't break anything new.
11 Menu.cc FbWindow.hh/cc 11 Menu.cc FbWindow.hh/cc
12 * Fix slit transparency too (finally) while we're at it (Simon)
13 Slit.hh/cc
12*04/05/13: 14*04/05/13:
13 * Fix a crash when a window closes while [opaque] moving (Simon) 15 * Fix a crash when a window closes while [opaque] moving (Simon)
14 - also tidy up several related things when a window hides 16 - also tidy up several related things when a window hides
diff --git a/src/Slit.cc b/src/Slit.cc
index 2ef77c4..c5a74a4 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Slit.cc,v 1.93 2004/04/19 22:42:05 fluxgen Exp $ 25// $Id: Slit.cc,v 1.94 2004/05/17 15:20:32 rathnor Exp $
26 26
27#include "Slit.hh" 27#include "Slit.hh"
28 28
@@ -310,10 +310,8 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
310 create_mask, &attrib); 310 create_mask, &attrib);
311 311
312 FbTk::EventManager::instance()->add(*this, frame.window); 312 FbTk::EventManager::instance()->add(*this, frame.window);
313 m_transp.reset(new FbTk::Transparent(screen().rootPixmap(), frame.window.drawable(), 313
314 *m_rc_alpha, 314 frame.window.setAlpha(*m_rc_alpha);
315 screen().screenNumber()));
316
317 m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer)); 315 m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer));
318 moveToLayer((*m_rc_layernum).getNum()); 316 moveToLayer((*m_rc_layernum).getNum());
319 317
@@ -689,15 +687,7 @@ void Slit::reconfigure() {
689 if (tmp) 687 if (tmp)
690 image_ctrl.removeImage(tmp); 688 image_ctrl.removeImage(tmp);
691 689
692 if (m_transp.get()) { 690 frame.window.setAlpha(*m_rc_alpha);
693 if (frame.pixmap == 0)
694 m_transp->setDest(frame.window.drawable(), frame.window.screenNumber());
695 else
696 m_transp->setDest(frame.pixmap, frame.window.screenNumber());
697
698 m_transp->setAlpha(*m_rc_alpha);
699 }
700
701 clearWindow(); 691 clearWindow();
702 692
703 int x = 0, y = 0; 693 int x = 0, y = 0;
@@ -1041,18 +1031,7 @@ void Slit::exposeEvent(XExposeEvent &ev) {
1041 // we don't need to clear the entire window 1031 // we don't need to clear the entire window
1042 // just the are that gets exposed 1032 // just the are that gets exposed
1043 frame.window.clearArea(ev.x, ev.y, ev.width, ev.height); 1033 frame.window.clearArea(ev.x, ev.y, ev.width, ev.height);
1044 if (m_transp.get()) { 1034 frame.window.updateTransparent(ev.x, ev.y, ev.width, ev.height);
1045 if ((int)m_transp->alpha() != *m_rc_alpha)
1046 m_transp->setAlpha(*m_rc_alpha);
1047
1048 if (screen().rootPixmap() != m_transp->source())
1049 m_transp->setSource(screen().rootPixmap(), screen().screenNumber());
1050
1051 m_transp->render(frame.window.x() + ev.x, frame.window.y() + ev.y,
1052 ev.x, ev.y,
1053 ev.width, ev.height);
1054
1055 }
1056} 1035}
1057 1036
1058void Slit::update(FbTk::Subject *subj) { 1037void Slit::update(FbTk::Subject *subj) {
@@ -1061,19 +1040,7 @@ void Slit::update(FbTk::Subject *subj) {
1061 1040
1062void Slit::clearWindow() { 1041void Slit::clearWindow() {
1063 frame.window.clear(); 1042 frame.window.clear();
1064 if (m_transp.get()) { 1043 frame.window.updateTransparent();
1065 if ((int)m_transp->alpha() != *m_rc_alpha)
1066 m_transp->setAlpha(*m_rc_alpha);
1067
1068 if (screen().rootPixmap() != m_transp->source())
1069 m_transp->setSource(screen().rootPixmap(), screen().screenNumber());
1070
1071 m_transp->render(frame.window.x(), frame.window.y(),
1072 0, 0,
1073 frame.window.width(), frame.window.height());
1074
1075 }
1076
1077} 1044}
1078 1045
1079void Slit::toggleHidden() { 1046void Slit::toggleHidden() {
diff --git a/src/Slit.hh b/src/Slit.hh
index 70c2ae5..83d0fae 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25/// $Id: Slit.hh,v 1.39 2004/04/19 22:42:26 fluxgen Exp $ 25/// $Id: Slit.hh,v 1.40 2004/05/17 15:20:32 rathnor Exp $
26 26
27#ifndef SLIT_HH 27#ifndef SLIT_HH
28#define SLIT_HH 28#define SLIT_HH
@@ -152,7 +152,6 @@ private:
152 152
153 std::auto_ptr<FbTk::XLayerItem> m_layeritem; 153 std::auto_ptr<FbTk::XLayerItem> m_layeritem;
154 std::auto_ptr<SlitTheme> m_slit_theme; 154 std::auto_ptr<SlitTheme> m_slit_theme;
155 std::auto_ptr<FbTk::Transparent> m_transp;
156 static unsigned int s_eventmask; 155 static unsigned int s_eventmask;
157 Strut *m_strut; 156 Strut *m_strut;
158 157