OSDN Git Service

drop startup notification support
authorIvailo Monev <xakepa10@gmail.com>
Fri, 18 Aug 2023 21:16:29 +0000 (00:16 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Fri, 18 Aug 2023 21:16:29 +0000 (00:16 +0300)
essentially non-operational for Katana applications (KApplication has a
hack to steal the DESKTOP_STARTUP_ID environment variable) and it is by
no means Katie's responsibility to do startup notification

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/kernel/qapplication_x11.cpp
src/gui/kernel/qt_x11_p.h
src/gui/kernel/qwidget_p.h
src/gui/kernel/qwidget_x11.cpp

index c96b4b3..87f6ee9 100644 (file)
@@ -160,9 +160,6 @@ static const char* X11AtomsTbl[QX11Data::NPredefinedAtoms] = {
     "_NET_WM_WINDOW_TYPE_DND\0",
     "_NET_WM_WINDOW_TYPE_NORMAL\0",
 
-    "_NET_STARTUP_INFO\0",
-    "_NET_STARTUP_INFO_BEGIN\0",
-
     "_NET_SUPPORTING_WM_CHECK\0",
 
     "_NET_SYSTEM_TRAY_VISUAL\0",
@@ -935,8 +932,6 @@ void qt_init(QApplicationPrivate *priv, Display *display,
         qt_x11Data->has_fontconfig = FcInit();
 #endif
 
-    qt_x11Data->startupId = 0;
-
     int argc = priv->argc;
     char **argv = priv->argv;
 
@@ -1226,11 +1221,6 @@ void qt_init(QApplicationPrivate *priv, Display *display,
         QFont f(QFont::lastResortFamily(), ptsz);
         QApplicationPrivate::setSystemFont(f);
     }
-
-    qt_x11Data->startupId = getenv("DESKTOP_STARTUP_ID");
-    if (qt_x11Data->startupId) {
-        ::unsetenv("DESKTOP_STARTUP_ID");
-    }
 }
 
 /*****************************************************************************
index 3579dab..184ceb9 100644 (file)
@@ -244,8 +244,6 @@ public:
     bool has_fontconfig;
     int fc_hint_style;
 
-    char *startupId;
-
     /* Warning: if you modify this list, modify the names of atoms in qapplication_x11.cpp as well! */
     enum X11Atom {
         // window-manager <-> client protocols
@@ -329,9 +327,6 @@ public:
         _NET_WM_WINDOW_TYPE_DND,
         _NET_WM_WINDOW_TYPE_NORMAL,
 
-        _NET_STARTUP_INFO,
-        _NET_STARTUP_INFO_BEGIN,
-
         _NET_SUPPORTING_WM_CHECK,
 
         _NET_SYSTEM_TRAY_VISUAL,
index 71168df..2c4fdd7 100644 (file)
@@ -558,7 +558,6 @@ public:
     static QWidget *keyboardGrabber;
 
     void setWindowRole();
-    void sendStartupMessage() const;
     void setNetWmWindowTypes();
     void x11UpdateIsOpaque();
     bool isBackgroundInherited() const;
index 1745eae..8454daf 100644 (file)
@@ -1948,46 +1948,6 @@ void QWidgetPrivate::show_sys()
 
     if (q->internalWinId())
         XMapWindow(qt_x11Data->display, q->internalWinId());
-
-    // Freedesktop.org Startup Notification
-    if (qt_x11Data->startupId && q->isWindow()) {
-        sendStartupMessage();
-    }
-}
-
-/*!
-  \internal
-  Platform-specific part of QWidget::show().
-*/
-
-void QWidgetPrivate::sendStartupMessage() const
-{
-    Q_Q(const QWidget);
-
-    QByteArray message("remove: ID=");
-    message.append(qt_x11Data->startupId);
-
-    XEvent xevent;
-    xevent.xclient.type = ClientMessage;
-    xevent.xclient.message_type = ATOM(_NET_STARTUP_INFO_BEGIN);
-    xevent.xclient.display = qt_x11Data->display;
-    xevent.xclient.window = q->internalWinId();
-    xevent.xclient.format = 8;
-
-    Window rootWindow = RootWindow(qt_x11Data->display, DefaultScreen(qt_x11Data->display));
-    uint sent = 0;
-    uint length = message.size() + 1;
-    do {
-        if (sent == 20)
-            xevent.xclient.message_type = ATOM(_NET_STARTUP_INFO);
-
-        for (uint i = 0; i < 20 && i + sent <= length; i++)
-            xevent.xclient.data.b[i] = message[i + sent++];
-
-        XSendEvent(qt_x11Data->display, rootWindow, false, PropertyChangeMask, &xevent);
-    } while (sent <= length);
-
-    qt_x11Data->startupId = 0;
 }
 
 void QWidgetPrivate::setNetWmWindowTypes()