Commit graph

13969 commits

Author SHA1 Message Date
Michael Pyne
bcc36b87fb Avoid undefined behavior in nearestPowerOfTwo.
The way nearestPowerOfTwo is currently defined allows for the possibility of
left-shifting an int by 32 bits or more, which is undefined behavior on
platforms where int is 32 bits, and is something that can happen here if `s`
is equal to 31 by the end of the loop. Noted by Coverity as CID 1291191.

This patch takes an algorithm to perform the same operation from Hank Warren
Jr.'s book "Hacker's Delight", which should avoid UB.

REVIEW:126540
2015-12-28 17:08:15 -05:00
Michael Pyne
4957c18a44 Widen int to qint64 before multiplication, not after.
Noted by Coverity, CID 1334968.
2015-12-27 21:56:09 -05:00
l10n daemon script
02e9001f39 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-12-27 09:18:16 +00:00
Martin Gräßlin
ecce036979 [wayland] Introduce a memeber variable for checking whether ShellClient is internal
ASAN complained about heap-use-after-freeze in copyToDeleted due to call
into isInternal().
2015-12-18 17:26:21 +01:00
Martin Gräßlin
8604e03106 [wayland] Properly implement userCanSetNoBorder in ShellClient
Only for server side decorations it's possible to set no border and
in that case it should have same checks as Client.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
7ed4b5ed1a Include abstract_client.h instead of client.h in decorationbridge.cpp 2015-12-18 16:41:49 +01:00
Martin Gräßlin
2d7477359e DecorationBridge::recreateDecorations operates on AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
89be6cf4ed Add a Workspace::forEachAbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
5e96f65224 Add window decoration to ShellClient
If a ShellClient supports the ServerSideDecoration interface we can
create a server decoration for it. For that updateDecoration is added
as a pure virtual method in AbstractClient and a more-or-less code copy
from Client is added to ShellClient.

Geometry handling is adjusted to consider the window decoration offsets.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5cfe9428aa [backends/wayland] Use server side decorations if available 2015-12-18 16:41:49 +01:00
Martin Gräßlin
5cef26d275 [wayland] Add support for ServerSideDecorationManager
We announce support for it and depending on whether we have a plugin
or not set the default mode to Server or None.

When a decoration interface is created it gets installed on the
ShellClient. But there it isn't properly used yet as we don't have
support for decorations in ShellClient yet.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
3de3a959c6 Move implementation of clientPos() to AbstractClient
The Client's variant works for both Client and ShellClient.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
827486ff36 Introduce a Toplevel::clientContentPos() -> QPoint
This describes an additional offset for the client content. On X11
our client content position matches with the window - the window
decoration is part of the overall content coordinate system.

On Wayland the content is an own texture starting at 0/0. Thus a
mapping to texture coordinates will be required when server side
decorations are provided. The new information is used in the scene's
to adjust the rendering and generating of quads.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5f90fa5cfd Introduce pure virtual, protectd AbstractClient::acceptsFocus -> bool
Replacement for calls to info->input() which is only valid for the Client
sub class, but not for ShellClient.

