diff options
author | Markos Chandras <hwoarang@gentoo.org> | 2009-02-14 15:35:10 +0000 |
---|---|---|
committer | Markos Chandras <hwoarang@gentoo.org> | 2009-02-14 15:35:10 +0000 |
commit | 52e9e1e7754f3c054b8387e6b50a53ba03c71217 (patch) | |
tree | 7c5e390d14c61af13342dfd21e84760215144a32 /x11-libs/qt-gui | |
parent | Stable on alpha. (diff) | |
download | gentoo-2-52e9e1e7754f3c054b8387e6b50a53ba03c71217.tar.gz gentoo-2-52e9e1e7754f3c054b8387e6b50a53ba03c71217.tar.bz2 gentoo-2-52e9e1e7754f3c054b8387e6b50a53ba03c71217.zip |
revbump with qt-copy patches,Thanks to Maciej Mrozowski (reavertm)
(Portage version: 2.1.6.7/cvs/Linux i686)
Diffstat (limited to 'x11-libs/qt-gui')
16 files changed, 864 insertions, 1 deletions
diff --git a/x11-libs/qt-gui/ChangeLog b/x11-libs/qt-gui/ChangeLog index 4b7757bdb91f..1f0d10322a99 100644 --- a/x11-libs/qt-gui/ChangeLog +++ b/x11-libs/qt-gui/ChangeLog @@ -1,6 +1,26 @@ # ChangeLog for x11-libs/qt-gui # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/ChangeLog,v 1.31 2009/02/14 14:21:05 hwoarang Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/ChangeLog,v 1.32 2009/02/14 15:35:10 hwoarang Exp $ + +*qt-gui-4.4.2-r3 (14 Feb 2009) + + 14 Feb 2009; Markos Chandras <hwoarang@gentoo.org> + +files/0195-compositing-properties.diff, + +files/0203-qtexthtmlparser-link-color.diff, + +files/0224-fast-qpixmap-fill.diff, + +files/0225-invalidate-tabbar-geometry-on-refresh.patch, + +files/0226-qtreeview-column_resize_when_needed.diff, + +files/0238-fix-qt-qttabbar-size.diff, + +files/0245-fix-randr-changes-detecting.diff, + +files/0255-qtreeview-selection-columns-hidden.diff, + +files/0258-windowsxpstyle-qbrush.diff, + +files/0260-fix-qgraphicswidget-deletionclearFocus.diff, + +files/0261-sync-before-reset-errorhandler.patch, + +files/0264-fix-zero-height-qpixmap-isnull.diff, + +files/0266-fix-focusChain1.diff, +files/0267-fix-focusChain2.diff, + +qt-gui-4.4.2-r3.ebuild: + revbump with qt-copy patches. Thanks to Maciej Mrozowski (reavertm) + <reavertm@poczta.fm> *qt-gui-4.5.0_rc1-r1 (14 Feb 2009) diff --git a/x11-libs/qt-gui/files/0195-compositing-properties.diff b/x11-libs/qt-gui/files/0195-compositing-properties.diff new file mode 100644 index 000000000000..979df943662e --- /dev/null +++ b/x11-libs/qt-gui/files/0195-compositing-properties.diff @@ -0,0 +1,58 @@ +qt-bugs@ issue : none +bugs.kde.org number : none +applied: no +author: Lubos Lunak <l.lunak@kde.org> + +This patch makes override-redirect windows (popup menu, dropdown menu, +tooltip, combobox, etc.) also have more window properties like WM_CLASS, +so they can be used when compositing. + +--- src/gui/kernel/qwidget_x11.cpp ++++ src/gui/kernel/qwidget_x11.cpp +@@ -637,6 +637,11 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO + Q_ASSERT(id); + XChangeWindowAttributes(dpy, id, CWOverrideRedirect | CWSaveUnder, + &wsa); ++ XClassHint class_hint; ++ QByteArray appName = qAppName().toLatin1(); ++ class_hint.res_name = appName.data(); // application name ++ class_hint.res_class = const_cast<char *>(QX11Info::appClass()); // application class ++ XSetWMProperties(dpy, id, 0, 0, 0, 0, 0, 0, &class_hint); + } else if (topLevel && !desktop) { // top-level widget + if (!X11->wm_client_leader) + create_wm_client_leader(); +@@ -685,13 +690,21 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO + // set EWMH window types + setNetWmWindowTypes(); + ++ // when we create a toplevel widget, the frame strut should be dirty ++ data.fstrut_dirty = 1; ++ ++ } else { ++ // non-toplevel widgets don't have a frame, so no need to ++ // update the strut ++ data.fstrut_dirty = 0; ++ } ++ ++ if (initializeWindow && (popup || (topLevel && !desktop))) { // properties set on all toplevel windows + // set _NET_WM_PID + long curr_pid = getpid(); + XChangeProperty(dpy, id, ATOM(_NET_WM_PID), XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &curr_pid, 1); + +- // when we create a toplevel widget, the frame strut should be dirty +- data.fstrut_dirty = 1; + + // declare the widget's window role + if (QTLWExtra *topData = maybeTopData()) { +@@ -707,10 +720,6 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO + XChangeProperty(dpy, id, ATOM(WM_CLIENT_LEADER), + XA_WINDOW, 32, PropModeReplace, + (unsigned char *)&X11->wm_client_leader, 1); +- } else { +- // non-toplevel widgets don't have a frame, so no need to +- // update the strut +- data.fstrut_dirty = 0; + } + + if (initializeWindow && q->internalWinId()) { diff --git a/x11-libs/qt-gui/files/0203-qtexthtmlparser-link-color.diff b/x11-libs/qt-gui/files/0203-qtexthtmlparser-link-color.diff new file mode 100644 index 000000000000..e01c6ab635ed --- /dev/null +++ b/x11-libs/qt-gui/files/0203-qtexthtmlparser-link-color.diff @@ -0,0 +1,18 @@ +qt-bugs@ issue : N190509 +Trolltech task ID : 190904 (Status: closed; Version fix: 4.5.0) +applied: no +author: Rafael Fernández López <ereslibre@kde.org> + +Links are assigned a foreground color according to the system current color scheme. + +--- src/gui/text/qtexthtmlparser.cpp (revisión: 745183) ++++ src/gui/text/qtexthtmlparser.cpp (copia de trabajo) +@@ -1031,7 +1031,7 @@ void QTextHtmlParserNode::initializeProp + && !attributes.at(i + 1).isEmpty()) { + hasHref = true; + charFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); +- charFormat.setForeground(Qt::blue); ++ charFormat.setForeground(QApplication::palette().link()); + } + } + diff --git a/x11-libs/qt-gui/files/0224-fast-qpixmap-fill.diff b/x11-libs/qt-gui/files/0224-fast-qpixmap-fill.diff new file mode 100644 index 000000000000..e64d9d149e32 --- /dev/null +++ b/x11-libs/qt-gui/files/0224-fast-qpixmap-fill.diff @@ -0,0 +1,48 @@ +qt-bugs@ issue : None +Trolltech task ID : None +bugs.kde.org number : None +applied: no +author: Fredrik Höglund <fredrik@kde.org> + +Since there's no way to specify that a QPixmap should have an alpha channel +when it's created, it's quite common to call pixmap.fill(Qt::transparent) +immediately after creating it, to force Qt to recreate it with an alpha +channel. Unfortunately QPixmap::fill() does this by creating a QImage, +filling it with the specified color, and then converting it to a QPixmap. + +This patch avoids the expensive image->pixmap conversion by simply discarding +the old pixmap, creating a new one with the correct format, and doing the +fill server side. + +Index: src/gui/image/qpixmap_x11.cpp +=================================================================== +--- src/gui/image/qpixmap_x11.cpp (revision 798574) ++++ src/gui/image/qpixmap_x11.cpp (working copy) +@@ -1107,7 +1107,26 @@ + { + if (fillColor.alpha() != 255) { + #ifndef QT_NO_XRENDER +- if (picture && d == 32) { ++ if (X11->use_xrender) { ++ if (!picture || d != 32) { ++ if (picture) ++ XRenderFreePicture(X11->display, picture); ++ if (mask_picture) ++ XRenderFreePicture(X11->display, mask_picture); ++ if (x11_mask) ++ XFreePixmap(X11->display, x11_mask); ++ if (hd) ++ XFreePixmap(X11->display, hd); ++ if (hd2) ++ XFreePixmap(X11->display, hd2); ++ XRenderPictFormat *format = XRenderFindStandardFormat(X11->display, PictStandardARGB32); ++ hd = XCreatePixmap(X11->display, RootWindow(X11->display, xinfo.screen()), width(), height(), 32); ++ picture = XRenderCreatePicture(X11->display, hd, format, 0, 0); ++ mask_picture = 0; ++ x11_mask = 0; ++ hd2 = 0; ++ d = 32; ++ } + ::Picture src = X11->getSolidFill(xinfo.screen(), fillColor); + XRenderComposite(X11->display, PictOpSrc, src, 0, picture, + 0, 0, width(), height(), diff --git a/x11-libs/qt-gui/files/0225-invalidate-tabbar-geometry-on-refresh.patch b/x11-libs/qt-gui/files/0225-invalidate-tabbar-geometry-on-refresh.patch new file mode 100644 index 000000000000..49daca322f3b --- /dev/null +++ b/x11-libs/qt-gui/files/0225-invalidate-tabbar-geometry-on-refresh.patch @@ -0,0 +1,35 @@ +qt-bugs@ issue : 208185 +Trolltech task ID : 208349 +bugs.kde.org number : 159014 +applied: no +author: Robert Knight <robertknight@gmail.com> + +When tabs are inserted or removed in a QTabBar, QTabBarPrivate::refresh() +is called to update the layout. If the tabbar widget is hidden, this +just sets a boolean variable (layoutDirty) and returns, so the parent widget's layout +is not notified about the possible geometry change. + +Prior to Qt 4.4 this was not a problem because the geometry was recalculated +in QTabBar::sizeHint() if the layoutDirty variable was set. In Qt 4.4 however the layout +caches size hint information in QWidgetItemV2. Since the cache information is not invalidated, +the layout may end up using out-of-date size hint information to compute the widget size. + +If the QTabBar is empty when QTabBar::sizeHint() is called, it will return a size with a height +of 0, which will be kept in the cache and so the tab bar will never be shown. + +This patch fixes the problem by calling updateGeometry() whenever the tab bar's layout is refreshed. + +Index: src/gui/widgets/qtabbar.cpp +=================================================================== +--- src/gui/widgets/qtabbar.cpp (revision 796858) ++++ src/gui/widgets/qtabbar.cpp (working copy) +@@ -533,8 +533,8 @@ + layoutTabs(); + makeVisible(currentIndex); + q->update(); +- q->updateGeometry(); + } ++ q->updateGeometry(); + } + + /*! diff --git a/x11-libs/qt-gui/files/0226-qtreeview-column_resize_when_needed.diff b/x11-libs/qt-gui/files/0226-qtreeview-column_resize_when_needed.diff new file mode 100644 index 000000000000..18bf2ac124db --- /dev/null +++ b/x11-libs/qt-gui/files/0226-qtreeview-column_resize_when_needed.diff @@ -0,0 +1,110 @@ +qt-bugs@ issue : N209927 +Trolltech task ID : 210390 +bugs.kde.org number : None +applied: no +author: Rafael Fernández López <ereslibre@kde.org> + +If we have no header, or not visible header on a QTreeView, we can end up with +an unusable widget if we expand lots of child widgets of the kind + +a + b + c + d + ... + +This patch assures that if no header is shown, or if we only have one column (so +no other columns become shrinked), the contents will be visible. + +Index: src/gui/itemviews/qtreeview.h +=================================================================== +--- src/gui/itemviews/qtreeview.h (revisión: 803370) ++++ src/gui/itemviews/qtreeview.h (copia de trabajo) +@@ -229,6 +229,7 @@ + Q_PRIVATE_SLOT(d_func(), void _q_columnsAboutToBeRemoved(const QModelIndex &, int, int)) + Q_PRIVATE_SLOT(d_func(), void _q_columnsRemoved(const QModelIndex &, int, int)) + Q_PRIVATE_SLOT(d_func(), void _q_modelAboutToBeReset()) ++ Q_PRIVATE_SLOT(d_func(), void _q_forceColumnResizeToFitContents()) + }; + + #endif // QT_NO_TREEVIEW +Index: src/gui/itemviews/qtreeview.cpp +=================================================================== +--- src/gui/itemviews/qtreeview.cpp (revisión: 803370) ++++ src/gui/itemviews/qtreeview.cpp (copia de trabajo) +@@ -246,6 +246,19 @@ + + connect(d->model, SIGNAL(modelAboutToBeReset()), SLOT(_q_modelAboutToBeReset())); + ++ // we connect these signals from the model to a slot that will call ++ // resizeColumnToContents. This is important because if we call it only on ++ // expand() method, when we expand a node, the filling of the model can be ++ // delayed. So, we call it again after the model has finished its job. ++ connect(d->model, SIGNAL(layoutChanged()), ++ this, SLOT(_q_forceColumnResizeToFitContents())); ++ connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)), ++ this, SLOT(_q_forceColumnResizeToFitContents())); ++ connect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)), ++ this, SLOT(_q_forceColumnResizeToFitContents())); ++ ++ ++ + if (d->sortingEnabled) + sortByColumn(header()->sortIndicatorSection()); + } +@@ -2787,6 +2800,8 @@ + } + if (model->canFetchMore(index)) + model->fetchMore(index); ++ ++ _q_forceColumnResizeToFitContents(); + } + + void QTreeViewPrivate::collapse(int item, bool emitSignal) +@@ -2826,6 +2841,8 @@ + else + emit q->collapsed(modelIndex); + } ++ ++ _q_forceColumnResizeToFitContents(); + } + + void QTreeViewPrivate::prepareAnimatedOperation(int item, AnimatedOperation::Type type) +@@ -2937,6 +2954,25 @@ + viewItems.clear(); + } + ++void QTreeViewPrivate::_q_forceColumnResizeToFitContents() ++{ ++ Q_Q(QTreeView); ++ ++ /** ++ * if: ++ * ++ * a) The tree view has no header (user cannot resize the column) OR ++ * b) The tree view has a header, but hidden (user cannot resize the column) OR ++ * c) The tree view has a visible header, but with _only_ one (or zero) column (that ++ * means: no other information will be affected). ++ * ++ * We can expand the column to make the contents properly visible. ++ */ ++ if (!header || !header->isVisible() || ((header->count() - header->hiddenSectionCount()) <= 1)) { ++ q->resizeColumnToContents(q->currentIndex().column()); ++ } ++} ++ + void QTreeViewPrivate::_q_columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end) + { + Q_UNUSED(parent); +Index: src/gui/itemviews/qtreeview_p.h +=================================================================== +--- src/gui/itemviews/qtreeview_p.h (revision 803534) ++++ src/gui/itemviews/qtreeview_p.h (working copy) +@@ -101,6 +101,7 @@ + QPixmap after; + }; + ++ void _q_forceColumnResizeToFitContents(); + void expand(int item, bool emitSignal); + void collapse(int item, bool emitSignal); + diff --git a/x11-libs/qt-gui/files/0238-fix-qt-qttabbar-size.diff b/x11-libs/qt-gui/files/0238-fix-qt-qttabbar-size.diff new file mode 100644 index 000000000000..266a8cc01da6 --- /dev/null +++ b/x11-libs/qt-gui/files/0238-fix-qt-qttabbar-size.diff @@ -0,0 +1,20 @@ +qt-bugs@ issue : N216195 +Trolltech task ID : 216537 (Applied in Qt 4.5) +bugs.kde.org number : 162737 +applied: no +author: Michael Leupold <lemma@confuego.org> + +This patch fixes some characters in a tabbar being cut-off due +to a wrong size hint (visible if using a kstyle). + +--- src/gui/widgets/qtabbar.cpp (Revision 820510) ++++ src/gui/widgets/qtabbar.cpp (Arbeitskopie) +@@ -1084,7 +1084,7 @@ + QStyleOptionTabV2 opt; + initStyleOption(&opt, index); + opt.text = d->tabList.at(index).text; +- QSize iconSize = tab->icon.isNull() ? QSize() : opt.iconSize; ++ QSize iconSize = tab->icon.isNull() ? QSize(0, 0) : opt.iconSize; + int hframe = style()->pixelMetric(QStyle::PM_TabBarTabHSpace, &opt, this); + int vframe = style()->pixelMetric(QStyle::PM_TabBarTabVSpace, &opt, this); + const QFontMetrics fm = fontMetrics(); diff --git a/x11-libs/qt-gui/files/0245-fix-randr-changes-detecting.diff b/x11-libs/qt-gui/files/0245-fix-randr-changes-detecting.diff new file mode 100644 index 000000000000..a5aba1500b8b --- /dev/null +++ b/x11-libs/qt-gui/files/0245-fix-randr-changes-detecting.diff @@ -0,0 +1,25 @@ +qt-bugs@ issue : none yet +Trolltech task ID : none yet +bugs.kde.org number : ? +applied: no +author: Lubos Lunak <l.lunak@kde.org> + +Fix QDesktopWidget not detecting some changes in multiscreen setups +(e.g. two screens 1280x1024, one of them switching to smaller size). + +--- src/gui/kernel/qapplication_x11.cpp.sav 2008-08-21 16:33:15.000000000 +0200 ++++ src/gui/kernel/qapplication_x11.cpp 2008-08-27 12:43:06.000000000 +0200 +@@ -3001,11 +3001,11 @@ int QApplication::x11ProcessEvent(XEvent + QSize oldSize(w->size()); + w->data->crect.setWidth(DisplayWidth(X11->display, scr)); + w->data->crect.setHeight(DisplayHeight(X11->display, scr)); +- if (w->size() != oldSize) { ++// if (w->size() != oldSize) { + QResizeEvent e(w->size(), oldSize); + QApplication::sendEvent(w, &e); + emit desktop()->resized(scr); +- } ++// } + } + #endif // QT_NO_XRANDR + diff --git a/x11-libs/qt-gui/files/0255-qtreeview-selection-columns-hidden.diff b/x11-libs/qt-gui/files/0255-qtreeview-selection-columns-hidden.diff new file mode 100644 index 000000000000..baf686ff9767 --- /dev/null +++ b/x11-libs/qt-gui/files/0255-qtreeview-selection-columns-hidden.diff @@ -0,0 +1,44 @@ +qt-bugs@ issue : N232819 +Trolltech task ID : 232831 +applied: no +author: Rafael Fernández López <ereslibre@kde.org> + +In a treeview with columns like this: + +Column 1 | Column 2 | ... | Column k | ... | Column n + +When selecting with rubberband (by clicking on the blank part of the viewport) while Column k is +hidden, you get double items on the selection model, when asking for selection(). This is becase +ranges are incorrectly calculated when there are hidden columns. A way to reproduce: + +Column 1 | Column 2 | Column 4 (Column 3 is hidden) + item + item + item + x <- press button here and move it up to select items (on this same column) + +If you do like this: + +Column 1 | Column 2 | Column 4 (Column 3 is hidden) + item + item + item + x <- press button here and move it up + +you won't be able to reproduce, since you need the hidden column to be between the one you click and +the last one. The reason is that columnRanges returns two ranges when there is supposed to return 1 +range (even when there are hidden columns). + +diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp +index d5ca633..b7975be 100644 +--- src/gui/itemviews/qtreeview.cpp ++++ src/gui/itemviews/qtreeview.cpp +@@ -3494,7 +3494,7 @@ QList<QPair<int, int> > QTreeViewPrivate::columnRanges(const QModelIndex &topInd + current.first = -2; // -1 is not enough because -1+1 = 0 + current.second = -2; + foreach(int logicalColumn, logicalIndexes) { +- if (current.second + 1 != logicalColumn) { ++ if (current.second + 1 != logicalColumn && !header->isSectionHidden(current.second + 1)) { + if (current.first != -2) { + //let's save the current one + ret += current; diff --git a/x11-libs/qt-gui/files/0258-windowsxpstyle-qbrush.diff b/x11-libs/qt-gui/files/0258-windowsxpstyle-qbrush.diff new file mode 100644 index 000000000000..26dff6a5bb95 --- /dev/null +++ b/x11-libs/qt-gui/files/0258-windowsxpstyle-qbrush.diff @@ -0,0 +1,31 @@ +qt-bugs@ issue : N234506 +Trolltech task ID : 234932 +applied: no +author: Patrick Spendrin <ps_ml@gmx.de> + +This makes windows style paint a frame and not a rect for QStyle::PE_Frame + +Index: src/gui/styles/qwindowsxpstyle.cpp +=================================================================== +--- src/gui/styles/qwindowsxpstyle.cpp (revision 880116) ++++ src/gui/styles/qwindowsxpstyle.cpp (working copy) +@@ -1426,16 +1426,19 @@ + COLORREF bcRef; + pGetThemeColor(theme.handle(), partId, stateId, TMT_BORDERCOLOR, &bcRef); + QColor bordercolor(qRgb(GetRValue(bcRef), GetGValue(bcRef), GetBValue(bcRef))); ++ QBrush oldBrush = p->brush(); + QPen oldPen = p->pen(); + // int borderSize = 1; + // pGetThemeInt(theme.handle(), partId, stateId, TMT_BORDERCOLOR, &borderSize); + + // Inner white border ++ p->setBrush(Qt::NoBrush); + p->setPen(QPen(option->palette.base().color(), 1)); + p->drawRect(option->rect.adjusted(1, 1, -2, -2)); + // Outer dark border + p->setPen(QPen(bordercolor, 1)); + p->drawRect(option->rect.adjusted(0, 0, -1, -1)); ++ p->setBrush(oldBrush); + p->setPen(oldPen); + return; + } else if (fillType == BT_NONE) { diff --git a/x11-libs/qt-gui/files/0260-fix-qgraphicswidget-deletionclearFocus.diff b/x11-libs/qt-gui/files/0260-fix-qgraphicswidget-deletionclearFocus.diff new file mode 100644 index 000000000000..0ed6df1b12c1 --- /dev/null +++ b/x11-libs/qt-gui/files/0260-fix-qgraphicswidget-deletionclearFocus.diff @@ -0,0 +1,23 @@ +qt-bugs@ issue : none +Trolltech task ID : None +applied: no +author: Alexis Menard <alexis.menard@trolltech.com> + +Fix deletion of a qgraphicswidget on clear focus even if it doesn't have the focus. + +Will be included in 4.4.4 + +Index: ../src/gui/graphicsview/qgraphicsitem.cpp +=================================================================== +--- src/gui/graphicsview/qgraphicsitem.cpp (revision 883124) ++++ src/gui/graphicsview/qgraphicsitem.cpp (working copy) +@@ -1951,7 +1951,7 @@ + */ + void QGraphicsItem::clearFocus() + { +- if (!d_ptr->scene || !hasFocus()) ++ if (!d_ptr->scene) + return; + if (d_ptr->isWidget) { + // Invisible widget items with focus must explicitly clear subfocus. + diff --git a/x11-libs/qt-gui/files/0261-sync-before-reset-errorhandler.patch b/x11-libs/qt-gui/files/0261-sync-before-reset-errorhandler.patch new file mode 100644 index 000000000000..8a93a14bef3a --- /dev/null +++ b/x11-libs/qt-gui/files/0261-sync-before-reset-errorhandler.patch @@ -0,0 +1,24 @@ +qt-bugs@ issue : 236401 +Trolltech task ID : none +bugs.kde.org number : none +applied: no +author: Lubos Lunak <l.lunak@kde.org> + +Sync X connection before resetting X error handler to the one provided +by Xlib (which just aborts), in case there are still queued requests +that may result in an error. + +Included in Qt 4.5 + + +--- src/gui/kernel/qapplication_x11.cpp.sav 2008-10-20 21:07:11.000000000 +0200 ++++ src/gui/kernel/qapplication_x11.cpp 2008-11-25 15:02:31.000000000 +0100 +@@ -2312,6 +2312,8 @@ void qt_cleanup() + #endif + + // Reset the error handlers ++ if (qt_is_gui_used) ++ XSync(X11->display, False); // sync first to process all possible errors + XSetErrorHandler(original_x_errhandler); + XSetIOErrorHandler(original_xio_errhandler); + diff --git a/x11-libs/qt-gui/files/0264-fix-zero-height-qpixmap-isnull.diff b/x11-libs/qt-gui/files/0264-fix-zero-height-qpixmap-isnull.diff new file mode 100644 index 000000000000..3f364f36e48b --- /dev/null +++ b/x11-libs/qt-gui/files/0264-fix-zero-height-qpixmap-isnull.diff @@ -0,0 +1,47 @@ +Trolltech task ID : 240752 +bugs.kde.org number : 179978 +applied: yes +author: Alex Merry <kde@randomguy3.me.uk> +os: unix + +QPixmap::isNull() depends on the width of the pixmap being set to 0 +when either the height or width parameters passed in were 0. But, on +X11 at least, this doesn't happen. This patch fixes that. + +Fixed in Qt 4.5 (identical fix, apart from the assigment is done in two lines). + +Test case: +============================== +#include <QApplication> +#include <QDebug> +#include <QPixmap> + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + QPixmap pm1(0, 8); + qWarning() << "Zero-width pixmap isNull():" << pm1.isNull(); + QPixmap pm2(8, 0); + qWarning() << "Zero-height pixmap isNull():" << pm2.isNull(); + return 0; +} +============================== +Test case result (without patch): +> Zero-width pixmap isNull(): true +> Zero-height pixmap isNull(): false +============================== + + + +Index: src/gui/image/qpixmap_x11.cpp +=================================================================== +--- src/gui/image/qpixmap_x11.cpp (revision 906157) ++++ src/gui/image/qpixmap_x11.cpp (working copy) +@@ -320,6 +320,7 @@ void QX11PixmapData::resize(int width, i + if (make_null || w < 0 || h < 0 || d == 0) { + hd = 0; + picture = 0; ++ w = h = 0; + if (!make_null) + qWarning("QPixmap: Invalid pixmap parameters"); + return; diff --git a/x11-libs/qt-gui/files/0266-fix-focusChain1.diff b/x11-libs/qt-gui/files/0266-fix-focusChain1.diff new file mode 100644 index 000000000000..dfd828acbe73 --- /dev/null +++ b/x11-libs/qt-gui/files/0266-fix-focusChain1.diff @@ -0,0 +1,99 @@ +Trolltech task ID : 225816 +KDE : 179287 +applied: no +author: Alexis Menard <alexis.menard@trolltech.com> + +Fix a crash in QGraphicsView with focus chain + +Included in 4.4.4 + +Index: src/gui/graphicsview/qgraphicsscene.cpp +--- src/gui/graphicsview/qgraphicsscene.cpp ++++ src/gui/graphicsview/qgraphicsscene.cpp +@@ -2156,10 +2156,12 @@ void QGraphicsScene::addItem(QGraphicsItem *item) + d->tabFocusFirst = widget; + } else if (!widget->parentWidget()) { + // Adding a widget that is not part of a tab focus chain. +- widget->d_func()->focusNext = d->tabFocusFirst; +- widget->d_func()->focusPrev = d->tabFocusFirst->d_func()->focusPrev; +- d->tabFocusFirst->d_func()->focusPrev->d_func()->focusNext = widget; +- d->tabFocusFirst->d_func()->focusPrev = widget; ++ QGraphicsWidget *last = d->tabFocusFirst->d_func()->focusPrev; ++ QGraphicsWidget *lastNew = widget->d_func()->focusPrev; ++ last->d_func()->focusNext = widget; ++ widget->d_func()->focusPrev = last; ++ d->tabFocusFirst->d_func()->focusPrev = lastNew; ++ lastNew->d_func()->focusNext = d->tabFocusFirst; + } + } + +@@ -2488,11 +2490,7 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) + d->lastFocusItem = 0; + if (item == d->tabFocusFirst) { + QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item); +- widget->d_func()->focusPrev->d_func()->focusNext = widget->d_func()->focusNext; +- widget->d_func()->focusNext->d_func()->focusPrev = widget->d_func()->focusPrev; +- d->tabFocusFirst = widget->d_func()->focusNext; +- if (widget == d->tabFocusFirst) +- d->tabFocusFirst = 0; ++ widget->d_func()->fixFocusChainBeforeReparenting(0, 0); + } + if (item == d->activeWindow) { + // ### deactivate... +Index: src/gui/graphicsview/qgraphicsscene.h +--- src/gui/graphicsview/qgraphicsscene.h ++++ src/gui/graphicsview/qgraphicsscene.h +@@ -247,6 +247,7 @@ private: + friend class QGraphicsView; + friend class QGraphicsViewPrivate; + friend class QGraphicsWidget; ++ friend class QGraphicsWidgetPrivate; + }; + + Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsScene::SceneLayers) +Index: src/gui/graphicsview/qgraphicswidget_p.cpp +--- src/gui/graphicsview/qgraphicswidget_p.cpp ++++ src/gui/graphicsview/qgraphicswidget_p.cpp +@@ -15,6 +15,7 @@ + + #include "qgraphicswidget_p.h" + #include "qgraphicslayout.h" ++#include "qgraphicsscene_p.h" + #include <QtGui/qapplication.h> + #include <QtGui/qgraphicsscene.h> + #include <QtGui/qstyleoption.h> +@@ -540,7 +541,7 @@ void QGraphicsWidgetPrivate::clearFocusWidget() + /** + * is called after a reparent has taken place to fix up the focus chain(s) + */ +-void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *newParent) ++void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *newScene) + { + Q_Q(QGraphicsWidget); + +@@ -589,6 +590,13 @@ void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *new + firstOld->d_func()->focusPrev = o; + } + ++ // update tabFocusFirst for oldScene if the item is going to be removed from oldScene ++ if (newParent) ++ newScene = newParent->scene(); ++ QGraphicsScene *oldScene = q->scene(); ++ if (oldScene && newScene != oldScene) ++ oldScene->d_func()->tabFocusFirst = firstOld; ++ + QGraphicsItem *topLevelItem = newParent ? newParent->topLevelItem() : 0; + QGraphicsWidget *topLevel = 0; + if (topLevelItem && topLevelItem->isWidget()) +Index: src/gui/graphicsview/qgraphicswidget_p.h +--- src/gui/graphicsview/qgraphicswidget_p.h ++++ src/gui/graphicsview/qgraphicswidget_p.h +@@ -83,7 +83,7 @@ public: + void setLayoutItemMargins(qreal left, qreal top, qreal right, qreal bottom); + void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = 0); + +- void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent); ++ void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *newScene = 0); + void setLayout_helper(QGraphicsLayout *l); + + qreal leftLayoutItemMargin; diff --git a/x11-libs/qt-gui/files/0267-fix-focusChain2.diff b/x11-libs/qt-gui/files/0267-fix-focusChain2.diff new file mode 100644 index 000000000000..1ae78f8d7fb2 --- /dev/null +++ b/x11-libs/qt-gui/files/0267-fix-focusChain2.diff @@ -0,0 +1,109 @@ +Trolltech task ID : 225816 +KDE : 179287 +applied: no +author: Alexis Menard <alexis.menard@trolltech.com> + +Fix a crash in QGraphicsView with focus chain + +Included in 4.4.4 + +Index: src/gui/graphicsview/qgraphicsscene.cpp +--- src/gui/graphicsview/qgraphicsscene.cpp ++++ src/gui/graphicsview/qgraphicsscene.cpp +@@ -580,12 +580,6 @@ void QGraphicsScenePrivate::_q_removeItemLater(QGraphicsItem *item) + focusItem = 0; + if (item == lastFocusItem) + lastFocusItem = 0; +- if (item == tabFocusFirst) { +- QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item); +- tabFocusFirst = widget->d_func()->focusNext; +- if (widget == tabFocusFirst) +- tabFocusFirst = 0; +- } + if (item == activeWindow) { + // ### deactivate... + activeWindow = 0; +@@ -2463,6 +2457,10 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) + // destructor. + d->removeFromIndex(item); + ++ if (item == d->tabFocusFirst) { ++ QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item); ++ widget->d_func()->fixFocusChainBeforeReparenting(0, 0); ++ } + // Set the item's scene ptr to 0. + item->d_func()->scene = 0; + +@@ -2488,10 +2486,6 @@ void QGraphicsScene::removeItem(QGraphicsItem *item) + d->focusItem = 0; + if (item == d->lastFocusItem) + d->lastFocusItem = 0; +- if (item == d->tabFocusFirst) { +- QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item); +- widget->d_func()->fixFocusChainBeforeReparenting(0, 0); +- } + if (item == d->activeWindow) { + // ### deactivate... + d->activeWindow = 0; +Index: src/gui/graphicsview/qgraphicswidget.cpp +--- src/gui/graphicsview/qgraphicswidget.cpp ++++ src/gui/graphicsview/qgraphicswidget.cpp +@@ -179,6 +179,11 @@ QGraphicsWidget::QGraphicsWidget(QGraphicsWidgetPrivate &dd, QGraphicsItem *pare + QGraphicsWidget::~QGraphicsWidget() + { + Q_D(QGraphicsWidget); ++ if (QGraphicsScene *scn = scene()) { ++ QGraphicsScenePrivate *sceneD = scn->d_func(); ++ if (sceneD->tabFocusFirst == this) ++ sceneD->tabFocusFirst = (d->focusNext == this ? 0 : d->focusNext); ++ } + d->focusPrev->d_func()->focusNext = d->focusNext; + d->focusNext->d_func()->focusPrev = d->focusPrev; + +@@ -1897,18 +1902,25 @@ bool QGraphicsWidget::close() + #endif + + #if 0 +-void QGraphicsWidget::dumpFocusChain(QGraphicsWidget *widget) ++void QGraphicsWidget::dumpFocusChain() + { + qDebug() << "=========== Dumping focus chain =============="; + int i = 0; +- QGraphicsWidget *fw = widget; +- QGraphicsWidget *next = fw; +- if (fw) { +- do { +- qDebug() << i++ << next->className() << next->data(0) << "focusItem:" << (static_cast<QGraphicsItem*>(next) == fw ? "true" : "false") << "next:" << next->d_func()->focusNext->data(0) << "prev:" << next->d_func()->focusPrev->data(0); +- next = next->d_func()->focusNext; +- } while (next != fw); +- } ++ QGraphicsWidget *next = this; ++ QSet<QGraphicsWidget*> visited; ++ do { ++ if (!next) { ++ qWarning("Found a focus chain that is not circular, (next == 0)"); ++ break; ++ } ++ qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromAscii("focusItem:%1").arg(next->hasFocus() ? "1" : "0") << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0); ++ if (visited.contains(next)) { ++ qWarning("Already visited this node. However, I expected to dump until I found myself."); ++ break; ++ } ++ visited << next; ++ next = next->d_func()->focusNext; ++ } while (next != this); + } + #endif + +Index: src/gui/graphicsview/qgraphicswidget.h +--- src/gui/graphicsview/qgraphicswidget.h ++++ src/gui/graphicsview/qgraphicswidget.h +@@ -115,7 +115,7 @@ public: + QPainterPath shape() const; + + #if 0 +- static void dumpFocusChain(QGraphicsWidget *widget); ++ static void dumpFocusChain(); + #endif + + // ### Qt 5: Disambiguate diff --git a/x11-libs/qt-gui/qt-gui-4.4.2-r3.ebuild b/x11-libs/qt-gui/qt-gui-4.4.2-r3.ebuild new file mode 100644 index 000000000000..a4068e83ba22 --- /dev/null +++ b/x11-libs/qt-gui/qt-gui-4.4.2-r3.ebuild @@ -0,0 +1,152 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/qt-gui-4.4.2-r3.ebuild,v 1.1 2009/02/14 15:35:10 hwoarang Exp $ + +EAPI="1" +inherit eutils qt4-build + +DESCRIPTION="The GUI module for the Qt toolkit" +HOMEPAGE="http://www.trolltech.com/" + +LICENSE="|| ( GPL-3 GPL-2 )" +SLOT="4" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" + +IUSE_INPUT_DEVICES="input_devices_wacom" +IUSE="+accessibility cups +dbus debug +glib mng nas nis tiff +qt3support xinerama ${IUSE_INPUT_DEVICES}" + +RDEPEND="media-libs/fontconfig + >=media-libs/freetype-2 + media-libs/jpeg + media-libs/libpng + sys-libs/zlib + x11-libs/libXrandr + x11-libs/libXcursor + x11-libs/libXfont + x11-libs/libSM + ~x11-libs/qt-core-${PV} + ~x11-libs/qt-script-${PV} + cups? ( net-print/cups ) + dbus? ( ~x11-libs/qt-dbus-${PV} ) + input_devices_wacom? ( x11-libs/libXi x11-drivers/linuxwacom ) + mng? ( >=media-libs/libmng-1.0.9 ) + nas? ( >=media-libs/nas-1.5 ) + tiff? ( media-libs/tiff ) + xinerama? ( x11-libs/libXinerama )" +DEPEND="${RDEPEND} + xinerama? ( x11-proto/xineramaproto ) + x11-proto/xextproto + x11-proto/inputproto" +PDEPEND="qt3support? ( ~x11-libs/qt-qt3support-${PV} )" + +QT4_TARGET_DIRECTORIES=" +src/gui +tools/designer +tools/linguist +src/plugins/imageformats/gif +src/plugins/imageformats/ico +src/plugins/imageformats/jpeg" +QT4_EXTRACT_DIRECTORIES=" +src/tools/rcc/ +tools/shared/" + +pkg_setup() { + use glib && QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} + ~x11-libs/qt-core-${PV} glib" + use qt3support && QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} + ~x11-libs/qt-core-${PV} qt3support" + + qt4-build_pkg_setup +} + +src_unpack() { + use dbus && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} tools/qdbus/qdbusviewer" + use mng && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/imageformats/mng" + use tiff && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/imageformats/tiff" + QT4_EXTRACT_DIRECTORIES="${QT4_TARGET_DIRECTORIES} + ${QT4_EXTRACT_DIRECTORIES}" + + qt4-build_src_unpack + + # Apply bugfix patches from qt-copy (KDE) + epatch "${FILESDIR}"/0195-compositing-properties.diff + epatch "${FILESDIR}"/0203-qtexthtmlparser-link-color.diff + epatch "${FILESDIR}"/0224-fast-qpixmap-fill.diff + epatch "${FILESDIR}"/0225-invalidate-tabbar-geometry-on-refresh.patch + epatch "${FILESDIR}"/0226-qtreeview-column_resize_when_needed.diff + epatch "${FILESDIR}"/0238-fix-qt-qttabbar-size.diff + epatch "${FILESDIR}"/0245-fix-randr-changes-detecting.diff + epatch "${FILESDIR}"/0248-fix-qwidget-scroll-slowness.diff + epatch "${FILESDIR}"/0254-fix-qgraphicsproxywidget-deletion-crash.diff + epatch "${FILESDIR}"/0255-qtreeview-selection-columns-hidden.diff + epatch "${FILESDIR}"/0256-fix-recursive-backingstore-sync-crash.diff + epatch "${FILESDIR}"/0258-windowsxpstyle-qbrush.diff + epatch "${FILESDIR}"/0260-fix-qgraphicswidget-deletionclearFocus.diff + epatch "${FILESDIR}"/0261-sync-before-reset-errorhandler.patch + epatch "${FILESDIR}"/0262-fix-treeview-animation-crash.diff + epatch "${FILESDIR}"/0263-fix-fontconfig-handling.diff + epatch "${FILESDIR}"/0264-fix-zero-height-qpixmap-isnull.diff + epatch "${FILESDIR}"/0265-fix-formlayoutcrash.diff + epatch "${FILESDIR}"/0266-fix-focusChain1.diff + epatch "${FILESDIR}"/0267-fix-focusChain2.diff + + # Don't build plugins this go around, because they depend on qt3support lib + sed -i -e "s:CONFIG(shared:# &:g" "${S}"/tools/designer/src/src.pro +} + +src_compile() { + export PATH="${S}/bin:${PATH}" + export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" + + local myconf + myconf="$(qt_use accessibility) + $(qt_use cups) + $(qt_use glib) + $(qt_use input_devices_wacom tablet) + $(qt_use mng libmng system) + $(qt_use nis) + $(qt_use tiff libtiff system) + $(qt_use dbus qdbus) + $(qt_use qt3support) + $(qt_use xinerama)" + + use nas && myconf="${myconf} -system-nas-sound" + + myconf="${myconf} -qt-gif -system-libpng -system-libjpeg + -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite -no-sql-sqlite2 -no-sql-odbc + -xrender -xrandr -xkb -xshape -sm -no-svg" + + # Explictly don't compile these packages. + # Emerge "qt-webkit", "qt-phonon", etc for their functionality. + myconf="${myconf} -no-webkit -no-phonon -no-dbus -no-opengl" + + qt4-build_src_compile +} + +src_install() { + QCONFIG_ADD="x11sm xshape xcursor xfixes xrandr xrender xkb fontconfig + $(use input_devices_wacom && echo tablet) $(usev accessibility) + $(usev xinerama) $(usev cups) $(usev nas) gif png system-png system-jpeg + $(use mng && echo system-mng) $(use tiff && echo system-tiff)" + QCONFIG_REMOVE="no-gif no-png" + QCONFIG_DEFINE="$(use accessibility && echo QT_ACCESSIBILITY) + $(use cups && echo QT_CUPS) QT_FONTCONFIG QT_IMAGEFORMAT_JPEG + $(use mng && echo QT_IMAGEFORMAT_MNG) $(use nas && echo QT_NAS) + $(use nis && echo QT_NIS) QT_IMAGEFORMAT_PNG QT_SESSIONMANAGER QT_SHAPE + $(use tiff && echo QT_IMAGEFORMAT_TIFF) QT_XCURSOR + $(use xinerama && echo QT_XINERAMA) QT_XFIXES QT_XKB QT_XRANDR QT_XRENDER" + qt4-build_src_install + + # install correct designer and linguist icons, bug 241208 + dodir /usr/share/pixmaps/ || die "dodir failed" + insinto /usr/share/pixmaps/ || die "insinto failed" + doins tools/linguist/linguist/images/icons/linguist-128-32.png \ + tools/designer/src/designer/images/designer.png || die "doins failed" + # Note: absolute image path required here! + make_desktop_entry /usr/bin/linguist Linguist \ + /usr/share/pixmaps/linguist-128-32.png 'Qt;Development;GUIDesigner' \ + || die "make_desktop_entry failed" + make_desktop_entry /usr/bin/designer Designer \ + /usr/share/pixmaps/designer.png 'Qt;Development;GUIDesigner' \ + || die "make_desktop_entry failed" +} |