Move to root

This commit is contained in:
Mario Fetka
2012-01-14 09:45:05 +01:00
parent d884fb4a6d
commit 5253d3ea35
482 changed files with 0 additions and 578 deletions

View File

@@ -0,0 +1,187 @@
qt-bugs@ issue : 16115
applied: no
author: Lubos Lunak <l.lunak@kde.org>
See http://lists.kde.org/?t=104388858900001&r=1&w=2
--- src/kernel/qdnd_x11.cpp.sav 2003-02-05 16:09:45.000000000 +0100
+++ src/kernel/qdnd_x11.cpp 2003-02-07 16:14:49.000000000 +0100
@@ -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
--- src/kernel/qdragobject.h.sav 2002-11-01 19:25:07.000000000 +0100
+++ src/kernel/qdragobject.h 2001-01-01 01:01:00.000000000 +0100
@@ -245,6 +245,7 @@ private:
void move( const QPoint & );
void drop();
void updatePixmap();
+ void updatePixmap( const QPoint& cursorPos );
private:
QDragObject * object;

View File

@@ -0,0 +1,189 @@
qt-bugs@ issue : 25122
applied: no
author: Lubos Lunak <l.lunak@kde.org>
Hello,
for example: Open Konqueror window, showing some files. Start dragging one
desktop icon. If you press/release Ctrl, there'll be a '+' attached to the
icon, showing the DND operation. Now, while still doing DND, make the
Konqueror window active (Alt+Tab with KDE-3.1.2+, hover over its taskbar
entry, Ctrl+Fn to switch to a different virtual desktop, etc.). As soon as
the app performing DND is not the active application, and the mouse is not
moving, pressing/releasing Ctrl doesn't do anything, the state only updates
when the mouse is moved.
This is caused by the fact that Qt has only pointer grab when doing DND, but
doesn't have keyboard grab. I actually consider this a good thing, because
the only keys important for DND are modifiers, and they come together with
pointer events, and not having keyboard grab allows using keyboard shortcuts
like Alt+Tab while DND. However, when the mouse is not moved, and only a
modifier key is pressed/released, the app won't get any mouse event, and
won't also get the keyboard event.
The attached patch changes Qt to explicitly check the modifiers state using
XQueryPointer() if there's wasn't recently any mouse/keyboard event, which
ensures the state is updated even in the situation described above.
--- src/kernel/qapplication_x11.cpp.sav 2003-06-21 12:31:35.000000000 +0200
+++ src/kernel/qapplication_x11.cpp 2003-06-21 12:35:44.000000000 +0200
@@ -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 ) {
--- src/kernel/qdnd_x11.cpp.sav 2003-06-30 15:26:42.000000000 +0200
+++ src/kernel/qdnd_x11.cpp 2003-06-30 15:32:23.000000000 +0200
@@ -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 );
--- src/kernel/qdragobject.h.sav 2003-05-19 22:34:43.000000000 +0200
+++ src/kernel/qdragobject.h 2001-01-01 01:01:00.000000000 +0100
@@ -248,7 +248,7 @@ private:
private:
QDragObject * object;
- void updateMode( ButtonState newstate );
+ bool updateMode( ButtonState newstate );
void updateCursor();
QWidget * dragSource;

View File

