From 14f97fdd925ca27ca5f3058e652223e447f24358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 10 May 2010 12:09:12 +0200 Subject: Fixed an issue with pixmaps not being released correctly in the GL 1 engine. When a pixmap is bound using the texture_from_pixmap extension we retain a reference to the pixmap to stop us destroying it before swapBuffers() or glFlush() is called. The references were not cleared out correctly in the GL 1 engine. Task-number: QTBUG-10529 Reviewed-by: Samuel --- src/opengl/qpaintengine_opengl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 57918d0..fc31548 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -1453,6 +1453,11 @@ bool QOpenGLPaintEngine::end() d->device->endPaint(); qt_mask_texture_cache()->maintainCache(); +#if defined(Q_WS_X11) + // clear out the references we hold for textures bound with the + // texture_from_pixmap extension + ctx->d_func()->boundPixmaps.clear(); +#endif return true; } -- cgit v0.12 From d47adf836b8a044dbe154dd7ffab8c057fedccbf Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 5 Mar 2010 15:48:10 +0100 Subject: Fix for torn off menus that were way too big --- src/gui/widgets/qmenu.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index d0ae90c..879ba2a 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -261,9 +261,6 @@ void QMenuPrivate::updateActionRects() const icone = style->pixelMetric(QStyle::PM_SmallIconSize, &opt, q); const int fw = style->pixelMetric(QStyle::PM_MenuPanelWidth, &opt, q); const int deskFw = style->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, &opt, q); - - const int sfcMargin = style->sizeFromContents(QStyle::CT_Menu, &opt, QApplication::globalStrut(), q).width() - QApplication::globalStrut().width(); - const int min_column_width = q->minimumWidth() - (sfcMargin + leftmargin + rightmargin + 2 * (fw + hmargin)); const int tearoffHeight = tearoff ? style->pixelMetric(QStyle::PM_MenuTearoffHeight, &opt, q) : 0; //for compatability now - will have to refactor this away.. @@ -337,7 +334,7 @@ void QMenuPrivate::updateActionRects() const if (!sz.isEmpty()) { - max_column_width = qMax(min_column_width, qMax(max_column_width, sz.width())); + max_column_width = qMax(max_column_width, sz.width()); //wrapping if (!scroll && y+sz.height()+vmargin > dh - (deskFw * 2)) { @@ -351,6 +348,10 @@ void QMenuPrivate::updateActionRects() const } max_column_width += tabWidth; //finally add in the tab width + const int sfcMargin = style->sizeFromContents(QStyle::CT_Menu, &opt, QApplication::globalStrut(), q).width() - QApplication::globalStrut().width(); + const int min_column_width = q->minimumWidth() - (sfcMargin + leftmargin + rightmargin + 2 * (fw + hmargin)); + max_column_width = qMax(min_column_width, max_column_width); + //calculate position const int base_y = vmargin + fw + topmargin + -- cgit v0.12