QTBUG-27287, QTBUG-25143, QTBUG-22833, QTBUG-57399, QTBUG-59159, QTBUG-15773,
QTBUG-70506, QTBUG-46054, QTBUG-11223, QTBUG-63108, QTBUG-6932, QTBUG-42365,
QTBUG-83817, QTBUG-4341, QTBUG-36933, QTBUG-49113, QTBUG-69920, QTBUG-40015,
-QTBUG-54942, QTBUG-91261, QTBUG-73445, QTBUG-21098
+QTBUG-54942, QTBUG-91261, QTBUG-73445, QTBUG-21098, QTBUG-59966
Unless you use QMake and QDoc porting to Katie or even supporting it along with
Qt4 in the same codebase is trivial and requires only minor changes because
#include <qevent.h>
#include <qlineedit.h>
#include <QBoxLayout>
+#include "qx11info_x11.h"
+#include "qt_x11_p.h"
#include "../../shared/util.h"
//TESTED_CLASS=
//TESTED_FILES=gui/kernel/qevent.h gui/kernel/qevent.cpp
+
+static bool hasNetWM()
+{
+ Atom type;
+ int format;
+ unsigned long nitems, after;
+ unsigned char *data = 0;
+
+ int e = XGetWindowProperty(qt_x11Data->display, QX11Info::appRootWindow(),
+ ATOM(_NET_SUPPORTED), 0, 0,
+ False, XA_ATOM, &type, &format, &nitems, &after, &data);
+ if (data) {
+ XFree(data);
+ }
+ return (e == Success && type == XA_ATOM && format == 32);
+}
+
class FocusLineEdit : public QLineEdit
{
public:
void tst_QFocusEvent::initWidget()
{
- // On X11 we have to ensure the event was processed before doing any checking, on Windows
- // this is processed straight away.
+ // On X11 we have to ensure the event was processed before doing any checking
QApplication::setActiveWindow(childFocusWidgetOne);
for (int i = 0; i < 1000; ++i) {
void tst_QFocusEvent::checkReason_ActiveWindow()
{
+ if ( !hasNetWM() ) {
+ QSKIP("No X11 WM, focus is borked", SkipAll);
+ }
+
initWidget();
QDialog* d = new QDialog( testFocusWidget );
QVERIFY( !childFocusWidgetOne->hasFocus() );
d->hide();
- QTest::qWait(100);
QTRY_VERIFY(childFocusWidgetOne->focusInEventRecieved);
QVERIFY(childFocusWidgetOne->focusInEventGotFocus);