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
This commit is contained in:
Martin Gräßlin 2013-03-01 08:49:04 +01:00
parent e107910b30
commit 15aa42c565
5 changed files with 6 additions and 41 deletions

View file

@ -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)

View file

@ -65,6 +65,9 @@ public Q_SLOTS: // METHODS
void circulateDesktopApplications();
int currentDesktop();
QList<int> decorationSupportedColors();
/**
* @deprecated
**/
void doNotManage(const QString &name);
Q_NOREPLY void killWindow();
void nextDesktop();

View file

@ -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);

View file

@ -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

View file

@ -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;