From 15aa42c565d237a65eb4e17bd6bbcde66ea19c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 1 Mar 2013 08:49:04 +0100 Subject: [PATCH] Remove doNotManage hack for Java Applets The hack used to be used to hide windows before they get embedded into another window. This has been wrong on multiple levels: 1. it does not belong into a window manager - the window should take care of this by itself 2. Window title is not a proper way to identify windows 3. Using D-Bus to inform an X11 window manager about windows which should not get managed is rather strange 4. The hack only works with KWin, but not with any other X Window Manager 5. Windows identified with this hack still appear in Alt+Tab, that is they are managed after all. Only a flicker is suppressed 6. Such windows are shown in the taskbar which nicely illustrates how wrong a D-Bus call to the window manager is That the hack has been introduced for Java Applets in KHTML also shows that this is wrong. Why does Gecko and WebKit not need such a hack? Why is KHTML tied so closely to X11 and KWin? Having a hack for a technology which is obsoleted (Java Applets) and shouldn't be used due to security issues is another reason to no longer support this hack. This usage has been removed from KHTML as of 67939b1 of kdelibs git repo. REVIEW: 109450 --- dbusinterface.cpp | 2 +- dbusinterface.h | 3 +++ manage.cpp | 13 ++----------- workspace.cpp | 23 ----------------------- workspace.h | 6 ------ 5 files changed, 6 insertions(+), 41 deletions(-) diff --git a/dbusinterface.cpp b/dbusinterface.cpp index 7987e3f373..624b698622 100644 --- a/dbusinterface.cpp +++ b/dbusinterface.cpp @@ -136,7 +136,7 @@ WRAP(bool, stopActivity, const QString &) void DBusInterface::doNotManage(const QString &name) { - Workspace::self()->doNotManage(name); + Q_UNUSED(name) } void DBusInterface::showWindowMenuAt(qlonglong winId, int x, int y) diff --git a/dbusinterface.h b/dbusinterface.h index a9030606a2..f0458dca6a 100644 --- a/dbusinterface.h +++ b/dbusinterface.h @@ -65,6 +65,9 @@ public Q_SLOTS: // METHODS void circulateDesktopApplications(); int currentDesktop(); QList decorationSupportedColors(); + /** + * @deprecated + **/ void doNotManage(const QString &name); Q_NOREPLY void killWindow(); void nextDesktop(); diff --git a/manage.cpp b/manage.cpp index 509c7948fd..c1af7dd7b6 100644 --- a/manage.cpp +++ b/manage.cpp @@ -462,13 +462,6 @@ bool Client::manage(Window w, bool isMapped) if (init_minimize) minimize(true); // No animation - - // SELI TODO: This seems to be mainly for kstart and ksystraycmd - // probably should be replaced by something better - bool doNotShow = false; - if (workspace()->isNotManaged(caption())) - doNotShow = true; - // Other settings from the previous session if (session) { // Session restored windows are not considered to be new windows WRT rules, @@ -541,7 +534,7 @@ bool Client::manage(Window w, bool isMapped) else ready_for_painting = true; // set to true in case compositing is turned on later. bug #160393 - if (isShown(true) && !doNotShow) { + if (isShown(true)) { if (isDialog()) Notify::raise(Notify::TransNew); if (isNormalWindow()) @@ -597,10 +590,8 @@ bool Client::manage(Window w, bool isMapped) } else if (!session && !isSpecialWindow()) demandAttention(); } - } else if (!doNotShow) // if ( !isShown( true ) && !doNotShow ) + } else updateVisibility(); - else // doNotShow - hideClient(true); // SELI HACK !!! assert(mapping_state != Withdrawn); m_managed = true; blockGeometryUpdates(false); diff --git a/workspace.cpp b/workspace.cpp index c32da3155e..f24486a7be 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -968,29 +968,6 @@ void Workspace::slotReconfigure() } } -/** - * Avoids managing a window with title \a title - */ -void Workspace::doNotManage(const QString& title) -{ - doNotManageList.append(title); -} - -/** - * Hack for java applets - */ -bool Workspace::isNotManaged(const QString& title) -{ - for (QStringList::Iterator it = doNotManageList.begin(); it != doNotManageList.end(); ++it) { - QRegExp r((*it)); - if (r.indexIn(title) != -1) { - doNotManageList.erase(it); - return true; - } - } - return false; -} - /** * During virt. desktop switching, desktop areas covered by windows that are * going to be hidden are first obscured by new windows with no background diff --git a/workspace.h b/workspace.h index ab187bbc7f..17f7743d95 100644 --- a/workspace.h +++ b/workspace.h @@ -332,7 +332,6 @@ public: bool decorationSupportsBlurBehind() const; // D-Bus interface - void doNotManage(const QString&); /** * @deprecated * @todo: remove KDE5 @@ -349,8 +348,6 @@ public: void resetShowingDesktop(bool keep_hidden); bool showingDesktop() const; - bool isNotManaged(const QString& title); // TODO: Setter or getter? - void sendPingToWindow(Window w, Time timestamp); // Called from Client::pingWindow() void sendTakeActivity(Client* c, Time timestamp, long flags); // Called from Client::takeActivity() @@ -670,9 +667,6 @@ private: RootInfo* rootInfo; QWidget* supportWindow; - // Swallowing - QStringList doNotManageList; - // Colormap handling Colormap default_colormap; Colormap installed_colormap;