fix up slit transparency redraw issues

This commit is contained in:
rathnor 2004-05-17 15:20:32 +00:00
parent c1fb3b3e1a
commit 15fe67e21e
3 changed files with 9 additions and 41 deletions

View file

@ -9,6 +9,8 @@ Changes for 0.9.10:
how it goes :) It basically means we don't have to refresh how it goes :) It basically means we don't have to refresh
menus as much, but uses more memory. Shouldn't break anything new. menus as much, but uses more memory. Shouldn't break anything new.
Menu.cc FbWindow.hh/cc Menu.cc FbWindow.hh/cc
* Fix slit transparency too (finally) while we're at it (Simon)
Slit.hh/cc
*04/05/13: *04/05/13:
* Fix a crash when a window closes while [opaque] moving (Simon) * Fix a crash when a window closes while [opaque] moving (Simon)
- also tidy up several related things when a window hides - also tidy up several related things when a window hides

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Slit.cc,v 1.93 2004/04/19 22:42:05 fluxgen Exp $ // $Id: Slit.cc,v 1.94 2004/05/17 15:20:32 rathnor Exp $
#include "Slit.hh" #include "Slit.hh"
@ -310,10 +310,8 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
create_mask, &attrib); create_mask, &attrib);
FbTk::EventManager::instance()->add(*this, frame.window); FbTk::EventManager::instance()->add(*this, frame.window);
m_transp.reset(new FbTk::Transparent(screen().rootPixmap(), frame.window.drawable(),
*m_rc_alpha,
screen().screenNumber()));
frame.window.setAlpha(*m_rc_alpha);
m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer)); m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer));
moveToLayer((*m_rc_layernum).getNum()); moveToLayer((*m_rc_layernum).getNum());
@ -689,15 +687,7 @@ void Slit::reconfigure() {
if (tmp) if (tmp)
image_ctrl.removeImage(tmp); image_ctrl.removeImage(tmp);
if (m_transp.get()) { frame.window.setAlpha(*m_rc_alpha);
if (frame.pixmap == 0)
m_transp->setDest(frame.window.drawable(), frame.window.screenNumber());
else
m_transp->setDest(frame.pixmap, frame.window.screenNumber());
m_transp->setAlpha(*m_rc_alpha);
}
clearWindow(); clearWindow();
int x = 0, y = 0; int x = 0, y = 0;
@ -1041,18 +1031,7 @@ void Slit::exposeEvent(XExposeEvent &ev) {
// we don't need to clear the entire window // we don't need to clear the entire window
// just the are that gets exposed // just the are that gets exposed
frame.window.clearArea(ev.x, ev.y, ev.width, ev.height); frame.window.clearArea(ev.x, ev.y, ev.width, ev.height);
if (m_transp.get()) { frame.window.updateTransparent(ev.x, ev.y, ev.width, ev.height);
if ((int)m_transp->alpha() != *m_rc_alpha)
m_transp->setAlpha(*m_rc_alpha);
if (screen().rootPixmap() != m_transp->source())
m_transp->setSource(screen().rootPixmap(), screen().screenNumber());
m_transp->render(frame.window.x() + ev.x, frame.window.y() + ev.y,
ev.x, ev.y,
ev.width, ev.height);
}
} }
void Slit::update(FbTk::Subject *subj) { void Slit::update(FbTk::Subject *subj) {
@ -1061,19 +1040,7 @@ void Slit::update(FbTk::Subject *subj) {
void Slit::clearWindow() { void Slit::clearWindow() {
frame.window.clear(); frame.window.clear();
if (m_transp.get()) { frame.window.updateTransparent();
if ((int)m_transp->alpha() != *m_rc_alpha)
m_transp->setAlpha(*m_rc_alpha);
if (screen().rootPixmap() != m_transp->source())
m_transp->setSource(screen().rootPixmap(), screen().screenNumber());
m_transp->render(frame.window.x(), frame.window.y(),
0, 0,
frame.window.width(), frame.window.height());
}
} }
void Slit::toggleHidden() { void Slit::toggleHidden() {

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
/// $Id: Slit.hh,v 1.39 2004/04/19 22:42:26 fluxgen Exp $ /// $Id: Slit.hh,v 1.40 2004/05/17 15:20:32 rathnor Exp $
#ifndef SLIT_HH #ifndef SLIT_HH
#define SLIT_HH #define SLIT_HH
@ -152,7 +152,6 @@ private:
std::auto_ptr<FbTk::XLayerItem> m_layeritem; std::auto_ptr<FbTk::XLayerItem> m_layeritem;
std::auto_ptr<SlitTheme> m_slit_theme; std::auto_ptr<SlitTheme> m_slit_theme;
std::auto_ptr<FbTk::Transparent> m_transp;
static unsigned int s_eventmask; static unsigned int s_eventmask;
Strut *m_strut; Strut *m_strut;