Commit Graph

125 Commits (a7b29e09cefe50f6ef6e9e603997da0c1753885a)

Author SHA1 Message Date
Martin Gräßlin 97b594501a Match window role in Rules in a case insensitive manner
Summary:
We used to have a toLower when reading the rule. This was removed with
4f7edb8 which turned it into a case sensitive matching to fix a
regression.

But this created another regression: existing rules written lower case
are no longer matched.

This change makes the role matching case insensitive again.

BUG: 367554

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2574
2016-09-13 08:37:26 +02:00
Martin Gräßlin 14b9046ad2 Unblock signals in child processes
We need to unblock the signals blocked with pthread_sigmask.
This caused kdeinit to block, because it relies on SIGUSR1.

BUG: 356580
FIXED-IN: 5.5.1
REVIEW: 126361
2015-12-15 13:03:30 +01:00
Thomas Lübking a4791e629d Add rule to protect the focus on a window
This allows to pin the focus on certain window as well
as to more easily give it away on others (typically launchers)

BUG: 185060
CCBUG: 337798
FIXED-IN: 5.5
REVIEW: 126059
2015-11-17 21:30:05 +01:00
Nick Shaforostoff 3a8d7d866a optimize string operations
-use qstringliteral only when necessary (i.e. not in concat or comparison)
-use qbytearray instead of qstring when dealing with latin1 input and output (glplatform)
-use qstringref to extract numbers from strings (glplatform)
-define qt_use_qstringbuilder to optimize all string concatenations
-anidata: use ctor init lists, add windowType member initialization

REVIEW: 125933
2015-11-05 14:14:06 +00:00
Thomas Lübking b2755bcaa7 re-evaluate rules on title change
If a rule minus the title match matches,
the captionChanged signal is bound to re-evaluate
the rules for that client, ie. the tracking overhead
only exists for those clients where title matching
is relevant and costs rematching all rules when such
client changes its title (yes, the partial matching
rules could be stored for faster re-check, but that
would make the patch bigger and is probably not worth
it; just some string comparisms)

additional tracking of wm_class or wm_role
(what is iirc a netwm violation anyway) would require
to monitor the resp. property for changes (not done atm.)

BUG: 220227
FIXED-IN: 5.5
REVIEW: 125427
2015-10-29 23:36:10 +01:00
Thomas Lübking 75b08e1ee7 log *which* binary failed to start
Users shouldn't have to od libraries.
CCBUG: 353154
REVIEW: 125464
2015-09-30 16:38:02 +02:00
Martin Gräßlin 8c884d92b3 Delete the rules process, not the Rulebook
Fixes crash when editing window rules.

BUG: 351177
REVIEW: 124693
2015-08-11 08:38:30 +02:00
Martin Gräßlin f6458fa1e8 Port away from KToolInvocation
The problem with KToolInvocation is that it creates a dead lock on
Wayland in case kdeinit is not already running. It starts kdeinit
and does a QProcess::waitForFinished and our kdeinit needs to interact
with the wayland server. So dead lock.

As KRun also calls into the dangerous code path it's no option which
leaves us with QProcess to start the processes.

