OSDN Git Service

do not compress ConfigureNotify X11 events
authorIvailo Monev <xakepa10@gmail.com>
Sat, 23 Jan 2021 18:14:56 +0000 (20:14 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 23 Jan 2021 18:14:56 +0000 (20:14 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/global/qnamespace.h
src/core/global/qnamespace.qdoc
src/gui/kernel/qapplication_x11.cpp
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget_p.h

index c91907d..dd46621 100644 (file)
@@ -346,7 +346,6 @@ public:
         WA_SetWindowIcon = 83,
         WA_SetLayoutDirection = 84,
         WA_SetWindowModality = 85,
-        WA_NoX11EventCompression = 86,
 
         // Add new attributes before this line
         WA_AttributeCount
index 3a2baf3..11497c5 100644 (file)
     \omitvalue WA_X11BypassTransientForHint
     \omitvalue WA_SetWindowModality
     \omitvalue WA_WState_AcceptedTouchBeginEvent
-    \omitvalue WA_NoX11EventCompression
 */
 
 /*! \typedef Qt::HANDLE
index 23cea6e..5e67acf 100644 (file)
@@ -510,46 +510,6 @@ static int qt_xio_errhandler(Display *)
 }
 #endif
 
-
-#ifndef QT_NO_XSYNC
-struct qt_sync_request_event_data
-{
-    WId window;
-};
-
-#if defined(Q_C_CALLBACKS)
-extern "C" {
-#endif
-
-static Bool qt_sync_request_scanner(Display*, XEvent *event, XPointer arg)
-{
-    qt_sync_request_event_data *data = reinterpret_cast<qt_sync_request_event_data*>(arg);
-    if (event->type == ClientMessage &&
-        event->xany.window == data->window &&
-        event->xclient.message_type == ATOM(WM_PROTOCOLS) &&
-        (Atom)event->xclient.data.l[0] == ATOM(_NET_WM_SYNC_REQUEST)) {
-        QWidget *w = QWidget::find(event->xany.window);
-        if (QTLWExtra *tlw = ((QETWidget*)w)->d_func()->maybeTopData()) {
-            const Time timestamp = event->xclient.data.l[1];
-            if (timestamp > qt_x11Data->time)
-                qt_x11Data->time = timestamp;
-            if (timestamp == CurrentTime || timestamp > tlw->syncRequestTimestamp) {
-                tlw->syncRequestTimestamp = timestamp;
-                tlw->newCounterValueLo = event->xclient.data.l[2];
-                tlw->newCounterValueHi = event->xclient.data.l[3];
-            }
-        }
-        return true;
-    }
-    return false;
-}
-
-#if defined(Q_C_CALLBACKS)
-}
-#endif
-
-#endif // QT_NO_XSYNC
-
 static void qt_x11_create_intern_atoms()
 {
 #if defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6)
@@ -3436,41 +3396,6 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
         if (isVisible())
             QApplication::syncX();
 
-        if (d->extra->compress_events) {
-            // ConfigureNotify compression for faster opaque resizing
-            XEvent otherEvent;
-            while (XCheckTypedWindowEvent(qt_x11Data->display, internalWinId(), ConfigureNotify,
-                                          &otherEvent)) {
-                if (qt_x11EventFilter(&otherEvent))
-                    continue;
-
-                if (x11Event(&otherEvent))
-                    continue;
-
-                if (otherEvent.xconfigure.event != otherEvent.xconfigure.window)
-                    continue;
-
-                newSize.setWidth(otherEvent.xconfigure.width);
-                newSize.setHeight(otherEvent.xconfigure.height);
-
-                if (otherEvent.xconfigure.send_event || trust) {
-                    newCPos.rx() = otherEvent.xconfigure.x +
-                                   otherEvent.xconfigure.border_width;
-                    newCPos.ry() = otherEvent.xconfigure.y +
-                                   otherEvent.xconfigure.border_width;
-                    isCPos = true;
-                }
-            }
-#ifndef QT_NO_XSYNC
-            qt_sync_request_event_data sync_event;
-            sync_event.window = internalWinId();
-            for (XEvent ev;;) {
-                if (!XCheckIfEvent(qt_x11Data->display, &ev, &qt_sync_request_scanner, (XPointer)&sync_event))
-                    break;
-            }
-#endif // QT_NO_XSYNC
-        }
-
         if (!isCPos) {
             // we didn't get an updated position of the toplevel.
             // either we haven't moved or there is a bug in the window manager.
index ca92538..319c92b 100644 (file)
@@ -1328,7 +1328,6 @@ void QWidgetPrivate::createExtra()
         extra->nativeChildrenForced = false;
         extra->inRenderWithPainter = false;
         extra->hasMask = false;
-        extra->compress_events = true;
         createSysExtra();
 #ifdef QWIDGET_EXTRA_DEBUG
         static int count = 0;
@@ -9078,12 +9077,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
         break;
     }
 #ifdef Q_WS_X11
-    case Qt::WA_NoX11EventCompression: {
-        if (!d->extra)
-            d->createExtra();
-        d->extra->compress_events = on;
-        break;
-    }
     case Qt::WA_X11DoNotAcceptFocus: {
         if (testAttribute(Qt::WA_WState_Created))
             d->updateX11AcceptFocus();
index 0d10d1c..ddcc6c3 100644 (file)
@@ -206,7 +206,6 @@ struct QWExtra {
 
     // *************************** Platform specific values (bit fields first) **********
 #if defined(Q_WS_X11) // <--------------------------------------------------------- X11
-    bool compress_events;
     WId xDndProxy; // XDND forwarding to embedded windows
 #endif
 };