Commit graph

13564 commits

Author SHA1 Message Date
Martin Gräßlin
6326d96c02 [backends/x11] Set a black background pixel on our rendering window
By setting a black background pixel the window doesn't open with
garbage content (garbage being copy content of what was in the
framebuffer).
2015-09-18 11:06:33 +02:00
Martin Gräßlin
23f1b04a71 Fix regression in Workspace::activateNextClient
This fixes yet another regression from the transient refactoring.
The passed in client might be null, so we need a nullptr check. There
are several already in that code.

Was tricky given that I removed a cast there.
2015-09-17 16:15:26 +02:00
Martin Gräßlin
000954c508 Allow transients to go over dock windows under certain conditions
For Wayland transients are popups relative to a parent surface. This
means for a dock window we obviously want them above the dock, otherwise
the context menu would be below the dock.

To not break the existing functionality (which makes sense) we bind
it to whether the transient has a positioning hint - that's only set
for ShellClients.
2015-09-17 14:33:54 +02:00
Martin Gräßlin
a6118016ec Reintroduce nullptr check in Client::removeFromMainClients
Removed by accident in 69be73d3, of course needed and causes an
unusable session due to kwin crashing when managing clients.

Sorry!
2015-09-17 14:17:55 +02:00
Martin Gräßlin
9988fa9d74 Add safety check for recursive transient for
An AbstractClient cannot be transient for itself.
2015-09-17 14:10:57 +02:00
Martin Gräßlin
d25c465211 Move layer functionality to AbstractClient
Merges together the code from ShellClient and Client and removes the
starting differences. Long term it's better to have only one
implementation to prevent diversions in the implementation.

As it doesn't match exactly protected virtual methods are called
which allow more specific implementations for a certain aspect of the
layer resolving.
2015-09-17 11:06:59 +02:00
Marco Martin
49e5e81970 support raise and lower windows on wayland
connect raise/lowerRequested to workspace()->raiseClientRequest
/workspace()->lowerClientRequest
REVIEWED-BY:Martin Graesslin
2015-09-16 16:36:26 +02:00
Martin Gräßlin
fc5b303c5f Workspace::raiseClientWithinApplication opertes on AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
e46bf87311 Workspace::lowerClientWithinApplication operates on AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
c4f02a6677 Pass through mainClients for AbstractClient in EffectWindowImpl 2015-09-16 13:54:48 +02:00
Martin Gräßlin
f84b4758f2 Fix incorrect static_casts to Client
Replace by better dynamic_casts to AbstractClient.
2015-09-16 13:54:48 +02:00
Martin Gräßlin
5f429625f0 Workspace::topClientOnDesktop returns AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
a9d8926d3c Workspace::findDesktop returns AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin
a421f546cd Move functionality of Client::updateLayer to AbstractClient
With transient support in AbstractClient we can provide the
functionality in AbstractClient.
2015-09-16 13:54:48 +02:00
Martin Gräßlin
b199356774 Move functionality from Client::doSetDesktop to AbstractClient::setDesktop
Functionality related to transient handling can now be provided by
AbstractClient.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
4a3d0fdac6 Workspace::updateOnAllDesktopsOfTransients operates on AbstractClient 2015-09-16 13:54:47 +02:00
Martin Gräßlin
69be73d382 Remove no longer needed casts to Client regarding transients
Restores to functionality before refactoring.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
0003008668 Fixup with removeTransietn 2015-09-16 13:54:47 +02:00
Martin Gräßlin
4e6ea0808a Workspace::constrainedStackingOrder supports transients on AbstractClient 2015-09-16 13:54:47 +02:00
Martin Gräßlin
2f7597e522 Move transients from Client to AbstractClient
Unfortunately introduces a few casts to Client again.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
2da04aa26b Use auto where we call ensureStackingOrder(client->transients())
Preparation step for switching transients from Client to AbstractClient.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
4ad749e560 Workspace::ensureStackingOrder can operate on QList<Client*> or QList<AbstractClient*>
Preparation for getting Client::transients() to be AbstractClient as
ensureStackingOrder is called on the transients.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
ba8d11b305 Better support AbstractClient in Deleted::copyToDeleted
At the moment only decoration/border handling is Client specific.
Everything else can be shared with AbstractClient.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
305699be8e Move modal from Client to AbstractClient 2015-09-16 13:54:47 +02:00
Martin Gräßlin
1d242d9daf Move mainClients() and allMainClients from Client to AbstractClient
AbstractClient::mainClients is virtual and overriden in Client,
allMainClients has only a common implementation in AbstractClient.

In activation.cpp we still need one case where a temporary ClientList
needs to be constructed. Once transients are fully migrated that should
be removable again.
2015-09-16 13:54:47 +02:00
Martin Gräßlin
a5d3317645 Use auto for iterator over transients()
Preparation for changing transients to QList<AbstractClient>.
2015-09-16 13:52:25 +02:00
Martin Gräßlin
df98e3883f Move hasTransient from Client to AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin
1e00e1597a Workspace::keepTransientAbove operates on AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin
fda5a5feea [wayland] A popup shell surface doesn't want input 2015-09-16 13:52:25 +02:00
Martin Gräßlin
a86a7e7b3c Add a placement strategy for transient ShellClients
A transient ShellClient has an offset position to the parent surface.
Use this to position the ShellClient properly.