@@ -0,0 +1,57 @@
qt-bugs@ issue : 38642
bugs.kde.org number : 71084
applied: no
author: Lubos Lunak <l.lunak@kde.org>
Hello,
start Mozilla, go e.g. to http://kde.org, start KWrite (or basically any Qt
app that accepts text drops), select 'Conquer your Desktop!', and try to
drag&drop it onto KWrite. The only text pasted should be 'm'.
I don't know much the related mimetype and encoding stuff, so I'm unsure
whose fault this actually is. The text drag is provided as a lot of
text/something targets, to list some text/_moz_htmlinfo, text/x-moz-url,
text/unicode and similar. The problem is, Kate uses QTextDrag::decode() with
no subtype specified, probably with the intention that as Kate is a text
editor, it can accept any text pasted. And since the first target provided by
mozilla is text/x-moz-url, (which moreover seems to be encoded as 16bit
unicode), the text dropped is completely wrong. You can easily see all
targets provided by Mozilla with see_mime.patch applied.
Solution #1: Say that Kate (any pretty much everybody else expecting text)
should say "plain" as the subtype. In such case, I suggest you drop the
QTextDrag::decode() variant with no subtype specified, and stress more the
fact that not specifying a subtype can result in a lot of rubbish. It's
simply too tempting to leave the subtype empty and try to accept anything.
Solution #2: When trying to accept anything, try to get useful data. Which
means either sorting the subtypes available somehow, checking only the ones
Qt knows.
To me, #1 seems to be a better choice, or possibly at least something like
the attached QTextDrag patch, which simply always tries first "plain" subtype
if none is specified. With this patch, Mozilla even works (that's irony, of
course, Mozilla still pastes the text/plain text as HTML, but at least now it
pastes something where it's easy to point at the offender).
--- src/kernel/qdragobject.cpp.sav 2004-01-06 19:24:35.000000000 +0100
+++ src/kernel/qdragobject.cpp 2004-01-06 19:47:01.000000000 +0100
@@ -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;

View File

@@ -0,0 +1,38 @@
qt-bugs@ issue : N45716
applied: no
author: Enrico Ros <eros.kde@email.it>
QScrollView unwanted repaint fix.
This fixes the 'flashing' konqueror window on activation / deactivation by
saving 1 unwanted repaint (when konqueror window has background).
I tracked down to the problem to the internal QViewportWidget of the
QScrollView class.
When a window is activated the activation event is recursively propagated
to all childs triggering the windowActivationChange() functions in the
widget it passes by.
What happens when the event gets to the Viewport?
At this point the event has already been handled by windowActivationChange()
of the parent widget (a QIconView for example) and has then been propagated
to the Viewport that will handle it with the default
QWidget::windowActivationChange implementation, maybe raising an unwanted
update(); so here we stop the event.
As an addition: if the parent reimplements the windowActivationChange()
function, mainly to block the update, it won't be happy if the child will
trigger the update. If the parent do not reimplement the function il will
inherits the default implementation and there is no need for the viewport's
one.
--- src/widgets/qscrollview.cpp.orig 2004-03-29 10:17:04.000000000 +0000
+++ src/widgets/qscrollview.cpp 2004-03-30 16:40:07.599978320 +0000
@@ -1551,6 +1551,9 @@
case QEvent::LayoutHint:
d->autoResizeHint(this);
break;
+ case QEvent::WindowActivate:
+ case QEvent::WindowDeactivate:
+ return TRUE;
default:
break;
}

View File

@@ -0,0 +1,25 @@
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
===================================================================
RCS file: /home/kde/qt-copy/src/widgets/qpopupmenu.cpp,v
retrieving revision 1.60
diff -u -3 -p -b -r1.60 qpopupmenu.cpp
--- src/widgets/qpopupmenu.cpp 29 Apr 2004 22:31:28 -0000 1.60
+++ src/widgets/qpopupmenu.cpp 30 Apr 2004 01:11:59 -0000
@@ -2531,7 +2531,7 @@ QSize QPopupMenu::sizeHint() const
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() );
}

View File

@@ -0,0 +1,48 @@
qt-bugs@ issue : none, probably even won't be
bugs.kde.org number : 80072
applied: no
author: Lubos Lunak <l.lunak@kde.org>
A crude hack for KDE #80072. No good idea how to fix it properly yet :(.
--- src/kernel/qclipboard_x11.cpp.sav 2004-04-30 12:00:06.000000000 +0200
+++ src/kernel/qclipboard_x11.cpp 2004-05-09 21:18:10.269264304 +0200
@@ -109,6 +109,7 @@ static int pending_timer_id = 0;
static bool pending_clipboard_changed = FALSE;
static bool pending_selection_changed = FALSE;
+Q_EXPORT bool qt_qclipboard_bailout_hack = false;
// event capture mechanism for qt_xclb_wait_for_event
static bool waiting_for_data = FALSE;
@@ -453,6 +454,15 @@ static int qt_xclb_event_filter(XEvent *
return 0;
}
+static bool selection_request_pending = false;
+
+static Bool check_selection_request_pending( Display*, XEvent* e, XPointer )
+ {
+ if( e->type == SelectionRequest && e->xselectionrequest.owner == owner->winId())
+ selection_request_pending = true;
+ return False;
+ }
+
bool qt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event,
int timeout )
{
@@ -504,6 +514,14 @@ bool qt_xclb_wait_for_event( Display *dp
do {
if ( XCheckTypedWindowEvent(dpy,win,type,event) )
return TRUE;
+ if( qt_qclipboard_bailout_hack ) {
+ XEvent dummy;
+ selection_request_pending = false;
+ if ( owner != NULL )
+ XCheckIfEvent(dpy,&dummy,check_selection_request_pending,NULL);
+ if( selection_request_pending )
+ return TRUE;
+ }
now = QTime::currentTime();
if ( started > now ) // crossed midnight

View File

@@ -0,0 +1,22 @@
--- qt-x11-free-3.3.8-orig/configure 2008-10-28 15:43:35.000000000 +0100
+++ qt-x11-free-3.3.8/configure 2008-10-28 15:45:48.000000000 +0100
@@ -3079,15 +3079,15 @@
g++*)
# GNU C++
QMAKE_CONF_COMPILER=`grep "QMAKE_CXX[^_A-Z0-9a-z]" $QMAKESPEC/qmake.conf | sed "s,.* *= *\(.*\)$,\1,"`
- COMPILER_VERSION=`${QMAKE_CONF_COMPILER} --version 2>/dev/null`
+ COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
case "$COMPILER_VERSION" in
- *2.95.*)
+ 2.95.*)
COMPILER_VERSION="2.95.*"
;;
- *3.*)
+ 3.*)
COMPILER_VERSION="3.*"
;;
- *4.*)
+ 4.*)
COMPILER_VERSION="4"
;;
*)