In ShellClient the implementation is swapped with wantsInput() and
wantsInput() has a new implementation which properly delegates to rules()
just like Client does.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
a4c347fc7a [wayland] Translate inputTransformation matrix by borderLeft/Top
With decorations the ShellClient needs to have another input offset
by borderTop and borderLeft.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
d28fba8839 DecorationShadow operates on AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
60b09586ef [decorations] Schedule repaint for renderer on AbstractClient
We need to search in AbstractClient instead of just Client.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
0bf2b1de0f Add a Workspace::findAbstractClient
Like Workspace::findClient just that it operates on AbstractClient
and the m_allClients instead of clients.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
cb400d7128 DecorationBridge creates Decoration for AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
9ae2b505fa Group decoration related variables in a struct in AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
f4246ba7e2 SceneQPainter::Window::renderWindowDecorations operates on AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
401efc28a8 SceneOpenGL::Window::getDecorationTexture() operates on AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
e61ad65f10 InputRedirection::updatePointerDecoration operates on AbstractClient for deco
As decoration and decoratedClient is now in AbstractClient we don't need
to keep it as Client specific code.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
7fc15b48fb Drop the Client specific code from Deleted::copyToDeleted
As DecoratedClient is now on AbstractClient we can have all copying
on AbstractClient and don't need any specific Client code.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
6270ea35a2 DecoratedClientImpl switches from operating on Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
4873b2933f Move decoratedClient from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
ce84ae4b65 Move some decoration related signals from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
1758db337f DecoratedClientImpl::client returns AbstractClient* instead of Client* 2015-12-18 16:41:49 +01:00
Martin Gräßlin
ae28c2499d Add virtual AbstractClient::showContextHelp and ::providesContextHelp
Required in the context of decorations. Default implementation does
nothing respectively returns false.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5de55b61e7 Move processDecorationButton(Press|Release) to AbstractClient
This also requires to move m_decorationDoubleClickTimer and reworking
a bit how the x11 events are passed to processDecorationButtonPress.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
38d3346faa Mode dontMoveResize from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
a15ccc2215 Move processDecorationMove from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
4d61835988 Move implementation of mousePosition to AbstractClient
Also method does not need to be virtual any more.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
ad6ead1928 Move property noBorder from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
5d36bab6b2 Move implementation for borderFoo() to AbstractClient
Also makes the methods no longer virtual, can just be provided in
AbstractClient.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
a82daabfe9 Scene::buildQuads can operate on AbstractClient for decoration handling 2015-12-18 16:41:49 +01:00
Martin Gräßlin
f112b0b052 Move handling for decoration rects in Deleted::copyToDeleted
Can now operate on the AbstractClient instead of Client.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
c1053ce1a5 Add a base implementation for layoutDecorationRects to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
1659c0b641 Move triggerDecorationRepaint from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
0a82746f91 Move decorationHasAlpha from Client to AbstractClient 2015-12-18 16:41:49 +01:00
Martin Gräßlin
ebe2989649 Move the KDecoration2::Decoration to AbstractClient
This includes the methods:
* decoration()
* decoration() const
* isDecorated() const

In addition new protected methods are added to destroy the Decoration
and to set it.

Usage of m_decoration in Client code is adjusted.
2015-12-18 16:41:49 +01:00
Martin Gräßlin
5f502c141a [autotests/wayland] Disable KActivities in the tests
Makes our tests time out, we're too fast in shutting down.
2015-12-18 16:40:52 +01:00
Martin Gräßlin
55bae74aae Specify inputTransformation in Toplevel
InputRedirection uses the inputTransformation() to pass to SeatInterface
for focused pointer surface. This prepares for proper input
transformation including scaling and rotation.
2015-12-18 15:37:46 +01:00
Martin Gräßlin
6c746764b4 [plugins/qpa] Safety checks in native interface
During startup it might happen that the QPA is already loaded, but
the wayland server and it's internal connection not yet fully
created. Thus safety check for it.
2015-12-18 15:27:47 +01:00
Martin Gräßlin
20a9a2a247 Introduce a --no-kactivities command line option
This change enables kactivities integration by default again on both
X11 and Wayland (as kactivities no longer blocks). As we have an
infrastructure to disable kactivities we can also make use of it and
offer a command line switch to disable kactivities. This might be
useful for using KWin outside of Plasma.

REVIEW: 126153
2015-12-16 10:42:14 +01:00
Martin Gräßlin
96124c1643 Merge branch 'Plasma/5.5' 2015-12-15 13:08:16 +01:00
Nerdopolis Turfwalker
3247382752 [backends/fbdev] Support framebuffers with different color depths
Support more framebuffer color depths

REVIEW: 126262
BUG: 355569
FIXED-IN: 5.5.1
2015-12-15 13:05:00 +01: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
Jonathan Riddell
2f1731222a Update version number for 5.5.1
GIT_SILENT
2015-12-15 10:04:24 +00:00
Martin Gräßlin
2d6fe2cb05 [wayland] Forward error channel of launched processes
This ensures that the redirection to xwayland-errors works properly
for a complete session.
2015-12-15 10:08:36 +01:00