fix qt3 a bit mroe and have it in sync with OBS

pull/3/head
Robert Xu 13 years ago
parent 281dce280d
commit af4dffbc52

@ -1,2 +1,4 @@
*~
_build*
.osc
.metadata

@ -1571,3 +1571,208 @@ Caused by: java.io.IOException: java.io.IOException: error=2, No such file or di
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
... 7 more
!ENTRY org.eclipse.linuxtools.rpm.ui.editor 4 0 2011-11-12 23:40:02.119
!MESSAGE Unexpected Exception
!STACK 0
java.io.IOException: Cannot run program "rpm": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
at org.eclipse.linuxtools.rpm.core.utils.Utils.runCommandToInputStream(Utils.java:47)
at org.eclipse.linuxtools.rpm.core.utils.Utils.runCommandToString(Utils.java:109)
at org.eclipse.linuxtools.rpm.ui.editor.RpmPackageProposalsList.getRpmInfo(RpmPackageProposalsList.java:110)
at org.eclipse.linuxtools.rpm.ui.editor.RpmPackageProposalsList.getProposals(RpmPackageProposalsList.java:87)
at org.eclipse.linuxtools.rpm.ui.editor.Activator.getRpmPackageList(Activator.java:130)
at org.eclipse.linuxtools.rpm.ui.editor.scanners.SpecfilePackagesScanner.<init>(SpecfilePackagesScanner.java:68)
at org.eclipse.linuxtools.rpm.ui.editor.SpecfileConfiguration.getSpecfilePackagesScanner(SpecfileConfiguration.java:106)
at org.eclipse.linuxtools.rpm.ui.editor.SpecfileConfiguration.getPresentationReconciler(SpecfileConfiguration.java:141)
at org.eclipse.jface.text.source.SourceViewer.configure(SourceViewer.java:450)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3407)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:440)
at org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor.createPartControl(SpecfileEditor.java:195)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:1109)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.openMarkerInEditor(ExtendedMarkersView.java:1719)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.openSelectedMarkers(ExtendedMarkersView.java:1188)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView$5.open(ExtendedMarkersView.java:578)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
... 83 more
!ENTRY org.eclipse.linuxtools.rpm.ui.editor 4 0 2011-11-12 23:40:02.210
!MESSAGE Unexpected Exception
!STACK 0
java.io.IOException: Cannot run program "rpm": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
at org.eclipse.linuxtools.rpm.core.utils.Utils.runCommandToInputStream(Utils.java:47)
at org.eclipse.linuxtools.rpm.core.utils.Utils.runCommandToString(Utils.java:109)
at org.eclipse.linuxtools.rpm.ui.editor.RpmPackageProposalsList.getRpmInfo(RpmPackageProposalsList.java:110)
at org.eclipse.linuxtools.rpm.ui.editor.RpmPackageProposalsList.getProposals(RpmPackageProposalsList.java:87)
at org.eclipse.linuxtools.rpm.ui.editor.scanners.SpecfilePackagesScanner.<init>(SpecfilePackagesScanner.java:69)
at org.eclipse.linuxtools.rpm.ui.editor.SpecfileConfiguration.getSpecfilePackagesScanner(SpecfileConfiguration.java:106)
at org.eclipse.linuxtools.rpm.ui.editor.SpecfileConfiguration.getPresentationReconciler(SpecfileConfiguration.java:141)
at org.eclipse.jface.text.source.SourceViewer.configure(SourceViewer.java:450)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3407)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:440)
at org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor.createPartControl(SpecfileEditor.java:195)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:493)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:479)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:1109)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.openMarkerInEditor(ExtendedMarkersView.java:1719)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.openSelectedMarkers(ExtendedMarkersView.java:1188)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView$5.open(ExtendedMarkersView.java:578)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
... 82 more
!ENTRY org.eclipse.linuxtools.rpm.ui.editor 4 0 2011-11-12 23:40:05.548
!MESSAGE Unexpected Exception
!STACK 0
java.io.IOException: Cannot run program "rpm": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
at org.eclipse.linuxtools.rpm.core.utils.Utils.runCommandToInputStream(Utils.java:47)
at org.eclipse.linuxtools.rpm.core.utils.Utils.runCommandToString(Utils.java:109)
at org.eclipse.linuxtools.rpm.ui.editor.RpmPackageProposalsList.getRpmInfo(RpmPackageProposalsList.java:110)
at org.eclipse.linuxtools.rpm.ui.editor.RpmPackageProposalsList.getProposals(RpmPackageProposalsList.java:87)
at org.eclipse.linuxtools.rpm.ui.editor.Activator.getRpmPackageList(Activator.java:130)
at org.eclipse.linuxtools.rpm.ui.editor.SpecfileHover.getHoverInfo(SpecfileHover.java:86)
at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
... 7 more