View File

@@ -0,0 +1,20 @@
--- plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.cpp~ 2007-04-05 09:47:44.000000000 +0000
+++ plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.cpp 2007-04-05 09:48:08.000000000 +0000
@@ -44,6 +44,7 @@
#include "qnoneinputcontextplugin.h"
#include <qinputcontextfactory.h>
#include <qsettings.h>
+#include <cstdlib>
QNoneInputContextPlugin::QNoneInputContextPlugin()
--- plugins/src/inputmethods/simple/qsimpleinputcontext.cpp~ 2007-04-05 09:48:46.000000000 +0000
+++ plugins/src/inputmethods/simple/qsimpleinputcontext.cpp 2007-04-05 09:48:54.000000000 +0000
@@ -45,6 +45,7 @@
#include <qnamespace.h>
#include <qevent.h>
#include <qglobal.h>
+#include <algorithm>
static const int ignoreKeys[] = {
Qt::Key_Shift,

View File

@@ -0,0 +1,42 @@
--- qt-x11-free-3.3.8b-x/src/kernel/qpngio.cpp 2008-01-15 20:09:13.000000000 +0100
+++ qt-x11-free-3.3.8b/src/kernel/qpngio.cpp 2010-02-16 00:13:11.000000000 +0100
@@ -162,7 +162,11 @@
image.setColor( i, qRgba(c,c,c,0xff) );
}
if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) {
+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 )
+ const int g = info_ptr->trans_color.gray;
+#else
const int g = info_ptr->trans_values.gray;
+#endif
if (g < ncols) {
image.setAlphaBuffer(TRUE);
image.setColor(g, image.color(g) & RGB_MASK);
@@ -190,7 +194,11 @@
info_ptr->palette[i].red,
info_ptr->palette[i].green,
info_ptr->palette[i].blue,
+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 )
+ info_ptr->trans_alpha[i]
+#else
info_ptr->trans[i]
+#endif
)
);
i++;
@@ -324,9 +332,15 @@
png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)
if (image.depth()==32 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
QRgb trans = 0xFF000000 | qRgb(
+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 )
+ (info_ptr->trans_color.red << 8 >> bit_depth)&0xff,
+ (info_ptr->trans_color.green << 8 >> bit_depth)&0xff,
+ (info_ptr->trans_color.blue << 8 >> bit_depth)&0xff);
+#else
(info_ptr->trans_values.red << 8 >> bit_depth)&0xff,
(info_ptr->trans_values.green << 8 >> bit_depth)&0xff,
(info_ptr->trans_values.blue << 8 >> bit_depth)&0xff);
+#endif
for (uint y=0; y<height; y++) {
for (uint x=0; x<info_ptr->width; x++) {
if (((uint**)jt)[y][x] == trans) {

View File

@@ -0,0 +1,39 @@
Bug 210551.
Fix compilation on mips
Original commit message by Christopher Martin, debian bug 342545.
* Add a patch, courtesy of Steve Langasek, that fixes
qt-x11-free's longstanding intermittent FTBFS on hppa, caused
by "the bogus assumption in src/tools/qlocale.cpp that a
char[] can be cast to a double *." (Closes: #342545)
--- qt-x11-free-3.3.6.orig/src/tools/qlocale.cpp
+++ qt-x11-free-3.3.6/src/tools/qlocale.cpp
@@ -122,13 +122,24 @@
#endif
// We can't rely on -NAN, since all operations on a NAN should return a NAN.
+static double be_neg_nan;
+static double le_neg_nan;
static const unsigned char be_neg_nan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 };
static const unsigned char le_neg_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff };
+static bool neg_nan_init = false;
+
static inline double negNan()
{
+ if (!neg_nan_init)
+ {
+ memcpy(&be_neg_nan,be_neg_nan_bytes,sizeof(be_neg_nan_bytes));
+ memcpy(&le_neg_nan,le_neg_nan_bytes,sizeof(le_neg_nan_bytes));
+ neg_nan_init = true;
+ }
return (ByteOrder == BigEndian ?
- *((const double *) be_neg_nan_bytes) :
- *((const double *) le_neg_nan_bytes));
+ be_neg_nan :
+ le_neg_nan);
+
}
// Sizes as defined by the ISO C99 standard - fallback