A nice side-effect is that we no don't need to link KF5::Service any
more from kwin_core. Now once Plasma and Notification don't use it
any more, it will be gone completely.
2015-07-07 17:35:57 +02:00
Martin Gräßlin 1d9769af1f Move skipTaskbar from Client to AbstractClient
At the same time the functionality for the "original_skip_taskbar" is
splitted out. This removes the weird API with two boolean arguments to
the set method. Instead there is a dedicated method for the orignal
skip taskbar state which delegates to regular skipTaksbar.
2015-06-06 22:11:10 +02:00
Martin Gräßlin bfb52b20c9 RuleBook::edit operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 7c3197b1eb Use new ctors for KXMessages and KSelectionOwner
Allows to pass the connection and rootWindow and doesn't depend on
QX11Info.
2015-03-17 10:20:19 +01:00
Thomas Lübking d5f126f0c8 Rules: make WindowRole matching case sensitive
required by KWindowInfo forwarding
BUG: 343709
FIXED-IN: 5.2.1
REVIEW: 122407
2015-02-05 21:37:34 +01:00
Daniel Pastushchak 0d997b1093 Introduce categorized logging for kwin core
Done by Daniel Pastushchak for KDE during GCI-2014.
2014-12-05 14:27:15 +01:00
Martin Gräßlin 3d9a035312 Move MaximizeMode from KDecorationDefines to utils.h
Unfortunately it cannot be a enum defined in Client as client.h
depends on rules.h and with it in Client rules.h would depend on
client.h.
2014-12-02 13:49:08 +01:00
Martin Gräßlin 69e1a0fabd Remove opacity from Rules::update
We failed to implement the TODO for all of KDE4, so maybe it's a sign
that we can remove it. Also fixes two warnings:

comparison between 'enum KWin::Rules::ForceRule' and
'enum KWin::Rules::SetRule' [-Wenum-compare]

REVIEW: 117848
2014-05-05 08:14:01 +02:00
Aleix Pol c72e519d9c Remove KDE/ prefix in include directories
It's unneeded and deprecated since KF5.
2014-03-17 16:24:10 +01:00
Martin Gräßlin fdee4ea8c8 Adjust kde-workspace to introduction of flags in NET classes 2014-02-05 17:40:19 +01:00
Fabian Kosmale 1b219ea6d9 fix compilation with Clang
REVIEW: 115125
2014-01-19 19:17:41 +01:00
Martin Gräßlin 49cf996aa7 [kwin] Window specific rule for decoration color scheme
Adds a new force rule to specify the color scheme to use on the window
decoration. The scheme is stored by the name of the .colors file name.
So for Oxygen.colors the value is Oxygen.

When loaded the scheme is located and the full path to the colors file
is used. This is because the X property also uses the full path.
2013-11-25 09:44:23 +01:00
Anselmo L. S. Melo d258759ac9 Port from KTemporaryFile to QTemporaryFile
REVIEW: 112742
2013-09-24 08:07:41 -03:00
Martin Gräßlin 57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
2013-09-02 13:14:39 +02:00
Martin Gräßlin 330d40f425 Fix no cast to/from ASCII intrduced issues
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
2013-07-24 09:58:33 +02:00
Martin Gräßlin 0baeb39164 Port KXMessages to new ctor call 2013-07-24 09:47:03 +02:00
Thomas Lübking abaf6faae1 revert wrong leak fix, caused double free
BUG: 320439
FIXED-IN: 4.11
REVIEW: 110754
2013-06-05 14:10:58 +02:00
Thomas Lübking 18332d3ddb revert to NON obosolete signtature
the signature is obsolete in KF5 but mandatory in KDE4
not using it so far breaks the protocol thus kstart temp.
rules fail

REVIEW: 110386
2013-05-15 22:18:29 +02:00
Martin Gräßlin 65ec86113a Split out Rules related code from Workspace into class RuleBook
Workspace is hardly interacting with Rules and all the Rules related code
is already in rules.cpp. This highly qualifies to move all the code out
of Workspace and improve the names.

REVIEW: 110207
2013-04-30 07:52:08 +02:00
Martin Gräßlin edb074cbc2 Split out screen handling from Workspace into own class Screens
Following the approaches of other split out functionality Screens is a
singleton class created by Workspace.

The class takes over the responsibility for:
* screenChanged signal delayed by timer
* number of screens
* geometry of given screen
* active screen
* config option for active screen follows mouse

The class contains a small abstraction layer and has a concrete subclass
wrapping around QDesktopWidget, but the idea is to go more low level and
interact with XRandR directly to get more detailed information.

All over KWin the usage from QDesktopWidget is ported over to the new
Screens class.