This fixes the random placement of menus.
2015-09-16 13:52:25 +02:00
Martin Gräßlin
0935a60b38 Implement transientFor in ShellClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin
c4c3dfc73f Move transientFor from Client to AbstractClient
Right now this caused a few dynamic_casts. On the other hand existing
dynamic_casts from AbstractClient to Client can be removed again.
2015-09-16 13:52:25 +02:00
Martin Gräßlin
07dd743412 Move transient property from Client to AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin
16e9c8375c [wayland] Don't delete Surface we got fromWindow
KWayland changed to cache created Surfaces and not create a new one
each time. If we delete it, we run in double deleted situations.
2015-09-15 12:18:36 +02:00
Martin Gräßlin
cd254c8f47 [wayland] Configure key repeat
We take the configuration from the kcminputrc config file, group
keyboard (see plasma-desktop.git/kcms/keyboard/kcmmisc.cpp)

The values are only used for libinput. For backends providing input
events we expect to get repeated key events anyway.
2015-09-15 10:29:06 +02:00
Thomas Lübking
1ab663436d Merge branch 'Plasma/5.4' 2015-09-14 21:02:41 +02:00
Thomas Lübking
3a1f11d213 delay QuickTiling indication on inner screenborder
The user might just want to move the window from
one screen to another, no point in wasting time to
show the indicator

BUG: 352050
REVIEW: 125024
FIXED-IN: 5.5
2015-09-14 21:02:02 +02:00
Thomas Lübking
295132deef reset the transientInfo id when cleaning group
otherwise a pseudo-transient window with no
group causes a nullptr deref in eg. mainClients

BUG: 352483
FIXED-IN: 5.4.2
REVIEW: 125122
2015-09-14 21:01:22 +02:00
Thomas Lübking
584850f160 ensure to "hide" desktop buttons
before, hiding the buttons relied on the effect
seeing a paint event for the (with a low timeline
value) what's too wonky at least for instant animations
(certain failure) or when effect exits immediatey
(due to screen edge invocation issues or whatever)

BUG: 351869
FIXED-IN: 5.4.2
REVIEW: 124970
2015-09-14 21:01:22 +02:00
Thomas Lübking
cc6886d7dd fetch motif hints when get them for managed client
notably *after* storing the old values.
Otherwise the old value is polluted because of
m_hints being nullptr, thus a default value is
returned (instead of the actual old value)

BUG: 347818
FIXED-IN: 5.4.2
REVIEW: 125007
2015-09-14 21:01:22 +02:00
Thomas Lübking
57f8c6d5f8 recreate presentwindows grids from desktopgrid
Theory:
----------
because PresentWindowsEffect::screenCountChanged() is shortcut
for "if (!isActive())", but the desktopgrid doesn't call
PresentWindowsEffect::setActive (or at least
PresentWindowsEffect::screenCountChanged), so the effect can
"miss" the increasing screen count change (it sees the signal,
but ignores it) and when desktopgrid calls it, it assumes the
m_gridSizes array is big enough (but it isn't)

Steps:
----------
1. effects are loaded, 1 screen present
2. 2nd screen gets added, but inactive effects ignore that
3. desktop grid gets activated, updates according to screen count,
   calls presentwindows for screen #2
4. presentwindows data is only prepared for one screen from step 1
   => BOOM

BUG: 351724
CCBUG: 326032
FIXED-IN: 5.4.2
REVIEW: 124960
2015-09-14 21:01:01 +02:00
Martin Gräßlin
0c448f2ed2 Merge branch 'Plasma/5.4' 2015-09-14 16:52:06 +02:00
Marco Martin
5a55727056 support the slide protocol
take and apply thhe informations from the wayland slide
protocol in the sliding popups effect

REVIEW:125120
2015-09-14 16:39:39 +02:00
Martin Gräßlin
873b4ed717 Fix build with some compilers
If it's a QPointer the connect needs a .data()
2015-09-11 14:53:34 +02:00
Martin Gräßlin
43f6c1e041 [wayland] Add support for DpmsInterface
Our server announces the DpmsManagerInterface and in the DRM backend
we announce support for Dpms on the OutputInterface (if the Output
supports it) and we connect to changing Dpms requests.
2015-09-10 14:32:41 +02:00
Martin Gräßlin
679da47235 [wayland] Don't run Compositor loop if all outputs are disabled
This ensures that the Compositor doesn't perform compositing and doesn't
run the compositing timer if e.g. all outputs are dpms disabled. Thus
we don't render any more, don't trigger wakeups and block applications
from rendering if they properly implement the frame rendered callback.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
ffa075490e [drm] Mark outputs as disabled in backend depending on DPMS state
Whenever the dpms of an output changes we update the outputs enabled
state in the AbstractBackend.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
4f1033f17b [wayland] AbstractBackend indicates whether outputs are enabled
By default Outputs are considered to be enabled. This allows a
concrete backend implementation to mark outputs as disabled (e.g.
if dpms has put outputs into powersaving mode). This allows the
Compositor to disable itself if outputs are not visible anyway.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
e3ff85d4d9 [drm] Re-enable Output on input event
If an Output went into DPMS standby we need to re-enable the Output
once we get any input event.

For this we connect to the signals of InputRedirection once we go
to standby. Once we enable again, we disconnect (to not handle the
events all the time), blank the screen (initial modesetting) and
trigger a complete repaint.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
6281cf84b4 [drm] Make DrmOutput a QObject
Needs to emit signals when DPMS changes and also needs private slots
when DPMS changes.
2015-09-10 14:31:46 +02:00