@ -1,180 +0,0 @@
--- src/kernel/qdnd_x11.cpp
+++ 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
@@ -252,20 +254,47 @@
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;
};
static QShapedPixmapWidget * qt_xdnd_deco = 0;
@@ -862,6 +891,45 @@
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 ) {
@@ -884,8 +952,10 @@
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 );
@@ -1126,7 +1196,7 @@
qt_xdnd_deco->grabMouse();
}
}
- updatePixmap();
+ updatePixmap( globalPos );
if ( qt_xdnd_source_sameanswer.contains( globalPos ) &&
qt_xdnd_source_sameanswer.isValid() ) {
@@ -1717,7 +1787,7 @@
// 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;
@@ -1732,9 +1802,8 @@
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 {
@@ -1743,4 +1812,9 @@
}
}
+void QDragManager::updatePixmap()
+{
+ updatePixmap( QCursor::pos());
+}
+
#endif // QT_NO_DRAGANDDROP
--- src/kernel/qdragobject.h
+++ src/kernel/qdragobject.h
@@ -245,6 +245,7 @@
void move( const QPoint & );
void drop();
void updatePixmap();
+ void updatePixmap( const QPoint& cursorPos );
private:
QDragObject * object;

@ -1,162 +0,0 @@
--- src/kernel/qapplication_x11.cpp
+++ src/kernel/qapplication_x11.cpp
@@ -3972,7 +3972,7 @@
// Keyboard event translation
//
-static int translateButtonState( int s )
+int qt_x11_translateButtonState( int s )
{
int bst = 0;
if ( s & Button1Mask )
@@ -4038,7 +4038,7 @@
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 )
@@ -4062,7 +4062,7 @@
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 )
@@ -4074,7 +4074,7 @@
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;
@@ -5020,7 +5020,7 @@
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
@@ -5134,7 +5134,7 @@
}
#endif // !QT_NO_XIM
- state = translateButtonState( keystate );
+ state = qt_x11_translateButtonState( keystate );
static int directionKeyEvent = 0;
if ( qt_use_rtl_extensions && type == QEvent::KeyRelease ) {
--- src/kernel/qdnd_x11.cpp
+++ src/kernel/qdnd_x11.cpp
@@ -115,6 +115,8 @@
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
@@ -199,6 +201,8 @@
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;
@@ -887,8 +891,20 @@
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;
@@ -956,6 +972,7 @@
updateMode(me->stateAfter());
move( me->globalPos() );
}
+ need_modifiers_check = FALSE;
return TRUE;
} else if ( e->type() == QEvent::MouseButtonRelease ) {
qApp->removeEventFilter( this );
@@ -994,9 +1011,11 @@
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
}
@@ -1023,10 +1042,10 @@
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;
@@ -1050,6 +1069,7 @@
}
}
oldstate = newstate;
+ return true;
}
@@ -1754,6 +1774,7 @@
qt_xdnd_source_sameanswer = QRect();
move(QCursor::pos());
heartbeat = startTimer(200);
+ need_modifiers_check = FALSE;
#ifndef QT_NO_CURSOR
qApp->setOverrideCursor( arrowCursor );
--- src/kernel/qdragobject.h
+++ src/kernel/qdragobject.h
@@ -249,7 +249,7 @@
private:
QDragObject * object;
- void updateMode( ButtonState newstate );
+ bool updateMode( ButtonState newstate );
void updateCursor();
#if defined(Q_WS_X11)
void createCursors();

