[Janitorial] Remove legacy "rules" to ignore position request and focus stealing prevention
REVIEW: 104274
This commit is contained in:
parent
e8bc821848
commit
eb83686d56
6 changed files with 3 additions and 59 deletions
|
@ -304,8 +304,7 @@ void Workspace::activateClient(Client* c, bool force)
|
|||
// E.g. typing URL in minicli which will show kio_uiserver dialog (with workaround),
|
||||
// and then kdesktop shows dialog about SSL certificate.
|
||||
// This needs also avoiding user creation time in Client::readUserTimeMapTimestamp().
|
||||
if (!c->ignoreFocusStealing())
|
||||
c->updateUserTime();
|
||||
c->updateUserTime();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -565,8 +564,6 @@ bool Workspace::allowClientActivation(const Client* c, Time time, bool focus_in,
|
|||
return false;
|
||||
if (!ignore_desktop && !c->isOnCurrentDesktop())
|
||||
return false; // allow only with level == 0
|
||||
if (c->ignoreFocusStealing())
|
||||
return true;
|
||||
if (ac == NULL || ac->isDesktop()) {
|
||||
kDebug(1212) << "Activation: No client active, allowing";
|
||||
return true; // no active client -> always allow
|
||||
|
@ -613,8 +610,6 @@ bool Workspace::allowFullClientRaising(const Client* c, Time time)
|
|||
kDebug(1212) << "Raising: No client active, allowing";
|
||||
return true; // no active client -> always allow
|
||||
}
|
||||
if (c->ignoreFocusStealing())
|
||||
return true;
|
||||
// TODO window urgency -> return true?
|
||||
if (Client::belongToSameApplication(c, ac, true)) {
|
||||
kDebug(1212) << "Raising: Belongs to active application";
|
||||
|
@ -804,10 +799,7 @@ Time Client::readUserTimeMapTimestamp(const KStartupInfoId* asn_id, const KStart
|
|||
// this check will be done in manage().
|
||||
if (session)
|
||||
return -1U;
|
||||
if (ignoreFocusStealing() && act != NULL)
|
||||
time = act->userTime();
|
||||
else
|
||||
time = readUserCreationTime();
|
||||
time = readUserCreationTime();
|
||||
}
|
||||
kDebug(1212) << "User timestamp, final:" << this << ":" << time;
|
||||
return time;
|
||||
|
|
9
client.h
9
client.h
|
@ -495,7 +495,6 @@ public:
|
|||
void updateUserTime(Time time = CurrentTime);
|
||||
Time userTime() const;
|
||||
bool hasUserTimeSupport() const;
|
||||
bool ignoreFocusStealing() const;
|
||||
|
||||
/// Does 'delete c;'
|
||||
static void deleteClient(Client* c, allowed_t);
|
||||
|
@ -912,7 +911,6 @@ private:
|
|||
KShortcut _shortcut;
|
||||
int sm_stacking_order;
|
||||
friend struct FetchNameInternalPredicate;
|
||||
friend struct CheckIgnoreFocusStealingProcedure;
|
||||
friend struct ResetupRulesProcedure;
|
||||
friend class GeometryUpdatesBlocker;
|
||||
QTimer* demandAttentionKNotifyTimer;
|
||||
|
@ -1193,18 +1191,11 @@ inline bool Client::hasUserTimeSupport() const
|
|||
return info->userTime() != -1U;
|
||||
}
|
||||
|
||||
inline bool Client::ignoreFocusStealing() const
|
||||
{
|
||||
return ignore_focus_stealing;
|
||||
}
|
||||
|
||||
inline const WindowRules* Client::rules() const
|
||||
{
|
||||
return &client_rules;
|
||||
}
|
||||
|
||||
KWIN_PROCEDURE(CheckIgnoreFocusStealingProcedure, Client, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing(cl));
|
||||
|
||||
inline Window Client::moveResizeGrabWindow() const
|
||||
{
|
||||
return move_resize_grab_window;
|
||||
|
|
|
@ -107,7 +107,6 @@ bool Client::manage(Window w, bool isMapped)
|
|||
// and also relies on rules already existing
|
||||
cap_normal = readName();
|
||||
setupWindowRules(false);
|
||||
ignore_focus_stealing = options->checkIgnoreFocusStealing(this); // TODO: Change to rules
|
||||
setCaption(cap_normal, true);
|
||||
|
||||
if (Extensions::shapeAvailable())
|
||||
|
@ -274,10 +273,7 @@ bool Client::manage(Window w, bool isMapped)
|
|||
else
|
||||
usePosition = true;
|
||||
if (!rules()->checkIgnoreGeometry(!usePosition)) {
|
||||
bool ignorePPosition = options->ignorePositionClasses().contains(
|
||||
QString::fromLatin1(resourceClass()));
|
||||
|
||||
if (((xSizeHint.flags & PPosition) && !ignorePPosition) ||
|
||||
if (((xSizeHint.flags & PPosition)) ||
|
||||
(xSizeHint.flags & USPosition)) {
|
||||
placementDone = true;
|
||||
// Disobey xinerama placement option for now (#70943)
|
||||
|
|
18
options.cpp
18
options.cpp
|
@ -190,19 +190,6 @@ unsigned long Options::updateSettings()
|
|||
setOpMaxButtonMiddleClick(windowOperation(config.readEntry("MaximizeButtonMiddleClickCommand", "Maximize (vertical only)"), true));
|
||||
setOpMaxButtonRightClick(windowOperation(config.readEntry("MaximizeButtonRightClickCommand", "Maximize (horizontal only)"), true));
|
||||
|
||||
m_ignorePositionClasses = config.readEntry("IgnorePositionClasses", QStringList());
|
||||
ignoreFocusStealingClasses = config.readEntry("IgnoreFocusStealingClasses", QStringList());
|
||||
// Qt3.2 and older had resource class all lowercase, but Qt3.3 has it capitalized
|
||||
// therefore Client::resourceClass() forces lowercase, force here lowercase as well
|
||||
for (QStringList::Iterator it = m_ignorePositionClasses.begin();
|
||||
it != m_ignorePositionClasses.end();
|
||||
++it)
|
||||
(*it) = (*it).toLower();
|
||||
for (QStringList::Iterator it = ignoreFocusStealingClasses.begin();
|
||||
it != ignoreFocusStealingClasses.end();
|
||||
++it)
|
||||
(*it) = (*it).toLower();
|
||||
|
||||
m_killPingTimeout = config.readEntry("KillPingTimeout", 5000);
|
||||
m_hideUtilityWindowsForInactive = config.readEntry("HideUtilityWindowsForInactive", true);
|
||||
m_inactiveTabsSkipTaskbar = config.readEntry("InactiveTabsSkipTaskbar", false);
|
||||
|
@ -460,11 +447,6 @@ int Options::electricBorderCooldown() const
|
|||
return electric_border_cooldown;
|
||||
}
|
||||
|
||||
bool Options::checkIgnoreFocusStealing(const Client* c) const
|
||||
{
|
||||
return ignoreFocusStealingClasses.contains(QString::fromLatin1(c->resourceClass()));
|
||||
}
|
||||
|
||||
Options::MouseCommand Options::wheelToMouseCommand(MouseWheelCommand com, int delta) const
|
||||
{
|
||||
switch(com) {
|
||||
|
|
16
options.h
16
options.h
|
@ -115,10 +115,6 @@ class Options : public QObject, public KDecorationOptions
|
|||
* 0 - 4 , see Workspace::allowClientActivation()
|
||||
**/
|
||||
Q_PROPERTY(int focusStealingPreventionLevel READ focusStealingPreventionLevel NOTIFY configChanged)
|
||||
/**
|
||||
* List of window classes to ignore PPosition size hint
|
||||
*/
|
||||
Q_PROPERTY(QStringList ignorePositionClasses READ ignorePositionClasses NOTIFY configChanged)
|
||||
/**
|
||||
* support legacy fullscreen windows hack: borderless non-netwm windows with screen geometry
|
||||
*/
|
||||
|
@ -372,13 +368,6 @@ public:
|
|||
return m_focusStealingPreventionLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of window classes to ignore PPosition size hint
|
||||
*/
|
||||
const QStringList &ignorePositionClasses() const {
|
||||
return m_ignorePositionClasses;
|
||||
}
|
||||
|
||||
/**
|
||||
* support legacy fullscreen windows hack: borderless non-netwm windows with screen geometry
|
||||
*/
|
||||
|
@ -386,8 +375,6 @@ public:
|
|||
return m_legacyFullscreenSupport;
|
||||
}
|
||||
|
||||
bool checkIgnoreFocusStealing(const Client* c) const;
|
||||
|
||||
WindowOperation operationTitlebarDblClick() const {
|
||||
return OpTitlebarDblClick;
|
||||
}
|
||||
|
@ -625,7 +612,6 @@ private:
|
|||
bool m_showDesktopIsMinimizeAll;
|
||||
bool m_rollOverDesktops;
|
||||
int m_focusStealingPreventionLevel;
|
||||
QStringList m_ignorePositionClasses;
|
||||
bool m_legacyFullscreenSupport;
|
||||
int m_killPingTimeout;
|
||||
bool m_hideUtilityWindowsForInactive;
|
||||
|
@ -683,8 +669,6 @@ private:
|
|||
bool electric_border_tiling;
|
||||
bool borderless_maximized_windows;
|
||||
bool show_geometry_tip;
|
||||
// List of window classes for which not to use focus stealing prevention
|
||||
QStringList ignoreFocusStealingClasses;
|
||||
int animationSpeed; // 0 - instant, 5 - very slow
|
||||
|
||||
MouseCommand wheelToMouseCommand(MouseWheelCommand com, int delta) const;
|
||||
|
|
|
@ -932,7 +932,6 @@ void Workspace::slotReconfigure()
|
|||
emit configChanged();
|
||||
initPositioning->reinitCascading(0);
|
||||
discardPopup();
|
||||
forEachClient(CheckIgnoreFocusStealingProcedure());
|
||||
updateToolWindows(true);
|
||||
|
||||
if (hasDecorationPlugin() && mgr->reset(changed)) {
|
||||
|
|
Loading…
Reference in a new issue