From 28c32c087adde2b7b1ede54fd3d4db796259ec9f Mon Sep 17 00:00:00 2001 From: rathnor Date: Sat, 11 Sep 2004 15:52:23 +0000 Subject: more X error fixing --- ChangeLog | 3 +++ src/FbTk/FbWindow.cc | 6 +++++- src/FbTk/Menu.cc | 12 +++++++++--- src/FbTk/Transparent.cc | 5 ++--- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ac150a..845f093 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 0.9.11 *04/09/11: + * Fix some more X errors from XRender calls (Simon) + - also fixes some menu background update issues + FbTk/Menu.cc FbTk/Transparent.cc FbTk/FbWindow.cc * Ignore 32-bit visuals for now when selecting (Simon) - should fix problems with Composite being enabled in X.org FbRootWindow.cc diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 2a4aafa..1656942 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWindow.cc,v 1.40 2004/09/11 12:33:14 rathnor Exp $ +// $Id: FbWindow.cc,v 1.41 2004/09/11 15:52:23 rathnor Exp $ #include "FbWindow.hh" #include "FbPixmap.hh" @@ -111,6 +111,10 @@ FbWindow::FbWindow(Window client):FbDrawable(), m_parent(0), FbWindow::~FbWindow() { + // Need to free xrender pics before destroying window + if (m_transparent.get() != 0) + m_transparent.reset(0); + if (m_window != 0) { // so we don't get any dangling eventhandler for this window FbTk::EventManager::instance()->remove(m_window); diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index a82f441..b79f1b6 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.82 2004/09/11 13:45:16 fluxgen Exp $ +// $Id: Menu.cc,v 1.83 2004/09/11 15:52:23 rathnor Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -567,6 +567,8 @@ void Menu::update(int active_index) { m_real_frame_pm = FbTk::FbPixmap(menu.frame.window(), menu.frame.width(), menu.frame.height(), menu.frame.depth()); + if (m_transp.get() != 0) + m_transp->setDest(m_real_frame_pm.drawable(), screenNumber()); menu.frame.setBackgroundPixmap(m_real_frame_pm.drawable()); GContext def_gc(menu.frame); @@ -1385,7 +1387,6 @@ void Menu::keyPressEvent(XKeyEvent &event) { void Menu::reconfigure() { - if (alpha() == 255 && m_transp.get() != 0) { m_transp.reset(0); } else if (alpha () < 255) { @@ -1394,8 +1395,13 @@ void Menu::reconfigure() { m_transp.reset(new Transparent(FbPixmap::getRootPixmap(screenNumber()), m_real_frame_pm.drawable(), alpha(), screenNumber())); - } else + } else { + Pixmap root = FbPixmap::getRootPixmap(screenNumber()); + if (m_transp->source() != root) + m_transp->setSource(root, screenNumber()); + m_transp->setAlpha(alpha()); + } } m_need_update = true; // redraw items diff --git a/src/FbTk/Transparent.cc b/src/FbTk/Transparent.cc index 9cc377e..b6521b9 100644 --- a/src/FbTk/Transparent.cc +++ b/src/FbTk/Transparent.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Transparent.cc,v 1.7 2004/09/10 16:48:15 akir Exp $ +// $Id: Transparent.cc,v 1.8 2004/09/11 15:52:23 rathnor Exp $ #include "Transparent.hh" #include "App.hh" @@ -60,7 +60,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) { Pixmap alpha_pm = XCreatePixmap(disp, drawable, 1, 1, 8); if (alpha_pm == 0) { - cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderPixmap, "Warning: Failed to create alpha pixmap.", "XCreatePixmap files for our transparency pixmap")<