@ -1,384 +0,0 @@
qt-bugs@ issue : 11790 (part of)
applied: no
author: Lubos Lunak <l.lunak@kde.org>
See 0005-qpixmap_mitshm.patch for details.
--- src/kernel/qpixmap_x11.cpp
+++ src/kernel/qpixmap_x11.cpp
@@ -1123,9 +1123,6 @@ bool QPixmap::convertFromImage( const QI
return FALSE;
int bppc = xi->bits_per_pixel;
- if ( bppc > 8 && xi->byte_order == LSBFirst )
- bppc++;
-
bool contig_bits = n_bits(red_mask) == rbits &&
n_bits(green_mask) == gbits &&
n_bits(blue_mask) == bbits;
@@ -1174,32 +1171,70 @@ bool QPixmap::convertFromImage( const QI
}
init=TRUE;
}
+
+ enum { BPP8,
+ BPP16_8_3_M3, BPP16_7_2_M3, BPP16_MSB, BPP16_LSB,
+ BPP24_MSB, BPP24_LSB,
+ BPP32_16_8_0, BPP32_MSB, BPP32_LSB
+ } mode = BPP8;
- for ( uint y=0; y<h; y++ ) {
- uchar* src = image.scanLine( y );
- uchar* dst = newbits + xi->bytes_per_line*y;
- QRgb* p = (QRgb *)src;
+ if ( bppc > 8 && xi->byte_order == LSBFirst )
+ bppc++;
-#define GET_RGB \
- int r = qRed ( *p ); \
- int g = qGreen( *p ); \
- int b = qBlue ( *p++ ); \
- r = red_shift > 0 \
- ? r << red_shift : r >> -red_shift; \
- g = green_shift > 0 \
- ? g << green_shift : g >> -green_shift; \
- b = blue_shift > 0 \
- ? b << blue_shift : b >> -blue_shift;
+ int wordsize;
+ bool bigendian;
+ qSysInfo( &wordsize, &bigendian );
+ bool same_msb_lsb = ( xi->byte_order == MSBFirst ) == ( bigendian );
+
+ if( bppc == 8 ) // 8 bit
+ mode = BPP8;
+ else if( bppc == 16 || bppc == 17 ) { // 16 bit MSB/LSB
+ if( red_shift == 8 && green_shift == 3 && blue_shift == -3
+ && !d8 && same_msb_lsb )
+ mode = BPP16_8_3_M3;
+ else if( red_shift == 7 && green_shift == 2 && blue_shift == -3
+ && !d8 && same_msb_lsb )
+ mode = BPP16_7_2_M3;
+ else
+ mode = bppc == 17 ? BPP16_LSB : BPP16_MSB;
+ } else if( bppc == 24 || bppc == 25 ) { // 24 bit MSB/LSB
+ mode = bppc == 25 ? BPP24_LSB : BPP24_MSB;
+ } else if( bppc == 32 || bppc == 33 ) { // 32 bit MSB/LSB
+ if( red_shift == 16 && green_shift == 8 && blue_shift == 0
+ && !d8 && same_msb_lsb )
+ mode = BPP32_16_8_0;
+ else
+ mode = bppc == 33 ? BPP32_LSB : BPP32_MSB;
+ } else
+ qFatal("Logic error 3");
#define GET_PIXEL \
int pixel; \
if ( d8 ) pixel = pix[*src++]; \
else { \
- GET_RGB \
- pixel = (b & blue_mask)|(g & green_mask) | (r & red_mask) \
+ int r = qRed ( *p ); \
+ int g = qGreen( *p ); \
+ int b = qBlue ( *p++ ); \
+ r = red_shift > 0 \
+ ? r << red_shift : r >> -red_shift; \
+ g = green_shift > 0 \
+ ? g << green_shift : g >> -green_shift; \
+ b = blue_shift > 0 \
+ ? b << blue_shift : b >> -blue_shift; \
+ pixel = (r & red_mask)|(g & green_mask) | (b & blue_mask) \
| ~(blue_mask | green_mask | red_mask); \
}
+// optimized case - no d8 case, shift only once instead of twice, mask only once instead of twice,
+// use direct values instead of variables, and use only one statement
+// (*p >> 16), (*p >> 8 ) and (*p) are qRed(),qGreen() and qBlue() without masking
+// shifts have to be passed including the shift operator (e.g. '>>3'), because of the direction
+#define GET_PIXEL_OPT(red_shift,green_shift,blue_shift,red_mask,green_mask,blue_mask) \
+ int pixel = ((( *p >> 16 ) red_shift ) & red_mask ) \
+ | ((( *p >> 8 ) green_shift ) & green_mask ) \
+ | ((( *p ) blue_shift ) & blue_mask ); \
+ ++p;
+
#define GET_PIXEL_DITHER_TC \
int r = qRed ( *p ); \
int g = qGreen( *p ); \
@@ -1220,91 +1255,177 @@ bool QPixmap::convertFromImage( const QI
? g << green_shift : g >> -green_shift; \
b = blue_shift > 0 \
? b << blue_shift : b >> -blue_shift; \
- int pixel = (b & blue_mask)|(g & green_mask) | (r & red_mask);
+ int pixel = (r & red_mask)|(g & green_mask) | (b & blue_mask);
- if ( dither_tc ) {
- uint x;
- switch ( bppc ) {
- case 16: // 16 bit MSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL_DITHER_TC
- *dst++ = (pixel >> 8);
- *dst++ = pixel;
- }
+// again, optimized case
+// can't be optimized that much :(
+#define GET_PIXEL_DITHER_TC_OPT(red_shift,green_shift,blue_shift,red_mask,green_mask,blue_mask, \
+ rbits,gbits,bbits) \
+ const int thres = D[x%16][y%16]; \
+ int r = qRed ( *p ); \
+ if ( r <= (255-(1<<(8-rbits))) && ((r<<rbits) & 255) \
+ > thres) \
+ r += (1<<(8-rbits)); \
+ int g = qGreen( *p ); \
+ if ( g <= (255-(1<<(8-gbits))) && ((g<<gbits) & 255) \
+ > thres) \
+ g += (1<<(8-gbits)); \
+ int b = qBlue ( *p++ ); \
+ if ( b <= (255-(1<<(8-bbits))) && ((b<<bbits) & 255) \
+ > thres) \
+ b += (1<<(8-bbits)); \
+ int pixel = (( r red_shift ) & red_mask ) \
+ | (( g green_shift ) & green_mask ) \
+ | (( b blue_shift ) & blue_mask );
+
+#define CYCLE(body) \
+ for ( uint y=0; y<h; y++ ) { \
+ uchar* src = image.scanLine( y ); \
+ uchar* dst = newbits + xi->bytes_per_line*y; \
+ QRgb* p = (QRgb *)src; \
+ body \
+ }
+
+ if ( dither_tc ) {
+ switch ( mode ) {
+ case BPP16_8_3_M3:
+ CYCLE(
+ Q_INT16* dst16 = (Q_INT16*)dst;
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL_DITHER_TC_OPT(<<8,<<3,>>3,0xf800,0x7e0,0x1f,5,6,5)
+ *dst16++ = pixel;
+ }
+ )
break;
- case 17: // 16 bit LSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL_DITHER_TC
- *dst++ = pixel;
- *dst++ = pixel >> 8;
- }
+ case BPP16_7_2_M3:
+ CYCLE(
+ Q_INT16* dst16 = (Q_INT16*)dst;
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL_DITHER_TC_OPT(<<7,<<2,>>3,0x7c00,0x3e0,0x1f,5,5,5)
+ *dst16++ = pixel;
+ }
+ )
+ break;
+ case BPP16_MSB: // 16 bit MSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL_DITHER_TC
+ *dst++ = (pixel >> 8);
+ *dst++ = pixel;
+ }
+ )
+ break;
+ case BPP16_LSB: // 16 bit LSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL_DITHER_TC
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ }
+ )
break;
default:
qFatal("Logic error");
}
- } else {
- uint x;
- switch ( bppc ) {
- case 8: // 8 bit
- for ( x=0; x<w; x++ ) {
- int pixel = pix[*src++];
- *dst++ = pixel;
- }
+ } else {
+ switch ( mode ) {
+ case BPP8: // 8 bit
+ CYCLE(
+ Q_UNUSED(p);
+ for ( uint x=0; x<w; x++ ) {
+ int pixel = pix[*src++];
+ *dst++ = pixel;
+ }
+ )
break;
- case 16: // 16 bit MSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL
- *dst++ = (pixel >> 8);
- *dst++ = pixel;
- }
+ case BPP16_8_3_M3:
+ CYCLE(
+ Q_INT16* dst16 = (Q_INT16*)dst;
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL_OPT(<<8,<<3,>>3,0xf800,0x7e0,0x1f)
+ *dst16++ = pixel;
+ }
+ )
break;
- case 17: // 16 bit LSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL
- *dst++ = pixel;
- *dst++ = pixel >> 8;
- }
+ case BPP16_7_2_M3:
+ CYCLE(
+ Q_INT16* dst16 = (Q_INT16*)dst;
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL_OPT(<<7,<<2,>>3,0x7c00,0x3e0,0x1f)
+ *dst16++ = pixel;
+ }
+ )
break;
- case 24: // 24 bit MSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL
- *dst++ = pixel >> 16;
- *dst++ = pixel >> 8;
- *dst++ = pixel;
- }
+ case BPP16_MSB: // 16 bit MSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL
+ *dst++ = (pixel >> 8);
+ *dst++ = pixel;
+ }
+ )
break;
- case 25: // 24 bit LSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL
- *dst++ = pixel;
- *dst++ = pixel >> 8;
- *dst++ = pixel >> 16;
- }
+ case BPP16_LSB: // 16 bit LSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ }
+ )
break;
- case 32: // 32 bit MSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL
- *dst++ = pixel >> 24;
- *dst++ = pixel >> 16;
- *dst++ = pixel >> 8;
- *dst++ = pixel;
- }
+ case BPP24_MSB: // 24 bit MSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL
+ *dst++ = pixel >> 16;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel;
+ }
+ )
break;
- case 33: // 32 bit LSB
- for ( x=0; x<w; x++ ) {
- GET_PIXEL
- *dst++ = pixel;
- *dst++ = pixel >> 8;
- *dst++ = pixel >> 16;
- *dst++ = pixel >> 24;
- }
+ case BPP24_LSB: // 24 bit LSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel >> 16;
+ }
+ )
break;
- default:
- qFatal("Logic error 2");
- }
- }
- }
- xi->data = (char *)newbits;
+ case BPP32_16_8_0:
+ CYCLE(
+ memcpy( dst, p, w * 4 );
+ )
+ break;
+ case BPP32_MSB: // 32 bit MSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL
+ *dst++ = pixel >> 24;
+ *dst++ = pixel >> 16;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel;
+ }
+ )
+ break;
+ case BPP32_LSB: // 32 bit LSB
+ CYCLE(
+ for ( uint x=0; x<w; x++ ) {
+ GET_PIXEL
+ *dst++ = pixel;
+ *dst++ = pixel >> 8;
+ *dst++ = pixel >> 16;
+ *dst++ = pixel >> 24;
+ }
+ )
+ break;
+ default:
+ qFatal("Logic error 2");
+ }
+ }
+ xi->data = (char *)newbits;
}
if ( d == 8 && !trucol ) { // 8 bit pixmap
@@ -1554,15 +1675,24 @@ bool QPixmap::convertFromImage( const QI
if (image.depth() == 32) {
const int *iptr = (const int *) image.bits();
- int max = w * h;
- while (max--)
- *aptr++ = *iptr++ >> 24; // squirt
+ if( axi->bytes_per_line == (int)w ) {
+ int max = w * h;
+ while (max--)
+ *aptr++ = *iptr++ >> 24; // squirt
+ } else {
+ for (uint i = 0; i < h; ++i ) {
+ for (uint j = 0; j < w; ++j )
+ *aptr++ = *iptr++ >> 24; // squirt
+ aptr += ( axi->bytes_per_line - w );
+ }
+ }
} else if (image.depth() == 8) {
const QRgb * const rgb = image.colorTable();
for (uint y = 0; y < h; ++y) {
const uchar *iptr = image.scanLine(y);
for (uint x = 0; x < w; ++x)
*aptr++ = qAlpha(rgb[*iptr++]);
+ aptr += ( axi->bytes_per_line - w );
}
}

@ -1,19 +0,0 @@
--- src/kernel/qdragobject.cpp
+++ src/kernel/qdragobject.cpp
@@ -893,6 +893,16 @@
{
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;

@ -1,23 +0,0 @@
qt-bugs@ issue: N46882
bugs.kde.org number: 77545
applied: no
author: Stephan Binner <binner@kde.org>
Fix wrong K menu width for the case of enabled side pixmap and a menu title
(like "Recently Used Applications") being longer than every other entry.
Solution: Respect PanelKMenu::setMaximumSize() as up to Qt 3.2.3
Index: src/widgets/qpopupmenu.cpp
================================================================================
--- src/widgets/qpopupmenu.cpp
+++ src/widgets/qpopupmenu.cpp
@@ -2530,7 +2530,7 @@
constPolish();
QPopupMenu* that = (QPopupMenu*) this;
//We do not need a resize here, just the sizeHint..
- return that->updateSize(FALSE, FALSE).expandedTo( QApplication::globalStrut() );
+ return that->updateSize(FALSE).expandedTo( QApplication::globalStrut() );
}

@ -1,3 +1,3 @@
<services>
<service name="download_files"><param name="enforceupstream">yes</param><param name="enforcelocal">yes</param><param name="recompress">yes</param></service>
<service name="download_files"><param name="recompress">yes</param></service>
</services>

@ -66,23 +66,14 @@ Patch1: aliasing.diff
Patch2: head.diff
Patch4: qt3-never-strip.diff
Patch5: external-libs.diff
Patch6: 0001-dnd_optimization.patch
Patch7: 0002-dnd_active_window_fix.patch
Patch8: 0007-qpixmap_constants.patch
Patch11: 0038-dragobject-dont-prefer-unknown.patch
Patch12: qtrc-path.diff
Patch14: lib64-plugin-support.diff
Patch15: pluginmanager-fix.diff
Patch18: no-rpath.dif
Patch19: shut-up.diff
Patch20: rubberband.diff
Patch21: fix-GL-loading.diff
Patch23: fix-accessible.diff
# From http://www.freedesktop.org/wiki/Software_2fImmoduleQtDownload
# Current version from http://freedesktop.org/~daisuke/qt-x11-immodule-unified-qt3.3.5-20060318.diff.bz2
Patch25: qt-x11-immodule-unified-qt3.3.8-20060318.diff
Patch28: fix-key-release-event-with-imm.diff
Patch29: 0047-fix-kmenu-width.diff
Patch31: limit-image-size.diff
Patch34: 0005-qpixmap_mitshm.patch
Patch35: qt-transparency.patch
@ -149,10 +140,6 @@ getting started with Qt in /usr/lib/qt3/doc.
%patch2
%patch4
%patch5
%patch6
%patch7
%patch8
%patch11
%patch12
if [ "%_lib" = "lib64" ]; then
%patch14
@ -160,11 +147,8 @@ fi
%patch15
%patch18
%patch19
%patch20
%patch23
%patch25
%patch28
%patch29
#%patch28
%patch31
%patch34
%patch35
@ -210,7 +194,6 @@ fi
%patch138 -p1
%endif
%patch139
%patch200
# copy qt kde integration files
cp %SOURCE100 %SOURCE101 src/kernel/
cp %SOURCE101 include/private/

@ -46,7 +46,7 @@ Source9: linguist.desktop
Source5: linguist.png
Source10: qt3.sh
Source11: qt3.csh
# Translations did not change at 3.3.8c
# Translations did not change at 3.3.8d
Source12: qt3-3.3.8b-translations.tar.bz2
Source100: qtkdeintegration_x11.cpp
Source101: qtkdeintegration_x11_p.h
@ -57,23 +57,14 @@ Patch1: aliasing.diff
Patch2: head.diff
Patch4: qt3-never-strip.diff
Patch5: external-libs.diff
Patch6: 0001-dnd_optimization.patch
Patch7: 0002-dnd_active_window_fix.patch
Patch8: 0007-qpixmap_constants.patch
Patch11: 0038-dragobject-dont-prefer-unknown.patch
Patch12: qtrc-path.diff
Patch14: lib64-plugin-support.diff
Patch15: pluginmanager-fix.diff
Patch18: no-rpath.dif
Patch19: shut-up.diff
Patch20: rubberband.diff
Patch21: fix-GL-loading.diff
Patch23: fix-accessible.diff
# From http://www.freedesktop.org/wiki/Software_2fImmoduleQtDownload
# Current version from http://freedesktop.org/~daisuke/qt-x11-immodule-unified-qt3.3.5-20060318.diff.bz2
Patch25: qt-x11-immodule-unified-qt3.3.8-20060318.diff
Patch28: fix-key-release-event-with-imm.diff
Patch29: 0047-fix-kmenu-width.diff
Patch31: limit-image-size.diff
Patch34: 0005-qpixmap_mitshm.patch
Patch35: qt-transparency.patch
@ -115,15 +106,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
This package contains extension libraries for Qt 3, such as the
Netscape plug-in modules.
This package contains extension libraries for Qt 3, such as the
Netscape plug-in modules.
This package contains extension libraries for Qt 3, such as the
Netscape plug-in modules.
This package contains extension libraries for Qt 3, such as the
Netscape plug-in modules.
%define build_sub_dirs src plugins/src tools/designer/uilib/ tools/designer/uic tools/qtconfig tools/assistant/lib tools/assistant tutorial
%prep
@ -132,10 +114,6 @@ Netscape plug-in modules.
%patch2
%patch4
%patch5
%patch6
%patch7
%patch8
%patch11
%patch12
if [ "%_lib" = "lib64" ]; then
%patch14
@ -143,11 +121,8 @@ fi
%patch15
%patch18
%patch19
%patch20
%patch23
%patch25
%patch28
%patch29
#%patch28
%patch31
%patch34
%patch35
@ -193,7 +168,6 @@ fi
%patch138 -p1
%endif
%patch139
%patch200
# copy qt kde integration files
cp %SOURCE100 %SOURCE101 src/kernel/
cp %SOURCE101 include/private/

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sun Nov 13 22:40:37 UTC 2011 - robxu9@gmail.com
- Remove 0001-dnd_optimization.patch; upstream
-------------------------------------------------------------------
Sun Nov 13 16:28:34 UTC 2011 - robxu9@gmail.com
- Qt3 has a new upstream; update to 3.3.8d
-------------------------------------------------------------------
Fri Sep 23 10:16:33 UTC 2011 - coolo@suse.com

@ -65,23 +65,14 @@ Patch1: aliasing.diff
Patch2: head.diff
Patch4: qt3-never-strip.diff
Patch5: external-libs.diff
Patch6: 0001-dnd_optimization.patch
Patch7: 0002-dnd_active_window_fix.patch
Patch8: 0007-qpixmap_constants.patch
Patch11: 0038-dragobject-dont-prefer-unknown.patch
Patch12: qtrc-path.diff
Patch14: lib64-plugin-support.diff
Patch15: pluginmanager-fix.diff
Patch18: no-rpath.dif
Patch19: shut-up.diff
Patch20: rubberband.diff
Patch21: fix-GL-loading.diff
Patch23: fix-accessible.diff
# From http://www.freedesktop.org/wiki/Software_2fImmoduleQtDownload
# Current version from http://freedesktop.org/~daisuke/qt-x11-immodule-unified-qt3.3.5-20060318.diff.bz2
Patch25: qt-x11-immodule-unified-qt3.3.8-20060318.diff
Patch28: fix-key-release-event-with-imm.diff
Patch29: 0047-fix-kmenu-width.diff
Patch31: limit-image-size.diff
Patch34: 0005-qpixmap_mitshm.patch
Patch35: qt-transparency.patch
@ -140,10 +131,6 @@ the current Qt library!
%patch2
%patch4
%patch5
%patch6
%patch7
%patch8
%patch11
%patch12
if [ "%_lib" = "lib64" ]; then
%patch14
@ -151,11 +138,8 @@ fi
%patch15
%patch18
%patch19
%patch20
%patch23
%patch25
%patch28
%patch29
#%patch28
%patch31
%patch34
%patch35
@ -201,7 +185,6 @@ fi
%patch138 -p1
%endif
%patch139
%patch200
# copy qt kde integration files
cp %SOURCE100 %SOURCE101 src/kernel/
cp %SOURCE101 include/private/

@ -1,339 +0,0 @@
--- src/iconview/qiconview.cpp
+++ src/iconview/qiconview.cpp
@@ -261,6 +261,7 @@
QIconViewToolTip *toolTip;
QPixmapCache maskCache;
+ QPixmap *backrubber;
QPtrDict<QIconViewItem> selectedItems;
struct ItemContainer {
@@ -1975,14 +1976,27 @@
if ( picture() ) {
QPicture *pic = picture();
if ( isSelected() ) {
- p->fillRect( pixmapRect( FALSE ), QBrush( cg.highlight(), QBrush::Dense4Pattern) );
+ p->setBrush( QBrush( cg.highlight(), QBrush::Dense4Pattern ) );
+ p->setPen( QPen( cg.highlight(), QBrush::Dense4Pattern ) );
+ p->drawRoundRect( pixmapRect( FALSE ),
+ 1000 / pixmapRect( FALSE ).width(),
+ 1000 / pixmapRect( FALSE ).height() );
}
p->drawPicture( x()-pic->boundingRect().x(), y()-pic->boundingRect().y(), *pic );
if ( isSelected() ) {
- p->fillRect( textRect( FALSE ), cg.highlight() );
+ p->setBrush( QBrush( cg.highlight() ) );
+ p->setPen( QPen( cg.highlight() ) );
+ p->drawRoundRect( textRect( FALSE ),
+ 1000 / textRect( FALSE ).width(),
+ 1000 / textRect( FALSE ).height() );
p->setPen( QPen( cg.highlightedText() ) );
- } else if ( view->d->itemTextBrush != NoBrush )
- p->fillRect( textRect( FALSE ), view->d->itemTextBrush );
+ } else if ( view->d->itemTextBrush != NoBrush ) {
+ p->setBrush( view->d->itemTextBrush );
+ p->setPen( QPen( view->d->itemTextBrush.color() ) );
+ p->drawRoundRect( textRect( FALSE ),
+ 1000 / textRect( FALSE ).width(),
+ 1000 / textRect( FALSE ).height() );
+ }
int align = view->itemTextPos() == QIconView::Bottom ? AlignHCenter : AlignAuto;
if ( view->d->wordWrapIconText )
@@ -2040,10 +2054,19 @@
p->save();
if ( isSelected() ) {
- p->fillRect( textRect( FALSE ), cg.highlight() );
+ p->setBrush( QBrush( cg.highlight() ) );
+ p->setPen( QPen( cg.highlight() ) );
+ p->drawRoundRect( textRect( FALSE ),
+ 1000 / textRect( FALSE ).width(),
+ 1000 / textRect( FALSE ).height() );
p->setPen( QPen( cg.highlightedText() ) );
- } else if ( view->d->itemTextBrush != NoBrush )
- p->fillRect( textRect( FALSE ), view->d->itemTextBrush );
+ } else if ( view->d->itemTextBrush != NoBrush ) {
+ p->setBrush( view->d->itemTextBrush );
+ p->setPen( QPen( view->d->itemTextBrush.color() ) );
+ p->drawRoundRect( textRect( FALSE ),
+ 1000 / textRect( FALSE ).width(),
+ 1000 / textRect( FALSE ).height() );
+ }
int align = AlignHCenter;
if ( view->d->wordWrapIconText )
@@ -2059,31 +2082,13 @@
/*!
Paints the focus rectangle of the item using the painter \a p and
the color group \a cg.
+
+ The default implementation does nothing; subclasses may
+ reimplement this function.
*/
-void QIconViewItem::paintFocus( QPainter *p, const QColorGroup &cg )
+void QIconViewItem::paintFocus( QPainter *, const QColorGroup & )
{
- if ( !view )
- return;
-
- view->style().drawPrimitive(QStyle::PE_FocusRect, p,
- QRect( textRect( FALSE ).x(), textRect( FALSE ).y(),
- textRect( FALSE ).width(),
- textRect( FALSE ).height() ), cg,
- (isSelected() ?
- QStyle::Style_FocusAtBorder :
- QStyle::Style_Default),
- QStyleOption(isSelected() ? cg.highlight() : cg.base()));
-
- if ( this != view->d->currentItem ) {
- view->style().drawPrimitive(QStyle::PE_FocusRect, p,
- QRect( pixmapRect( FALSE ).x(),
- pixmapRect( FALSE ).y(),
- pixmapRect( FALSE ).width(),
- pixmapRect( FALSE ).height() ),
- cg, QStyle::Style_Default,
- QStyleOption(cg.base()));
- }
}
/*!
@@ -2781,6 +2786,7 @@
d->renamingItem = 0;
d->drawActiveSelection = TRUE;
d->drawDragShapes = FALSE;
+ d->backrubber = 0;
connect( d->adjustTimer, SIGNAL( timeout() ),
this, SLOT( adjustItems() ) );
@@ -3265,7 +3271,7 @@
void QIconView::doAutoScroll()
{
- QRect oldRubber = QRect( *d->rubber );
+ QRect oldRubber = *d->rubber;
QPoint vp = viewport()->mapFromGlobal( QCursor::pos() );
QPoint pos = viewportToContents( vp );
@@ -3282,7 +3288,6 @@
bool block = signalsBlocked();
QRect rr;
- QRegion region( 0, 0, visibleWidth(), visibleHeight() );
blockSignals( TRUE );
viewport()->setUpdatesEnabled( FALSE );
@@ -3308,9 +3313,6 @@
item->setSelected( TRUE, TRUE );
changed = TRUE;
rr = rr.unite( item->rect() );
- } else {
- region = region.subtract( QRect( contentsToViewport( item->pos() ),
- item->size() ) );
}
minx = QMIN( minx, item->x() - 1 );
@@ -3327,42 +3329,77 @@
viewport()->setUpdatesEnabled( TRUE );
blockSignals( block );
- QRect r = *d->rubber;
- *d->rubber = oldRubber;
-
- QPainter p;
- p.begin( viewport() );
- p.setRasterOp( NotROP );
- p.setPen( QPen( color0, 1 ) );
- p.setBrush( NoBrush );
- drawRubber( &p );
- d->dragging = FALSE;
- p.end();
-
- *d->rubber = r;
-
- if ( changed ) {
- d->drawAllBack = FALSE;
- d->clipRegion = region;
- repaintContents( rr, FALSE );
- d->drawAllBack = TRUE;
+ // static bool drawAll;
+ if ( d->backrubber == 0 ) {
+ d->backrubber = new QPixmap( viewport()->rect().size() );
+ d->backrubber->fill( viewport(), viewport()->rect().topLeft() );
+ // drawAll = true;
}
+ // int oldX = 0, oldY = 0;
+ // if ( !drawAll && d->scrollTimer ) {
+ // oldX = contentsX();
+ // oldY = contentsY();
+ // }
ensureVisible( pos.x(), pos.y() );
+ // if ( !drawAll && d->scrollTimer && ( oldX != contentsX() || oldY != contentsY() ) )
+ // drawAll = true;
- p.begin( viewport() );
- p.setRasterOp( NotROP );
- p.setPen( QPen( color0, 1 ) );
- p.setBrush( NoBrush );
- drawRubber( &p );
- d->dragging = TRUE;
+ QRect allRect = oldRubber.normalize();
+ if ( changed )
+ allRect |= rr.normalize();
+ allRect |= d->rubber->normalize();
+ QPoint point = contentsToViewport( allRect.topLeft() );
+ allRect = QRect( point.x(), point.y(), allRect.width(), allRect.height() );
+ allRect &= viewport()->rect();
+
+ d->dragging = FALSE;
+
+ QPainter p( d->backrubber );
+ p.translate( -contentsX(), -contentsY() );
+#if 0
+ if ( !drawAll ) {
+ oldRubber = oldRubber.normalize();
+ point = contentsToViewport( oldRubber.topLeft() );
+ oldRubber = QRect( point.x(), point.y(), oldRubber.width(), oldRubber.height() );
+ oldRubber &= viewport()->rect();
+
+ point = contentsToViewport( nr.topLeft() );
+ nr = QRect( point.x(), point.y(), nr.width(), nr.height() );
+ nr &= viewport()->rect();
+
+ QRegion region;
+ if ( allRect != nr )
+ region = QRegion(allRect).subtract( QRegion( nr ) );
+ if ( allRect != oldRubber )
+ region += QRegion(allRect).subtract( QRegion( oldRubber ) );
+
+ QMemArray< QRect > ar = region.rects();
+ for ( uint i = 0; i < ar.size(); ++i ) {
+ ar[i].addCoords( -2, -2, 4, 4 );
+ ar[i] = ar[i].normalize();
+
+ p.setClipRect( ar[i] );
+ drawContents( &p, contentsX() + ar[i].left(), contentsY() + ar[i].top(), ar[i].width(), ar[i].height() );
+ }
+ }
+ else
+#endif
+ {
+ drawContents( &p,
+ contentsX() + allRect.left(), contentsY() + allRect.top(),
+ allRect.width(), allRect.height() );
+ }
p.end();
+ // drawAll = false;
+ d->dragging = TRUE;
+ bitBlt( viewport(), allRect.topLeft(), d->backrubber, allRect );
if ( changed ) {
emit selectionChanged();
- if ( d->selectionMode == Single )
- emit selectionChanged( d->currentItem );
+ if ( d->selectionMode == Single )
+ emit selectionChanged( d->currentItem );
}
if ( !QRect( 50, 50, viewport()->width()-100, viewport()->height()-100 ).contains( vp ) &&
@@ -3389,9 +3426,7 @@
void QIconView::drawContents( QPainter *p, int cx, int cy, int cw, int ch )
{
- if ( d->dragging && d->rubber )
- drawRubber( p );
-
+ p->save();
QRect r = QRect( cx, cy, cw, ch );
QIconViewPrivate::ItemContainer *c = d->firstContainer;
@@ -3465,8 +3500,16 @@
d->currentItem->paintFocus( p, colorGroup() );
}
- if ( d->dragging && d->rubber )
- drawRubber( p );
+ p->restore();
+ if ( d->rubber ) {
+ p->save();
+ p->translate( contentsX(), contentsY() );
+ p->setRasterOp( NotROP );
+ p->setPen( QPen( color0, 1 ) );
+ p->setBrush( NoBrush );
+ drawRubber( p );
+ p->restore();
+ }
}
/*!
@@ -4365,17 +4408,15 @@
void QIconView::contentsMousePressEventEx( QMouseEvent *e )
{
if ( d->rubber ) {
- QPainter p;
- p.begin( viewport() );
- p.setRasterOp( NotROP );
- p.setPen( QPen( color0, 1 ) );
- p.setBrush( NoBrush );
+ QRect r( d->rubber->normalize() );
+ delete d->rubber;
+ d->rubber = 0;
+
+ repaintContents( r, FALSE );
+ d->dragging = FALSE;
- drawRubber( &p );
- d->dragging = FALSE;
- p.end();
- delete d->rubber;
- d->rubber = 0;
+ delete d->backrubber;
+ d->backrubber = 0;
if ( d->scrollTimer ) {
disconnect( d->scrollTimer, SIGNAL( timeout() ), this, SLOT( doAutoScroll() ) );
@@ -4560,21 +4601,17 @@
d->startDragItem = 0;
if ( d->rubber ) {
- QPainter p;
- p.begin( viewport() );
- p.setRasterOp( NotROP );
- p.setPen( QPen( color0, 1 ) );
- p.setBrush( NoBrush );
-
- drawRubber( &p );
- d->dragging = FALSE;
- p.end();
-
+ QRect r(d->rubber->normalize());
+
if ( ( d->rubber->topLeft() - d->rubber->bottomRight() ).manhattanLength() >
QApplication::startDragDistance() )
emitClicked = FALSE;
delete d->rubber;
- d->rubber = 0;
+ d->rubber = 0;
+ repaintContents(r, FALSE);
+ d->dragging = FALSE;
+ delete d->backrubber;
+ d->backrubber = 0;
d->currentItem = d->tmpCurrentItem;
d->tmpCurrentItem = 0;
if ( d->currentItem )
@@ -5334,9 +5371,9 @@
QPoint pnt( d->rubber->x(), d->rubber->y() );
pnt = contentsToViewport( pnt );
- style().drawPrimitive(QStyle::PE_RubberBand, p,
- QRect(pnt.x(), pnt.y(), d->rubber->width(), d->rubber->height()),
- colorGroup(), QStyle::Style_Default, QStyleOption(colorGroup().base()));
+ style().drawPrimitive( QStyle::PE_RubberBand, p,
+ QRect( pnt.x(), pnt.y(), d->rubber->width(), d->rubber->height() ).normalize(),
+ colorGroup(), QStyle::Style_Default, QStyleOption(colorGroup().base()) );
}
/*!
Loading…
Cancel
Save