View File

@@ -0,0 +1,49 @@
--- src/kernel/qapplication_x11.cpp.sav 2006-06-01 13:31:04.000000000 +0200
+++ src/kernel/qapplication_x11.cpp 2006-06-01 13:33:07.000000000 +0200
@@ -271,6 +271,7 @@ Atom qt_net_wm_frame_strut = 0; // KDE
Atom qt_net_wm_state_stays_on_top = 0; // KDE extension
Atom qt_net_wm_pid = 0;
Atom qt_net_wm_user_time = 0;
+Atom qt_net_wm_full_placement = 0; // KDE extension
// Enlightenment support
Atom qt_enlightenment_desktop = 0;
@@ -1922,6 +1923,7 @@ void qt_init_internal( int *argcptr, cha
&qt_net_wm_state_stays_on_top );
qt_x11_intern_atom( "_NET_WM_PID", &qt_net_wm_pid );
qt_x11_intern_atom( "_NET_WM_USER_TIME", &qt_net_wm_user_time );
+ qt_x11_intern_atom( "_NET_WM_FULL_PLACEMENT", &qt_net_wm_full_placement );
qt_x11_intern_atom( "ENLIGHTENMENT_DESKTOP", &qt_enlightenment_desktop );
qt_x11_intern_atom( "_NET_WM_NAME", &qt_net_wm_name );
qt_x11_intern_atom( "_NET_WM_ICON_NAME", &qt_net_wm_icon_name );
--- src/dialogs/qdialog.cpp.sav 2006-03-17 14:33:44.000000000 +0100
+++ src/dialogs/qdialog.cpp 2006-06-01 13:38:00.000000000 +0200
@@ -670,6 +670,11 @@ bool QDialog::event( QEvent *e )
#if defined(Q_WS_X11)
extern "C" { int XSetTransientForHint( Display *, unsigned long, unsigned long ); }
+#include <private/qt_x11_p.h>
+#undef FocusIn
+// defined in qapplication_x11.cpp
+extern Atom qt_net_wm_full_placement;
+extern bool qt_net_supports(Atom atom);
#endif // Q_WS_X11
/*!
@@ -691,10 +696,12 @@ void QDialog::show()
if ( !did_resize )
adjustSize();
- if ( has_relpos && !did_move ) {
- adjustPositionInternal( parentWidget(), TRUE );
- } else if ( !did_move ) {
- adjustPositionInternal( parentWidget() );
+ if( !qt_net_supports( qt_net_wm_full_placement )) {
+ if ( has_relpos && !did_move ) {
+ adjustPositionInternal( parentWidget(), TRUE );
+ } else if ( !did_move ) {
+ adjustPositionInternal( parentWidget() );
+ }
}
if (windowState() != state)

View File

@@ -0,0 +1,18 @@
Index: tools/designer/uic/form.cpp
===================================================================
--- tools/designer/uic/form.cpp (revision 460038)
+++ tools/designer/uic/form.cpp (working copy)
@@ -731,6 +731,13 @@
while ( !n2.isNull() ) {
if ( n2.tagName() == "includehint" ) {
QString file = n2.firstChild().toText().data();
+ int colons = file.find("::");
+
+ if (colons != -1)
+ {
+ file = file.right(file.length() - colons - 2);
+ }
+
localIncludes += file;
}
n2 = n2.nextSibling().toElement();

View File

@@ -0,0 +1,159 @@
Index: configure
===================================================================
--- configure (revision 471775)
+++ configure (working copy)
@@ -1053,6 +1053,7 @@
[ -d $outpath/src/tools ] || mkdir -p $outpath/src/tools
cat > $outpath/src/tools/qconfig.cpp.new <<EOF
/* Install paths from configure */
+#include "qglobal.h"
static const char QT_INSTALL_PREFIX [267] = "qt_nstpath=$QT_INSTALL_PREFIX";
static const char QT_INSTALL_BINS [267] = "qt_binpath=$QT_INSTALL_BINS";
Index: src/kernel/qgplugin.h
===================================================================
--- src/kernel/qgplugin.h (revision 471775)
+++ src/kernel/qgplugin.h (working copy)
@@ -90,35 +90,19 @@
return i->iface(); \
}
-# ifdef Q_WS_WIN
-# ifdef Q_CC_BOR
-# define Q_EXPORT_PLUGIN(PLUGIN) \
- Q_PLUGIN_VERIFICATION_DATA \
- Q_EXTERN_C __declspec(dllexport) \
- const char * __stdcall qt_ucm_query_verification_data() \
- { return qt_ucm_verification_data; } \
- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \
- __stdcall ucm_instantiate() \
- Q_PLUGIN_INSTANTIATE( PLUGIN )
-# else
-# define Q_EXPORT_PLUGIN(PLUGIN) \
- Q_PLUGIN_VERIFICATION_DATA \
- Q_EXTERN_C __declspec(dllexport) \
- const char *qt_ucm_query_verification_data() \
- { return qt_ucm_verification_data; } \
- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate() \
- Q_PLUGIN_INSTANTIATE( PLUGIN )
-# endif
-# else
-# define Q_EXPORT_PLUGIN(PLUGIN) \
+#if defined(Q_WS_WIN) && defined(Q_CC_BOR)
+# define Q_STDCALL __stdcall
+#else
+# define Q_STDCALL
+#endif
+
+#define Q_EXPORT_PLUGIN(PLUGIN) \
Q_PLUGIN_VERIFICATION_DATA \
- Q_EXTERN_C \
- const char *qt_ucm_query_verification_data() \
+ Q_EXTERN_C Q_EXPORT \
+ const char * Q_STDCALL qt_ucm_query_verification_data() \
{ return qt_ucm_verification_data; } \
- Q_EXTERN_C QUnknownInterface* ucm_instantiate() \
+ Q_EXTERN_C Q_EXPORT QUnknownInterface* Q_STDCALL ucm_instantiate() \
Q_PLUGIN_INSTANTIATE( PLUGIN )
-# endif
-
#endif
struct QUnknownInterface;
Index: src/kernel/qapplication_x11.cpp
===================================================================
--- src/kernel/qapplication_x11.cpp (revision 471775)
+++ src/kernel/qapplication_x11.cpp (working copy)
@@ -314,7 +314,7 @@
// flags for extensions for special Languages, currently only for RTL languages
static bool qt_use_rtl_extensions = FALSE;
-bool qt_hebrew_keyboard_hack = FALSE;
+Q_EXPORT bool qt_hebrew_keyboard_hack = FALSE;
static Window mouseActWindow = 0; // window where mouse is
static int mouseButtonPressed = 0; // last mouse button pressed
@@ -3800,7 +3800,7 @@
}
-bool qt_try_modal( QWidget *widget, XEvent *event )
+Q_EXPORT bool qt_try_modal( QWidget *widget, XEvent *event )
{
if (qt_xdnd_dragging) {
// allow mouse events while DnD is active
Index: src/kernel/qtextengine_p.h
===================================================================
--- src/kernel/qtextengine_p.h (revision 471775)
+++ src/kernel/qtextengine_p.h (working copy)
@@ -280,7 +280,7 @@
class QFontPrivate;
-class QTextEngine {
+class Q_EXPORT QTextEngine {
public:
QTextEngine( const QString &str, QFontPrivate *f );
~QTextEngine();
Index: src/tools/qglobal.h
===================================================================
--- src/tools/qglobal.h (revision 471775)
+++ src/tools/qglobal.h (working copy)
@@ -865,6 +865,10 @@
# define Q_TEMPLATE_EXTERN
# undef Q_DISABLE_COPY /* avoid unresolved externals */
# endif
+#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4
+# define Q_EXPORT __attribute__((visibility("default")))
+# undef QT_MAKEDLL /* ignore these for other platforms */
+# undef QT_DLL
#else
# undef QT_MAKEDLL /* ignore these for other platforms */
# undef QT_DLL
Index: tools/designer/uilib/qwidgetfactory.h
===================================================================
--- tools/designer/uilib/qwidgetfactory.h (revision 471775)
+++ tools/designer/uilib/qwidgetfactory.h (working copy)
@@ -48,7 +48,7 @@
class QWidgetFactoryPrivate;
class UibStrTable;
-class QWidgetFactory
+class Q_EXPORT QWidgetFactory
{
public:
QWidgetFactory();
Index: tools/designer/uilib/qwidgetfactory.cpp
===================================================================
--- tools/designer/uilib/qwidgetfactory.cpp (revision 471775)
+++ tools/designer/uilib/qwidgetfactory.cpp (working copy)
@@ -113,13 +113,13 @@
static QMap<QString, bool> *availableWidgetMap = 0;
static QStringList *availableWidgetList = 0;
-QMap<QWidget*, QString> *qwf_forms = 0;
+Q_EXPORT QMap<QWidget*, QString> *qwf_forms = 0;
QString *qwf_language = 0;
-bool qwf_execute_code = TRUE;
+Q_EXPORT bool qwf_execute_code = TRUE;
bool qwf_stays_on_top = FALSE;
QString qwf_currFileName = "";
QObject *qwf_form_object = 0;
-QString *qwf_plugin_dir = 0;
+Q_EXPORT QString *qwf_plugin_dir = 0;
static void setupPluginDir()
{
Index: tools/designer/shared/domtool.h
===================================================================
--- tools/designer/shared/domtool.h (revision 471775)
+++ tools/designer/shared/domtool.h (working copy)
@@ -33,7 +33,7 @@
class QDomElement;
class QDomDocument;
-class DomTool : public Qt
+class Q_EXPORT DomTool : public Qt
{
public:
static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue );

View File

@@ -0,0 +1,32 @@
--- src/kernel/qfontdatabase.cpp 2008-07-10 06:17:31.000000000 +0800
+++ src/kernel/qfontdatabase.cpp 2008-07-10 06:27:53.000000000 +0800
@@ -960,19 +960,17 @@
#ifdef Q_WS_X11
if (script == QFont::Han) {
// modify script according to locale
- static QFont::Script defaultHan = QFont::UnknownScript;
- if (defaultHan == QFont::UnknownScript) {
- QCString locale = setlocale(LC_ALL, NULL);
- if (locale.contains("ko"))
- defaultHan = QFont::Han_Korean;
- else if (locale.contains("zh_TW") || locale.contains("zh_HK"))
- defaultHan = QFont::Han_TraditionalChinese;
- else if (locale.contains("zh"))
- defaultHan = QFont::Han_SimplifiedChinese;
- else
- defaultHan = QFont::Han_Japanese;
+ static QFont::Script defaultHan = QFont::Han;
+ QCString locale = setlocale(LC_ALL, NULL);
+ if (locale.contains("ko"))
+ defaultHan = QFont::Han_Korean;
+ else if (locale.contains("zh_TW") || locale.contains("zh_HK"))
+ defaultHan = QFont::Han_TraditionalChinese;
+ else if (locale.contains("zh"))
+ defaultHan = QFont::Han_SimplifiedChinese;
+ else if (locale.contains("jp"))
+ defaultHan = QFont::Han_Japanese;
- }
script = defaultHan;
}
#endif

View File

@@ -0,0 +1,13 @@
--- qt-x11-free-3.3.4.orig/src/tools/qlocale.cpp 2005-01-21 17:16:05.000000000 +0000
+++ qt-x11-free-3.3.4/src/tools/qlocale.cpp 2005-02-18 13:36:59.000000000 +0000
@@ -55,6 +55,10 @@
# undef INFINITY
#endif
+#if defined(Q_OS_LINUX) && defined(__UCLIBC__)
+# undef Q_OS_LINUX
+#endif
+
#ifdef Q_OS_LINUX
# include <fenv.h>
#endif