REVIEW: 109839
2013-04-15 10:25:10 +02:00
Thomas Lübking 158d060b5f turn "ignore geometry" forcerule into a setrule
and btw. replace legacy "ignoreposition" by "ignoregeometry"

this will allow to use "apply initially" as "force" used to act
(ignore position on placement) and "force" to prevent clients
from reconfiguring themselves (to not break a tabgroup or to just
not be annoying)

BUG: 311720
CCBUG: 252314
REVIEW: 109691
FIXED-IN: 4.11
2013-03-28 20:31:08 +01:00
Martin Gräßlin 5cd223f051 Improved resolving whether a window is on local machine
Most windows use the hostname in WM_CLIENT_MACHINE, but there are windows
using the FQDN (for example libreoffice). So instead of "foo" it is
"foo.local.net" or similar. The logic so far has been unable to properly
determine whether windows with FQDN are on the local system.

In order to solve this problem the handling is split out into an own
class which stores the information of hostname and whether it is a local
machine. This is to not query multiple times. To determine whether the
Client is on the local system getaddrinfo is used for the own hostname
and the FQDN provided in WM_CLIENT_MACHINE. If one of the queried
names matches, we know that it is on the local machine. The old logic to
compare the hostname is still used and getaddrinfo is only a fallback in
case hostname does not match.

The problem with getaddrinfo is, that it accesses the network and by that
could block. To circumvent this problem the calls are moved into threads
by using QtConcurrent::run.

Obviously this brings disadvantages. When trying to resolve whether a
Client is on the local machine and a FQDN is used, the information is
initially wrong. The new ClientMachine class emits a signal when the
information that the system is local becomes available, but for some
things this is just too late:
* window rules are already gathered
* Session Management has already taken place

In both cases this is an acceptable loss. For window rules it just needs
a proper matching of the machine in case of localhost (remote hosts are
not affected). And the case of session management is very academic as it
is unlikely that a restoring session contains remote windows.

BUG: 308391
FIXED-IN: 4.11
REVIEW: 108235
2013-01-21 16:00:49 +01:00
Marco Martin 36ed622a61 use a rules file dependednt from the kwin name
kwinacriverulesrc vs kwinrulesrc
2012-11-03 22:09:07 +01:00
Thomas Lübking 850c1e6f0d add screen rule 2012-09-19 20:21:43 +02:00
Martin Gräßlin a394fade64 Remove Tiling support from KWin
As discussed on the mailinglist [1] the tiling support is
removed from KWin. The main reasons for this step are:
* it is unmaintained
* it is a mode not used by any of the core KWin team
* original developer said at Akademy 2012 that he is not
  interested in picking up the work again
* tiling has quite some bugs, e.g. multi screen not supported
* is conflicting with other concepts in KWin, e.g. activities

There is ongoing work to get tiling supported through a KWin
script, which is a preferred way as it does not influence the
existing C++ code base.

[1] http://lists.kde.org/?l=kwin&m=133149673110558&w=2
BUG: 303090
FIXED-IN: 4.10
REVIEW: 105546
2012-07-14 11:18:06 +02:00
Ivan Čukić 0d60a7049d Adds activity window rules to KWin
- adds the kcm rule option to set the activity - one or all option like
  for virtual desktops
- makes the windows obey the rule
- makes the rule enforced even when the user tries to change the
  window's activity via the alt+f3 menu

REVIEW:104972
2012-05-17 16:32:06 +02:00
Thomas Lübking 033ae96f89 selective rule remembering
REVIEW: 103875
2012-02-09 17:34:08 +01:00
Thomas Lübking 9ec32d5942 4.7 backportable rules ui fixes
remove uncertain "extra role" match
fix shortcut editor s/s connection

REVIEW: 7001
2011-10-05 23:54:06 +02:00
Arthur Arlt 25654f25b8 Removing TopMenu
Since the funtionality of TopMenu did no longer work in KDE4 this feature was
removed from Workspace. Every reference to it was removed as well as commentaries
and documentation.

