Change the setting's type from `QString` to `QStringList`
and adjust relevant code.
Previous config requires no porting as a single string in the
config file is read as the first item in the list.
This change replaces the remaining usages of the old connect syntax with
the new connect syntax.
Unfortunately, there are still places where we have to use SIGNAL() and
SLOT() macros, for example the stuff that deals with d-bus business.
Clazy was used to create this change. There were a few cases that needed
manual intervention, the majority of those cases were about resolving
ambiguity caused by overloaded signals.
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.
In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
If the Xwayland process crashes, it will bring down the entire session
together with itself. Obviously, we don't want that. At least, Wayland
clients should survive the crash.
This change refactors relevant X11 parts to handle Xwayland crashes in a
less fatal way.
In order to handle Xwayland crashes better, a pair of start() and stop()
methods had been introduced in the Xwayland class to allow starting and
stopping the Xwayland process at any moment.
If we detect that the Xwayland process has crashed, we will immediately
stop the Xwayland server, which in its turn will deactivate the socket
notifier and destroy all connected X11 clients. Unfortunately, a couple
of subtle changes in X11Client::releaseWindow() and Unmanaged::release()
had to be made to ensure that we are left with a valid state after the
Xwayland server has been stopped.
Summary:
Currently, there are a couple of issues with sizeForClientSize(). First
of all, we have a method called clientSizeToFrameSize() which does similar
thing except applying geometry constraints and checking window rules. The
other issue is that sizeForClientSize() is doing a bit too much, it checks
window rules, it applies a bunch of geometry constrains. Sometimes it
does not perform conversion between client sizes and frame sizes!
This change attempts to address those issues by replacing sizeForClientSize
with two similar methods and changing semantics of some methods of the
X11Client class.
The most significant difference between sizeForClientSize() and the new
methods is that neither constrainClientSize() nor constrainFrameSize()
check window rules. This is up to users of those methods. In many places,
we don't have to check window rules because we check isResizable(),
which returns false if the frame size is enforced by a window rule.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26828
Summary:
QProcess::error() has been deprecated since Qt 5.6. It is highly advised
to use QProcess::errorOccurred() instead.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26922
Summary:
In order to properly implement xdg_surface.set_window_geometry we need
two kinds of geometry - frame and buffer. The frame geometry specifies
visible bounds of the client on the screen, excluding client-side drop
shadows. The buffer geometry specifies rectangle on the screen that the
attached buffer or x11 pixmap occupies on the screen.
This change renames the geometry property to frameGeometry in order to
reflect the new meaning assigned to it as well to make it easier to
differentiate between frame geometry and buffer geometry in the future.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24334
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.
With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.
Renaming of Client to X11Client was agreed upon during the last KWin
sprint.
Test Plan: Compiles, the test suite is still green.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24184
Summary:
On Placement=Maximized it becomes a problem because we end up sending an invalid size and when we try to recover from it, we recover from the wrong size.
This fixes setting the right size to Plasma Mobile applications.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22054
Summary:
The dialog invoked through user actions menu takes the internal uuid as
command line argument which allows to query the required information
from KWin instead of using X11.
This allows to enable the system for Wayland windows.
In order to replace the usage of ClientMachine in the rules dialog the
dbus interface is extended by a value whether the window is on the
localhost. This is exposed through a virtual method on toplevel which is
overridden in ShellClient and there always returning true.
Test Plan: Run a nested Wayland and opened the dialog on a wayland window
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17750
Summary:
Recently a KSharedConfig was introduced in RuleBook. It makes sense to
also use it in save and not just in load.
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12747
Summary:
We used to recreate the KConfig when rules needed to update. Now that it
is a KSharedConfig, which is kept, it needs to be reparsed as it changes
outside of KWin.
BUG: 393788
FIXED-IN: 5.13.0
Test Plan: Restarted session, changing rules work again
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12706
Summary:
Our rule handling has had a grave error for years. Whenever a window
with a rule was openend or closed the kwinrulesrc was written back to
disk.
The reason for this behavior is that temporary rules need to be discarded
once they were used. For that there is a method discardUsed which invokes
requestDiskStorage whenever a rule for the window was found. But it did
not check whether there was a rule requiring this.
This change modifies the discardUsed to track whether it changed a rule
and only writes back in case there was a change.
BUG: 393911
FIXED-IN: 5.12.6
Test Plan: Only compile tested
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D12749
Summary:
This allows to override the desktop file name.
CCBUG: 351055
Test Plan: Created a window rule for telegram-desktop to fix the icon
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D11266
This is the first test for force rules. As those cannot be set through
the temporary rules message the rulesrc must be modified. To support this
RuleBook gained a setConfig method.
To my positive surprise the rules already work as intended.
Summary:
So far window rule specific functionality was only implemented in Client
and in ShellClient there was only a dummy implementation. This change
moves the client_rules member variable from Client to AbstractClient.
Areas which would not compile anymore are adjusted.
This is a first step to get window rule support for Wayland windows.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8090
Summary:
The RuleBook is created during Workspace startup, so it's a required
component for the overall KWin session. It uses a KXMessages object which
means it has a hard X11 runtime dependency.
This change makes the dependency optional and creates the KXMessages once
X11 is available.
Test Plan: Compiles
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7653
Summary:
With the latest refactoring AbstractClient::captionNormal is the same as
AbstractClient::caption(false) used to be. As there were only two usages
of the false parameter, let's remove this boolean trap and use proper
API calls.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7427
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
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
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
-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
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
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.
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.
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
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.
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*