[Pkg-kde-commits] rev 1673 - in trunk/packages/qt-x11-free/debian:
. patches
Adeodato Simó
adeodato at costa.debian.org
Sun Sep 4 22:56:47 UTC 2005
Author: adeodato
Date: 2005-09-04 22:56:46 +0000 (Sun, 04 Sep 2005)
New Revision: 1673
Added:
trunk/packages/qt-x11-free/debian/patches/29_qtc_fix_rotated_randr.dpatch
trunk/packages/qt-x11-free/debian/patches/30_qtc_qtoolbar_77047.dpatch
trunk/packages/qt-x11-free/debian/patches/32_gtkstyle.dpatch
trunk/packages/qt-x11-free/debian/patches/33_qtc_qlistbox-crash.dpatch
trunk/packages/qt-x11-free/debian/patches/34_qtc_dnd_optimization.dpatch
trunk/packages/qt-x11-free/debian/patches/35_qtc_dnd_active_window_fix.dpatch
trunk/packages/qt-x11-free/debian/patches/36_qtc_dnd-timestamp-fix.dpatch
trunk/packages/qt-x11-free/debian/patches/37_qtc_dragobject-dont-prefer-unknown.dpatch
trunk/packages/qt-x11-free/debian/patches/38_qtc_khotkeys_input_84434.dpatch
trunk/packages/qt-x11-free/debian/patches/39_qtc_qpopup_has_mouse.dpatch
trunk/packages/qt-x11-free/debian/patches/40_qtc_qpopup_ignore_mousepos.dpatch
Modified:
trunk/packages/qt-x11-free/debian/changelog
trunk/packages/qt-x11-free/debian/patches/00list
Log:
Merge all these patches from Chris.
Modified: trunk/packages/qt-x11-free/debian/changelog
===================================================================
--- trunk/packages/qt-x11-free/debian/changelog 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/changelog 2005-09-04 22:56:46 UTC (rev 1673)
@@ -12,6 +12,24 @@
* Add a libqt3c102-mt-dbg package. (Closes: #235396, #322868)
+ * Add the gtkstyle patch, in order to better support Bluecurve.
+ (Closes: #316108)
+
+ * Add more patches from qt-copy:
+ + 29_qtc_fix_rotated_randr: Improve height/width calculations for rotated
+ screens.
+ + 30_qtc_qtoolbar_77047: Fix for the toolbar extension menu.
+ + 33_qtc_qlistbox-crash: Fixes a crash that shows up in KHTML.
+ + 34_qtc_dnd_optimization: Massive DND speedups.
+ + 35_qtc_dnd_active_window_fix: Fixes DND when windows are changing focus.
+ + 36_qtc_dnd-timestamp-fix: Suppresses needless popups when using DND.
+ + 37_qtc_dragobject-dont-prefer-unknown: Fixes DND with some apps, like
+ Mozilla.
+ + 38_qtc_khotkeys_input_84434: Fixes keyboard input action in KHotKeys.
+ + 39_qtc_qpopup_has_mouse, 40_qtc_qpopup_ignore_mousepos: Fixes the mouse
+ movement and position affecting keyboard navigation with popups and
+ menus.
+
* Enable tablet support:
- pass -tablet to configure.
- add libxi-dev to Build-Depends.
Modified: trunk/packages/qt-x11-free/debian/patches/00list
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/00list 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/00list 2005-09-04 22:56:46 UTC (rev 1673)
@@ -18,4 +18,15 @@
26_qtc_qpixmap_constants
27_qtc_qscrollview-windowactivate-fix
28_qtc_png-gamma-fix
+29_qtc_fix_rotated_randr
+30_qtc_qtoolbar_77047
31_gcc4_buildkey
+32_gtkstyle
+33_qtc_qlistbox-crash
+34_qtc_dnd_optimization
+35_qtc_dnd_active_window_fix
+36_qtc_dnd-timestamp-fix
+37_qtc_dragobject-dont-prefer-unknown
+38_qtc_khotkeys_input_84434
+39_qtc_qpopup_has_mouse
+40_qtc_qpopup_ignore_mousepos
Added: trunk/packages/qt-x11-free/debian/patches/29_qtc_fix_rotated_randr.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/29_qtc_fix_rotated_randr.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/29_qtc_fix_rotated_randr.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,34 @@
+#! /bin/sh -e
+# Qt-Copy patch #32
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/kernel/qapplication_x11.cpp
++++ qt.patched/src/kernel/qapplication_x11.cpp
+@@ -3399,7 +3399,8 @@ int QApplication::x11ProcessEvent( XEven
+ #endif
+
+ #ifndef QT_NO_XRANDR
+- if (event->type == xrandr_eventbase + RRScreenChangeNotify) {
++ if (event->type == xrandr_eventbase + RRScreenChangeNotify
++ || ( event->type == ConfigureNotify && event->xconfigure.window == QPaintDevice::x11AppRootWindow())) {
+ // update Xlib internals with the latest screen configuration
+ XRRUpdateConfiguration(event);
+
Added: trunk/packages/qt-x11-free/debian/patches/30_qtc_qtoolbar_77047.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/30_qtc_qtoolbar_77047.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/30_qtc_qtoolbar_77047.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,33 @@
+#! /bin/sh -e
+# Qt-Copy patch #51
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/widgets/qtoolbar.cpp
++++ qt.patched/src/widgets/qtoolbar.cpp
+@@ -648,7 +648,7 @@ void QToolBar::createPopup()
+ QString s = b->textLabel();
+ if ( s.isEmpty() )
+ s = b->text();
+- if ( b->popup() && b->popupDelay() == 0 )
++ if ( b->popup() && b->popupDelay() <= 0 )
+ id = d->extensionPopup->insertItem( b->iconSet(), s, b->popup() );
+ else
+ id = d->extensionPopup->insertItem( b->iconSet(), s, b, SLOT( emulateClick() ) ) ;
Added: trunk/packages/qt-x11-free/debian/patches/32_gtkstyle.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/32_gtkstyle.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/32_gtkstyle.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,135 @@
+#! /bin/sh -e
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/widgets/qmenubar.cpp
++++ qt.patched/src/widgets/qmenubar.cpp
+@@ -228,6 +228,10 @@
+ static const int motifItemHMargin = 5; // menu item hor text margin
+ static const int motifItemVMargin = 4; // menu item ver text margin
+
++// The others are 0
++static const int gtkItemHMargin = 8;
++static const int gtkItemVMargin = 8;
++
+ /*
+
+ +-----------------------------
+@@ -292,7 +296,14 @@
+ setFrameStyle( QFrame::MenuBarPanel | QFrame::Raised );
+
+ QFontMetrics fm = fontMetrics();
+- int h = 2*motifBarVMargin + fm.height() + motifItemVMargin + 2*frameWidth() + 2*motifItemFrame;
++
++ int h;
++ int gs = style().styleHint(QStyle::SH_GUIStyle);
++ if (gs == GtkStyle) {
++ h = fm.height() + gtkItemVMargin;
++ } else {
++ h = 2*motifBarVMargin + fm.height() + motifItemVMargin + 2*frameWidth() + 2*motifItemFrame;
++ }
+
+ setGeometry( 0, 0, width(), h );
+
+@@ -944,12 +955,19 @@
+ h = QMAX( mi->pixmap()->height() + 4, QApplication::globalStrut().height() );
+ } else if ( !mi->text().isNull() ) { // text item
+ QString s = mi->text();
+- w = fm.boundingRect( s ).width()
+- + 2*motifItemHMargin;
++ if ( gs == GtkStyle ) {
++ w = fm.boundingRect( s ).width() + 2*gtkItemHMargin;
++ } else {
++ w = fm.boundingRect( s ).width() + 2*motifItemHMargin;
++ }
+ w -= s.contains('&')*fm.width('&');
+ w += s.contains("&&")*fm.width('&');
+ w = QMAX( w, QApplication::globalStrut().width() );
+- h = QMAX( fm.height() + motifItemVMargin, QApplication::globalStrut().height() );
++ if (gs == GtkStyle ) {
++ h = QMAX( fm.height() + gtkItemVMargin, QApplication::globalStrut().height() );
++ } else {
++ h = QMAX( fm.height() + motifItemVMargin, QApplication::globalStrut().height() );
++ }
+ } else if ( mi->isSeparator() ) { // separator item
+ if ( style().styleHint(QStyle::SH_GUIStyle) == MotifStyle )
+ separator = i; //### only motif?
+--- qt.orig/src/widgets/qpopupmenu.cpp
++++ qt.patched/src/widgets/qpopupmenu.cpp
+@@ -65,6 +65,8 @@
+ static const int motifArrowHMargin = 6; // arrow horizontal margin
+ static const int motifArrowVMargin = 2; // arrow vertical margin
+
++static const int gtkArrowHMargin = 0; // arrow horizontal margin
++static const int gtkArrowVMargin = 0; // arrow vertical margin
+
+ /*
+
+@@ -2290,8 +2292,18 @@
+ QRect r( itemGeometry( actItem ) );
+ QPoint p;
+ QSize ps = popup->sizeHint();
++ // GUI Style
++ int gs = style().styleHint(QStyle::SH_GUIStyle);
++ int arrowHMargin, arrowVMargin;
++ if (gs == GtkStyle) {
++ arrowHMargin = gtkArrowHMargin;
++ arrowVMargin = gtkArrowVMargin;
++ } else {
++ arrowHMargin = motifArrowHMargin;
++ arrowVMargin = motifArrowVMargin;
++ }
+ if( QApplication::reverseLayout() ) {
+- p = QPoint( r.left() + motifArrowHMargin - ps.width(), r.top() + motifArrowVMargin );
++ p = QPoint( r.left() + arrowHMargin - ps.width(), r.top() + arrowVMargin );
+ p = mapToGlobal( p );
+
+ bool right = FALSE;
+@@ -2304,7 +2316,7 @@
+ if ( right )
+ p.setX( mapToGlobal( r.topRight() ).x() );
+ } else {
+- p = QPoint( r.right() - motifArrowHMargin, r.top() + motifArrowVMargin );
++ p = QPoint( r.right() - arrowHMargin, r.top() + arrowVMargin );
+ p = mapToGlobal( p );
+
+ bool left = FALSE;
+--- qt.orig/src/kernel/qnamespace.h
++++ qt.patched/src/kernel/qnamespace.h
+@@ -294,7 +294,8 @@
+ #ifdef QT_NO_COMPAT
+ enum GUIStyle {
+ WindowsStyle = 1, // ### Qt 4.0: either remove the obsolete enums or clean up compat vs.
+- MotifStyle = 4 // ### QT_NO_COMPAT by reordering or combination into one enum.
++ MotifStyle = 4, // ### QT_NO_COMPAT by reordering or combination into one enum.
++ GtkStyle = 6 // Gtk compability mode
+ };
+ #else
+ enum GUIStyle {
+@@ -302,7 +303,8 @@
+ WindowsStyle,
+ Win3Style, // OBSOLETE
+ PMStyle, // OBSOLETE
+- MotifStyle
++ MotifStyle,
++ GtkStyle = 6 // Gtk compability mode
+ };
+ #endif
+
Added: trunk/packages/qt-x11-free/debian/patches/33_qtc_qlistbox-crash.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/33_qtc_qlistbox-crash.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/33_qtc_qlistbox-crash.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,33 @@
+#! /bin/sh -e
+# Qt-Copy patch #62
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/widgets/qlistbox.cpp
++++ qt.patched/src/widgets/qlistbox.cpp
+@@ -1840,7 +1840,7 @@
+ */
+ void QListBox::setCurrentItem( QListBoxItem * i )
+ {
+- if ( !i || d->current == i )
++ if ( !i || d->current == i || numRows() == 0 )
+ return;
+
+ QRect mfrect = itemRect( i );
Added: trunk/packages/qt-x11-free/debian/patches/34_qtc_dnd_optimization.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/34_qtc_dnd_optimization.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/34_qtc_dnd_optimization.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,202 @@
+#! /bin/sh -e
+# Qt-Copy patch #1
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/kernel/qdnd_x11.cpp
++++ qt.patched/src/kernel/qdnd_x11.cpp
+@@ -49,13 +49,15 @@
+ #include "qdragobject.h"
+ #include "qobjectlist.h"
+ #include "qcursor.h"
++#include "qbitmap.h"
++#include "qpainter.h"
+
+ #include "qt_x11_p.h"
+
+ // conflict resolution
+
+-// unused, may be used again later: const int XKeyPress = KeyPress;
+-// unused, may be used again later: const int XKeyRelease = KeyRelease;
++const int XKeyPress = KeyPress;
++const int XKeyRelease = KeyRelease;
+ #undef KeyPress
+ #undef KeyRelease
+
+@@ -249,20 +251,47 @@ class QShapedPixmapWidget : public QWidg
+ public:
+ QShapedPixmapWidget(int screen = -1) :
+ QWidget(QApplication::desktop()->screen( screen ),
+- 0, WStyle_Customize | WStyle_Tool | WStyle_NoBorder | WX11BypassWM )
++ 0, WStyle_Customize | WStyle_Tool | WStyle_NoBorder | WX11BypassWM ), oldpmser( 0 ), oldbmser( 0 )
+ {
+ }
+
+- void setPixmap(QPixmap pm)
++ void setPixmap(QPixmap pm, QPoint hot)
+ {
+- if ( pm.mask() ) {
++ int bmser = pm.mask() ? pm.mask()->serialNumber() : 0;
++ if( oldpmser == pm.serialNumber() && oldbmser == bmser
++ && oldhot == hot )
++ return;
++ oldpmser = pm.serialNumber();
++ oldbmser = bmser;
++ oldhot = hot;
++ bool hotspot_in = !(hot.x() < 0 || hot.y() < 0 || hot.x() >= pm.width() || hot.y() >= pm.height());
++// if the pixmap has hotspot in its area, make a "hole" in it at that position
++// this will allow XTranslateCoordinates() to find directly the window below the cursor instead
++// of finding this pixmap, and therefore there won't be needed any (slow) search for the window
++// using findRealWindow()
++ if( hotspot_in ) {
++ QBitmap mask = pm.mask() ? *pm.mask() : QBitmap( pm.width(), pm.height());
++ if( !pm.mask())
++ mask.fill( Qt::color1 );
++ QPainter p( &mask );
++ p.setPen( Qt::color0 );
++ p.drawPoint( hot.x(), hot.y());
++ p.end();
++ pm.setMask( mask );
++ setMask( mask );
++ } else if ( pm.mask() ) {
+ setMask( *pm.mask() );
+ } else {
+ clearMask();
+ }
+ resize(pm.width(),pm.height());
+ setErasePixmap(pm);
++ erase();
+ }
++private:
++ int oldpmser;
++ int oldbmser;
++ QPoint oldhot;
+ };
+
+ QShapedPixmapWidget * qt_xdnd_deco = 0;
+@@ -859,6 +888,45 @@ void QDragManager::timerEvent( QTimerEve
+ move( QCursor::pos() );
+ }
+
++static bool qt_xdnd_was_move = false;
++static bool qt_xdnd_found = false;
++// check whole incoming X queue for move events
++// checking whole queue is done by always returning False in the predicate
++// if there's another move event in the queue, and there's not a mouse button
++// or keyboard or ClientMessage event before it, the current move event
++// may be safely discarded
++// this helps avoiding being overloaded by being flooded from many events
++// from the XServer
++static
++Bool qt_xdnd_predicate( Display*, XEvent* ev, XPointer )
++{
++ if( qt_xdnd_found )
++ return False;
++ if( ev->type == MotionNotify )
++ {
++ qt_xdnd_was_move = true;
++ qt_xdnd_found = true;
++ }
++ if( ev->type == ButtonPress || ev->type == ButtonRelease
++ || ev->type == XKeyPress || ev->type == XKeyRelease
++ || ev->type == ClientMessage )
++ {
++ qt_xdnd_was_move = false;
++ qt_xdnd_found = true;
++ }
++ return False;
++}
++
++static
++bool qt_xdnd_another_movement()
++{
++ qt_xdnd_was_move = false;
++ qt_xdnd_found = false;
++ XEvent dummy;
++ XCheckIfEvent( qt_xdisplay(), &dummy, qt_xdnd_predicate, NULL );
++ return qt_xdnd_was_move;
++}
++
+ bool QDragManager::eventFilter( QObject * o, QEvent * e)
+ {
+ if ( beingCancelled ) {
+@@ -881,8 +949,10 @@ bool QDragManager::eventFilter( QObject
+
+ if ( e->type() == QEvent::MouseMove ) {
+ QMouseEvent* me = (QMouseEvent *)e;
+- updateMode(me->stateAfter());
+- move( me->globalPos() );
++ if( !qt_xdnd_another_movement()) {
++ updateMode(me->stateAfter());
++ move( me->globalPos() );
++ }
+ return TRUE;
+ } else if ( e->type() == QEvent::MouseButtonRelease ) {
+ qApp->removeEventFilter( this );
+@@ -1106,7 +1176,7 @@ void QDragManager::move( const QPoint &
+ delete qt_xdnd_deco;
+ qt_xdnd_deco = new QShapedPixmapWidget( screen );
+ }
+- updatePixmap();
++ updatePixmap( globalPos );
+
+ if ( qt_xdnd_source_sameanswer.contains( globalPos ) &&
+ qt_xdnd_source_sameanswer.isValid() ) {
+@@ -1679,7 +1749,7 @@ bool QDragManager::drag( QDragObject * o
+ // qt_xdnd_source_object persists until we get an xdnd_finish message
+ }
+
+-void QDragManager::updatePixmap()
++void QDragManager::updatePixmap( const QPoint& cursorPos )
+ {
+ if ( qt_xdnd_deco ) {
+ QPixmap pm;
+@@ -1694,9 +1764,8 @@ void QDragManager::updatePixmap()
+ defaultPm = new QPixmap(default_pm);
+ pm = *defaultPm;
+ }
+- qt_xdnd_deco->setPixmap(pm);
+- qt_xdnd_deco->move(QCursor::pos()-pm_hot);
+- qt_xdnd_deco->repaint(FALSE);
++ qt_xdnd_deco->setPixmap(pm, pm_hot);
++ qt_xdnd_deco->move(cursorPos-pm_hot);
+ //if ( willDrop ) {
+ qt_xdnd_deco->show();
+ //} else {
+@@ -1705,4 +1774,9 @@ void QDragManager::updatePixmap()
+ }
+ }
+
++void QDragManager::updatePixmap()
++{
++ updatePixmap( QCursor::pos());
++}
++
+ #endif // QT_NO_DRAGANDDROP
+--- qt.orig/src/kernel/qdragobject.h
++++ qt.patched/src/kernel/qdragobject.h
+@@ -245,6 +245,7 @@ private:
+ void move( const QPoint & );
+ void drop();
+ void updatePixmap();
++ void updatePixmap( const QPoint& cursorPos );
+
+ private:
+ QDragObject * object;
Added: trunk/packages/qt-x11-free/debian/patches/35_qtc_dnd_active_window_fix.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/35_qtc_dnd_active_window_fix.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/35_qtc_dnd_active_window_fix.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,184 @@
+#! /bin/sh -e
+# Qt-Copy patch #2
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/kernel/qapplication_x11.cpp
++++ qt.patched/src/kernel/qapplication_x11.cpp
+@@ -4053,7 +4053,7 @@ void QApplication::closePopup( QWidget *
+ // Keyboard event translation
+ //
+
+-static int translateButtonState( int s )
++int qt_x11_translateButtonState( int s )
+ {
+ int bst = 0;
+ if ( s & Button1Mask )
+@@ -4119,7 +4119,7 @@ bool QETWidget::translateMouseEvent( con
+ pos.ry() = lastMotion.y;
+ globalPos.rx() = lastMotion.x_root;
+ globalPos.ry() = lastMotion.y_root;
+- state = translateButtonState( lastMotion.state );
++ state = qt_x11_translateButtonState( lastMotion.state );
+ if ( qt_button_down && (state & (LeftButton |
+ MidButton |
+ RightButton ) ) == 0 )
+@@ -4143,7 +4143,7 @@ bool QETWidget::translateMouseEvent( con
+ pos.ry() = xevent->xcrossing.y;
+ globalPos.rx() = xevent->xcrossing.x_root;
+ globalPos.ry() = xevent->xcrossing.y_root;
+- state = translateButtonState( xevent->xcrossing.state );
++ state = qt_x11_translateButtonState( xevent->xcrossing.state );
+ if ( qt_button_down && (state & (LeftButton |
+ MidButton |
+ RightButton ) ) == 0 )
+@@ -4155,7 +4155,7 @@ bool QETWidget::translateMouseEvent( con
+ pos.ry() = event->xbutton.y;
+ globalPos.rx() = event->xbutton.x_root;
+ globalPos.ry() = event->xbutton.y_root;
+- state = translateButtonState( event->xbutton.state );
++ state = qt_x11_translateButtonState( event->xbutton.state );
+ switch ( event->xbutton.button ) {
+ case Button1: button = LeftButton; break;
+ case Button2: button = MidButton; break;
+@@ -4950,7 +4950,7 @@ bool QETWidget::translateKeyEventInterna
+ XKeyEvent xkeyevent = event->xkey;
+
+ // save the modifier state, we will use the keystate uint later by passing
+- // it to translateButtonState
++ // it to qt_x11_translateButtonState
+ uint keystate = event->xkey.state;
+ // remove the modifiers where mode_switch exists... HPUX machines seem
+ // to have alt *AND* mode_switch both in Mod1Mask, which causes
+@@ -5064,7 +5064,7 @@ bool QETWidget::translateKeyEventInterna
+ }
+ #endif // !QT_NO_XIM
+
+- state = translateButtonState( keystate );
++ state = qt_x11_translateButtonState( keystate );
+
+ static int directionKeyEvent = 0;
+ if ( qt_use_rtl_extensions && type == QEvent::KeyRelease ) {
+--- qt.orig/src/kernel/qdnd_x11.cpp
++++ qt.patched/src/kernel/qdnd_x11.cpp
+@@ -114,6 +114,8 @@ Atom qt_xdnd_finished;
+ Atom qt_xdnd_type_list;
+ const int qt_xdnd_version = 4;
+
++extern int qt_x11_translateButtonState( int s );
++
+ // Actions
+ //
+ // The Xdnd spec allows for user-defined actions. This could be implemented
+@@ -198,6 +200,8 @@ static Atom qt_xdnd_source_current_time;
+ static int qt_xdnd_current_screen = -1;
+ // state of dragging... true if dragging, false if not
+ bool qt_xdnd_dragging = FALSE;
++// need to check state of keyboard modifiers
++static bool need_modifiers_check = FALSE;
+
+ // dict of payload data, sorted by type atom
+ static QIntDict<QByteArray> * qt_xdnd_target_data = 0;
+@@ -879,8 +883,20 @@ void qt_handle_xdnd_finished( QWidget *,
+
+ void QDragManager::timerEvent( QTimerEvent* e )
+ {
+- if ( e->timerId() == heartbeat && qt_xdnd_source_sameanswer.isNull() )
+- move( QCursor::pos() );
++ if ( e->timerId() == heartbeat ) {
++ if( need_modifiers_check ) {
++ Window root, child;
++ int root_x, root_y, win_x, win_y;
++ unsigned int mask;
++ XQueryPointer( qt_xdisplay(), qt_xrootwin( qt_xdnd_current_screen ),
++ &root, &child, &root_x, &root_y, &win_x, &win_y, &mask );
++ if( updateMode( (ButtonState)qt_x11_translateButtonState( mask )))
++ qt_xdnd_source_sameanswer = QRect(); // force move
++ }
++ need_modifiers_check = TRUE;
++ if( qt_xdnd_source_sameanswer.isNull() )
++ move( QCursor::pos() );
++ }
+ }
+
+ static bool qt_xdnd_was_move = false;
+@@ -948,6 +964,7 @@ bool QDragManager::eventFilter( QObject
+ updateMode(me->stateAfter());
+ move( me->globalPos() );
+ }
++ need_modifiers_check = FALSE;
+ return TRUE;
+ } else if ( e->type() == QEvent::MouseButtonRelease ) {
+ qApp->removeEventFilter( this );
+@@ -986,9 +1003,11 @@ bool QDragManager::eventFilter( QObject
+ beingCancelled = FALSE;
+ qApp->exit_loop();
+ } else {
+- updateMode(ke->stateAfter());
+- qt_xdnd_source_sameanswer = QRect(); // force move
+- move( QCursor::pos() );
++ if( updateMode(ke->stateAfter())) {
++ qt_xdnd_source_sameanswer = QRect(); // force move
++ move( QCursor::pos() );
++ }
++ need_modifiers_check = FALSE;
+ }
+ return TRUE; // Eat all key events
+ }
+@@ -1014,10 +1033,10 @@ bool QDragManager::eventFilter( QObject
+
+
+ static Qt::ButtonState oldstate;
+-void QDragManager::updateMode( ButtonState newstate )
++bool QDragManager::updateMode( ButtonState newstate )
+ {
+ if ( newstate == oldstate )
+- return;
++ return false;
+ const int both = ShiftButton|ControlButton;
+ if ( (newstate & both) == both ) {
+ global_requested_action = QDropEvent::Link;
+@@ -1041,6 +1060,7 @@ void QDragManager::updateMode( ButtonSta
+ }
+ }
+ oldstate = newstate;
++ return true;
+ }
+
+
+@@ -1707,6 +1727,7 @@ bool QDragManager::drag( QDragObject * o
+ qt_xdnd_source_sameanswer = QRect();
+ move(QCursor::pos());
+ heartbeat = startTimer(200);
++ need_modifiers_check = FALSE;
+
+ #ifndef QT_NO_CURSOR
+ qApp->setOverrideCursor( arrowCursor );
+--- qt.orig/src/kernel/qdragobject.h
++++ qt.patched/src/kernel/qdragobject.h
+@@ -248,7 +248,7 @@ private:
+
+ private:
+ QDragObject * object;
+- void updateMode( ButtonState newstate );
++ bool updateMode( ButtonState newstate );
+ void updateCursor();
+
+ QWidget * dragSource;
Added: trunk/packages/qt-x11-free/debian/patches/36_qtc_dnd-timestamp-fix.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/36_qtc_dnd-timestamp-fix.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/36_qtc_dnd-timestamp-fix.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,55 @@
+#! /bin/sh -e
+# Qt-Copy patch #37
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/kernel/qdnd_x11.cpp
++++ qt.patched/src/kernel/qdnd_x11.cpp
+@@ -81,6 +81,7 @@ extern void qt_leave_modal( QWidget *wid
+ extern Window qt_x11_findClientWindow( Window, Atom, bool );
+ extern Atom qt_wm_state;
+ extern Time qt_x_time;
++extern Time qt_x_user_time;
+
+ // this stuff is copied from qclb_x11.cpp
+
+@@ -834,6 +835,9 @@ void qt_handle_xdnd_drop( QWidget *, con
+ // l[0], qt_xdnd_dragsource_xid );
+ return;
+ }
++
++ if( l[2] != 0 )
++ qt_x_user_time = l[2];
+ if ( qt_xdnd_source_object )
+ qt_xdnd_source_object->setTarget( qt_xdnd_current_widget );
+
+@@ -1366,9 +1370,9 @@ void QDragManager::drop()
+ drop.format = 32;
+ drop.message_type = qt_xdnd_drop;
+ drop.data.l[0] = object->source()->winId();
+- drop.data.l[1] = 1 << 24; // flags
+- drop.data.l[2] = 0; // ###
+- drop.data.l[3] = qt_x_time;
++ drop.data.l[1] = 0; // flags
++ drop.data.l[2] = qt_x_time;
++ drop.data.l[3] = 0;
+ drop.data.l[4] = 0;
+
+ QWidget * w = QWidget::find( qt_xdnd_current_proxy_target );
Added: trunk/packages/qt-x11-free/debian/patches/37_qtc_dragobject-dont-prefer-unknown.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/37_qtc_dragobject-dont-prefer-unknown.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/37_qtc_dragobject-dont-prefer-unknown.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,41 @@
+#! /bin/sh -e
+# Qt-Copy patch #38
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/kernel/qdragobject.cpp
++++ qt.patched/src/kernel/qdragobject.cpp
+@@ -844,6 +844,16 @@ bool QTextDrag::decode( const QMimeSourc
+ {
+ if(!e)
+ return FALSE;
++
++ // when subtype is not specified, try text/plain first, otherwise this may read
++ // things like text/x-moz-url even though better targets are available
++ if( subtype.isNull()) {
++ QCString subtmp = "plain";
++ if( decode( e, str, subtmp )) {
++ subtype = subtmp;
++ return true;
++ }
++ }
+
+ if ( e->cacheType == QMimeSource::Text ) {
+ str = *e->cache.txt.str;
Added: trunk/packages/qt-x11-free/debian/patches/38_qtc_khotkeys_input_84434.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/38_qtc_khotkeys_input_84434.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/38_qtc_khotkeys_input_84434.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,36 @@
+#! /bin/sh -e
+# Qt-Copy patch #56
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/kernel/qapplication_x11.cpp
++++ qt.patched/src/kernel/qapplication_x11.cpp
+@@ -5294,8 +5294,10 @@ static Bool qt_keypress_scanner(Display
+ qt_auto_repeat_data *d = (qt_auto_repeat_data *) arg;
+ if (d->error ||
+ event->xkey.window != d->window ||
+- event->xkey.keycode != d->keycode)
++ event->xkey.keycode != d->keycode) {
++ d->error = TRUE;
+ return FALSE;
++ }
+
+ if (event->type == XKeyPress) {
+ d->error = (! d->release || event->xkey.time - d->timestamp > 10);
Added: trunk/packages/qt-x11-free/debian/patches/39_qtc_qpopup_has_mouse.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/39_qtc_qpopup_has_mouse.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/39_qtc_qpopup_has_mouse.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,68 @@
+#! /bin/sh -e
+# Qt-Copy patch #59
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/widgets/qpopupmenu.cpp
++++ qt.patched/src/widgets/qpopupmenu.cpp
+@@ -253,6 +253,7 @@ public:
+ } scroll;
+ QSize calcSize;
+ QRegion mouseMoveBuffer;
++ uint hasmouse : 1;
+ };
+
+ static QPopupMenu* active_popup_menu = 0;
+@@ -272,6 +273,7 @@ QPopupMenu::QPopupMenu( QWidget *parent,
+ d->scroll.scrollableSize = d->scroll.topScrollableIndex = 0;
+ d->scroll.scrollable = QPopupMenuPrivate::Scroll::ScrollNone;
+ d->scroll.scrolltimer = 0;
++ d->hasmouse = 0;
+ isPopupMenu = TRUE;
+ #ifndef QT_NO_ACCEL
+ autoaccel = 0;
+@@ -1740,6 +1742,11 @@ void QPopupMenu::mouseMoveEvent( QMouseE
+
+ int item = itemAtPos( e->pos() );
+ if ( item == -1 ) { // no valid item
++ if( !d->hasmouse ) {
++ tryMenuBar( e );
++ return;
++ }
++ d->hasmouse = 0;
+ int lastActItem = actItem;
+ actItem = -1;
+ if ( lastActItem >= 0 )
+@@ -1751,6 +1758,7 @@ void QPopupMenu::mouseMoveEvent( QMouseE
+ }
+ } else { // mouse on valid item
+ // but did not register mouse press
++ d->hasmouse = 1;
+ if ( (e->state() & Qt::MouseButtonMask) && !mouseBtDn )
+ mouseBtDn = TRUE; // so mouseReleaseEvent will pop down
+
+@@ -2159,6 +2167,7 @@ void QPopupMenu::timerEvent( QTimerEvent
+ */
+ void QPopupMenu::leaveEvent( QEvent * )
+ {
++ d->hasmouse = 0;
+ if ( testWFlags( WStyle_Tool ) && style().styleHint(QStyle::SH_PopupMenu_MouseTracking, this) ) {
+ int lastActItem = actItem;
+ actItem = -1;
Added: trunk/packages/qt-x11-free/debian/patches/40_qtc_qpopup_ignore_mousepos.dpatch
===================================================================
--- trunk/packages/qt-x11-free/debian/patches/40_qtc_qpopup_ignore_mousepos.dpatch 2005-09-04 22:50:49 UTC (rev 1672)
+++ trunk/packages/qt-x11-free/debian/patches/40_qtc_qpopup_ignore_mousepos.dpatch 2005-09-04 22:56:46 UTC (rev 1673)
@@ -0,0 +1,52 @@
+#! /bin/sh -e
+# Qt-Copy patch #60
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/widgets/qpopupmenu.cpp
++++ qt.patched/src/widgets/qpopupmenu.cpp
+@@ -254,6 +254,7 @@ public:
+ QSize calcSize;
+ QRegion mouseMoveBuffer;
+ uint hasmouse : 1;
++ QPoint ignoremousepos;
+ };
+
+ static QPopupMenu* active_popup_menu = 0;
+@@ -1354,6 +1355,7 @@ void QPopupMenu::show()
+ popupActive = -1;
+ if(style().styleHint(QStyle::SH_PopupMenu_SubMenuPopupDelay, this))
+ d->mouseMoveBuffer = QRegion();
++ d->ignoremousepos = QCursor::pos();
+ }
+
+ /*!
+@@ -1701,6 +1703,11 @@ void QPopupMenu::mouseReleaseEvent( QMou
+
+ void QPopupMenu::mouseMoveEvent( QMouseEvent *e )
+ {
++ if( e->globalPos() == d->ignoremousepos ) {
++ return;
++ }
++ d->ignoremousepos = QPoint();
++
+ motion++;
+
+ if ( parentMenu && parentMenu->isPopupMenu ) {
More information about the pkg-kde-commits
mailing list