REVIEW: 101485
2011-06-24 12:27:56 +02:00
Martin Gräßlin 12d3b354fc Remove drawbound move/resize functionality
Drawbound was nowadays only used when compositing is disabled.
For the composited case, the drawbound was replaced by the resize
effect and in fact we should always just use the resize effect.

REVIEW: 101411
2011-06-23 12:15:54 +02:00
Thomas Lübking 31278d570e add rule/property based composite blocking 2011-04-04 01:59:52 +02:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Kevin Ottens ff61f40d8d Don't rely on the kdgstream typedef which is deprecated. Use QDebug
directly.

svn path=/trunk/KDE/kdebase/workspace/; revision=1190379
2010-10-27 14:16:56 +00:00
Martin Gräßlin fa7f160cb3 Window specific setting to skip window switchers (tabbox, present windows, desktop grid).
FEATURE: 171192
CCBUG: 179723

svn path=/trunk/KDE/kdebase/workspace/; revision=1122404
2010-05-03 20:04:44 +00:00
Nikhil Marathe 5fc7e93d69 Tiling is here!
This commit merges the kwin-tiling branch. Ideally it shouldn't break anything and add a few features ;-)
It was applied as a patch. Do not attempt to merge the branch directly, it has a few issues.
This feature is currently experimental, although it hasn't crashed in quite a long time. It lacks some features and probably leaks some memory. Fixes will be on the way.

Season Of KDE 2009 project by Nikhil Marathe

svn path=/trunk/KDE/kdebase/workspace/; revision=1118677
2010-04-25 16:43:14 +00:00
Lucas Murray d7b1e5fc53 Added window rule version of opening window tabs in the background.
svn path=/trunk/KDE/kdebase/workspace/; revision=1050444
2009-11-17 10:41:32 +00:00
Lucas Murray e4ab19a936 Allow automatic grouping of unrelated windows by matching them with a
window rule ID.

svn path=/trunk/KDE/kdebase/workspace/; revision=1050040
2009-11-16 13:31:02 +00:00
Lucas Murray e096c60502 Allow the autogrouping option to be enabled/disabled on a
per-application level by using window rules.

svn path=/trunk/KDE/kdebase/workspace/; revision=1050000
2009-11-16 11:26:37 +00:00
Lucas Murray 3dc41fb062 Fix double->int conversions to prevent incorrect rounding of window
opacity at KWin start and window focus change.
BUG: 209274

svn path=/trunk/KDE/kdebase/workspace/; revision=1030828
2009-10-03 09:11:05 +00:00
Thomas Lübking 46def0304e BUG: 167138
make opacity rules actually functional

svn path=/trunk/KDE/kdebase/workspace/; revision=1002997
2009-07-27 13:30:08 +00:00
Laurent Montel 5535a9de5e Fix iterator
svn path=/trunk/KDE/kdebase/workspace/; revision=883047
2008-11-11 23:09:11 +00:00
Luboš Luňák e7c88f309d Reduce the difference between noborder requested by the application
and set by the user - they're now interchangeable. Which means
that Alt+F3/Advanced/No border can put the window decoration
back on the KRunner window regardless of what Plasma or any other
app thinks.


svn path=/trunk/KDE/kdebase/workspace/; revision=788964
2008-03-23 00:12:11 +00:00
Kevin Ottens dde6b49658 Don't use the global config for the rules config.
kdeglobals is not supposed to store such rules, and this way
we don't empty kdeglobals when KWin quits.

Lubos: Ossi confirmed me it was the right move in the way we
use KConfig here, so I committed directly. In case of problem
just tell me.

CCMAIL: l.lunak@kde.org

svn path=/trunk/KDE/kdebase/workspace/; revision=769617
2008-02-01 17:50:18 +00:00