Commit graph

644 commits

Author SHA1 Message Date
Bhushan Shah
3fa287280b Fix the build on armhf/aarch64
Summary:
qopengl.h redeclares the functions defined in the epoxy/gl.h and it
results in the build error. this is similar to other .cpp files where
epoxy/gl.h is used.

See: https://build.neon.kde.org/job/xenial_unstable_plasma_kwin_bin_armhf/157

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D10762
2018-03-06 09:25:33 +05:30
Martin Flöser
e1afef3d45 Sanity check WindowQuad before trying to create a grid out of it
Summary:
When one uses:
 * breeze as of 5.12
 * wobbly windows
 * shaded window
 * a distribution building with assert enabled

and starts to move a shaded window, KWin asserts. The root cause for
this is that WindowQuad::makeSubQuad has an assert for y1 being smaller
than y2. With the combination listed above this is not guaranteed. For
the left shadow quad the y1 and y2 are identical and thus trying to
split it, results in the assert condition.

The problem of the shadow quad having an invalid size might be addressed
as well with D10811. Due to that the generation of the quads is not
touched. Instead a sanity check is introduced to not try to split
already invalid sized quads.

BUG: 390953
FIXED-IN: 5.12.3

Test Plan: Added unit test hit the assert, now doesn't hit it any more

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11015
2018-03-05 19:31:51 +01:00
Fabian Vogt
e302f87598 Properly detect Gallium drivers with newer Mesa
Summary:
The renderer string does not contain "Gallium 0.4 on" anymore,
instead it directly contains the gallium driver's name.
So assume that every unknown renderer is a gallium driver.

Test Plan: Added a testcase, it succeeds only with this patch.

Reviewers: #plasma, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9495
2018-01-12 09:05:03 +01:00
Kai Uwe Broulik
545dda7208 [PaintClipper::Iterator] Operate on QRegion instead of QVector of rects
Differential Revision: https://phabricator.kde.org/D9135
2017-12-03 16:14:53 +01:00
Kai Uwe Broulik
873d38225e [GLVertexBuffer] Port from QRegion::rects() to QRegion iterators
This code path is executed a lot during animations (e.g. maximize, minimize).
Saves creating a temporary QVector.

Differential Revision: https://phabricator.kde.org/D9082
2017-12-02 10:04:22 +01:00
Aleix Pol
af85ca6fe5 Merge branch 'Plasma/5.11' 2017-11-17 17:31:46 +01:00
Aleix Pol
db6c7e17e6 Fix build with a KWindowSystem framework that doesn't pull QWidget
Summary: Fixes the build with D8705

Test Plan: Just adds includes, I wonder if it should go into Plasma/5.8 and /5.11 too

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: graesslin, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8706
2017-11-17 17:30:58 +01:00
David Edmundson
5d07543d2f Merge branch 'Plasma/5.11' 2017-10-26 18:46:43 +01:00
Kamil Piwowarski
9cafbb1179 Fix viewport for screenshot on multiple screens
Summary: D8479 fixes viewport for real hardware, but there is still problem with screenshots. This patch fixes that.

Test Plan:
- Have three monitors (like in bug 385655)
- Press PrtSc and then Enter
- Screenshot is ok

Before:
{F5450056}
After:
{F5450058}

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel, kwin, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8485
2017-10-26 18:45:45 +01:00
David Edmundson
ded617bd1a Merge branch 'Plasma/5.11' 2017-10-26 17:40:34 +01:00
David Edmundson
69b2c2fcea Set scale on glScissor calls
Summary:
glScissor works on window co-ordinates. i.e not scaled by the viewport
We need to multiply by the scale there.

This fixes a minor visual glitch in animations when using hardware
clipping.

Test Plan:
Hardcoded my minimise animation to be really slow.
Now every frame looks perfect

Reviewers: #kwin

Subscribers: kpiwowarski, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8490
2017-10-26 17:32:47 +01:00
David Edmundson
019d4bf425 Fix glScissor calls with y-offset screens
Summary: As per the glViewport patches yesterday.

Test Plan:
Vertically stacked monitors
minimised something, it animated properly

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8503
2017-10-26 17:31:58 +01:00
Martin Flöser
f31e183605 [libkwineffects] Try fixing compile error with clang
The FreeBSD build is currently failing with:

kwingltexture_p.h:83:23: error: no function named 'cleanupGL' with type
'void ()' was found in the specified scope
friend void KWin::cleanupGL();

This change hopefully addresses the problem.
2017-10-01 09:54:12 +02:00
Martin Flöser
8ae37c420b Move SceneOpenGL into a dedicated plugin
Summary:
Unfortunately a rather large change which required more refactoring than
initially expected. The main problem was that some parts needed to go
into platformsupport so that the platform plugins can link them. Due to
the rather monolithic nature of scene_opengl.h a few changes were
required:
* SceneOpenGL::Texture -> SceneOpenGLTexture
* SceneOpenGL::TexturePrivate -> SceneOpenGLTexturePrivate
* texture based code into dedicated files
* SwapProfiler code into dedicated files
* SwapProfiler only used in x11 variants
* Safety checks for OpenGL scene moved into the new plugin
* signal declared in SceneOpenGL moved to Scene, so that we don't need
to include SceneOpenGL in composite

Test Plan: Nested OpenGL compositor works

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7740
2017-09-30 13:12:10 +02:00
Martin Flöser
90e77a939a [effects] Support xcbConnectionChanged for support properties
Summary:
Several effects announce a support property atom on the root window. This
change forwards the KWin::Application's signal that the xcbConnection
changed to the EffectsHandler so that the effects can respond to it.

All effects which announce a support property connect to this new signal
and re-announce the property. In case the xcb connection died (future
XWayland crashing case) it is set to XCB_ATOM_NONE by that. In case the
xcb connection got created (future delayed XWayland startup) the atom is
set to the proper value.

In addition all usages of the support properties are guarded, so that no
nonesense actions are performed if the support property is XCB_ATOM_NONE.

Test Plan: Only compile tested as we don't have XFree KWin yet

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7761
2017-09-12 18:53:31 +02:00
Martin Flöser
20e22ec26a Deprecate global KWin::displayWidth and KWin::displayHeight
Actually they could go directly as nothing in KWin uses them anymore.
But there are more functions in kwinglobal which need to go as they
don't support restarting XWayland. So instead of breaking internal ABI
several times, just deprecate till everything is prepared.
2017-09-01 21:37:42 +02:00
Martin Flöser
8527ac30dc Fix unused-parameter warnings as reported by GCC 2017-07-28 21:31:09 +02:00
Martin Gräßlin
aefb5f4dd9 Prevent endless loop in checkGLError due to GL_CONTEXT_LOST
Summary:
The GL_CONTEXT_LOST flag is not reset when calling glGetError. This of
course bites with: "Thus, glGetError should always be called in a loop,
until it returns GL_NO_ERROR, if all error flags are to be reset."
(see https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml)

As KWin calls checkGLError from init call it can result in a freeze of
KWin. This is a regression reported multiple times since the release of
5.10.3 which enabled GLX_NV_robustness_video_memory_purge extension.

Please note that I am not able to test this change. I do not have an
NVIDIA card and are not hiting the problem. I have no way to simulate
the code. I do not know whether the change will fix the problem, it is
based on what others do. Inspiration for this change is mostly from
mutter: https://git.gnome.org/browse/mutter/commit/?id=d4d2bf0f6c1737256b921c4f1dedd3a95138cab9

BUG: 381870
FIXED-IN: 5.10.3.1

Test Plan: See above, I can only compile check the change

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6464
2017-07-01 19:28:31 +02:00
Martin Flöser
43816119e9 Skip Shader self test for Mesa >= 17
Summary:
We are getting reports about the shader self test failing in a false
positive way on Mesa 17. We already have such false positve results
for NVIDIA quadro and went with disabling the self test.

Most likely our self test has a problem or the rendering of the first
frame has a problem. But disabling compositing because our rendering of
the first frame is broken, is too much.

Let's better be pro user here and disable the shader self test till we
fixed the root problem.

BUG: 376801
FIXED-IN: 5.10.4

Test Plan: It compiles.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6426
2017-07-01 08:19:31 +02:00
David Edmundson
80f21064f1 Merge branch 'scaling' 2017-04-29 14:11:13 +01:00
David Edmundson
9cb666f469 Restore the backend set viewport when popping the final render target
Summary:
The backend is responsible for setting the viewport, the GLRenderTarget
should save and restore the viewport actually set by the backend.

Test Plan:
Ran Blur effect which uses this method, under scaling the viewport "restored"
differed from the one set by the backend.

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4952
2017-04-28 10:23:14 +01:00
David Edmundson
71600d0a02 Take into account scaling in blitFromFrameBuffer
Summary:
This method already translates to s_virtualScreenGeometry as the source
co-ordinates are in compostior space we should take scaling into account here too.

This method already supports resizing if source and target sizes do not match.
Calling funcitons can either double the size of the target if they want native resolution
or leave as-is if they want the result in standard DPI.

This implements scaling in the screenshot, magnifier and simple blur effect.

Test Plan:
Tested screenshot effect using spectacle.
I hit an (unrelated, was reproducible on master) crash whilst using this, so it is not fully tested

Ran magnifier effect manually

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4951
2017-04-28 10:23:13 +01:00
David Edmundson
9ce5832e11 Store GLRenderTarget::scale
Summary:
GLRenderTarget already stores the translation from global compositor
space to the render target co-ordinates, we also need a scale factor for
the exact same reasons.

Test Plan: Used in various effects after this patch and it works there.

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4948
2017-04-28 10:23:13 +01:00
Martin Gräßlin
857d8a9c37 Add a KSharedConfigPtr for kcminputrc to KWin::Application
Summary:
There are a few places where KWin needs to read values from kcminputrc.
As I need to add yet another one it makes more sense to properly
structure it like in other cases and have only one kcminputrc hold in
the application. This also allows to better mock the config values in
the integration tests.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5540
2017-04-24 21:01:03 +02:00
Martin Gräßlin
2132b1e0c8 [effects] Use arg="true" in the kcfg files
Summary:
By changing all kcfg to have arg="true" we can pass in the same
KSharedConfigPtr into all effects. This allows to have fake config in
the tests and in the planned effect demo mode.

Also it means that we don't have to hardcode the name kwinrc into the
files. In the configs - where we cannot access the effectshandler - we
use the define KWIN_CONFIG which gets generated based on the compile
time arguments.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3571
2017-04-15 10:03:34 +02:00
Martin Gräßlin
e6aabf5b9f Add callback functionality for touch screen swipe gestures
Summary:
This is implemented through QActions following the general approach
inside KWin and not the older approach used by ScreenEdges for pointer
callback activation.

Test Plan: Extended auto test

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5263
2017-04-07 16:16:34 +02:00
Kai Uwe Broulik
1eb950a985 Desaturate non-responsive windows
When an application is not responding, its window is desaturated to communicate this.
Also "(Not Responding)" is added to the title bar.

Differential Revision: https://phabricator.kde.org/D5245
2017-04-05 11:16:23 +02:00
David Edmundson
ebebc6ca82 Provide scale offset to WindowVertex calculation
Summary:
WindowVertex contains the x position and also the relative texture x position

Our textures are scaled bigger than kwin's resolution, so this makes sure we set the right
texture position.

Otherwise our final array ends up using 0 to 0.5 of the texture, not 0 to 1.

Test Plan:
Opened some 2x windows, on a 1x output.
It looked how it should do, instead of it being double the size and cropped

Tested some things that use quads, like wobbly windows

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3502
2017-03-29 20:53:22 +01:00
Martin Gräßlin
22c91df2ec Add support for global touchpad swipe gestures
Summary:
This change adds global touchpad swipe gestures to the
GlobalShortcutsManager and hooks up the swipe gestures as defined at the
Plasma Affenfels sprint:
 * swipe up: Desktop Grid
 * swipe down: Present Windows
 * swipe left: previous virtual desktop
 * swipe right: next virtual desktop

The main work is handled by two new classes: SwipeGesture and
GestureRecognizer. This is implemented in a way that it can be extended
to also recognize touch screen gestures and pinch gestures.

The SwipeGesture defines what is required for the gesture to trigger.
Currently this includes the minimum and maximum number of fingers
participating in the gesture and the direction. The gesture gets
registered in the GestureRecognizer.

The events for the gesture are fed into the GestureRecognizer. It
evaluates which gestures could trigger and tracks them for every update
of the gesture. In the process of the gesture tracking the
GestureRecognizer emits signals on the Gesture:
 * started: when the Gesture gets considered for a sequence
 * cancelled: the Gesture no longer matches the sequence
 * triggered: the sequence ended and the Gesture still matches

The remaining changes are related to hook up the existing shortcut
framework with the new touchpad gestures. The GlobalShortcutManager
gained support for it, InputRedirection and EffectsHandler offer methods
to register a QAction. VirtualDesktopManager, PresentWindows and
DesktopGrid are adjusted to support the gesture.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D5097
2017-03-27 17:43:44 +02:00
Martin Gräßlin
d38bce776f Add support for skip close animation to OnScreenMessage
Summary:
This change adds support for marking the OnScreenMessage as it should
skip close animation. The screenshot effect is adjusted to use the
on screen message instead of the custom effect frame.

Test Plan: Message window is not captured when taking screenshot

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D4091
2017-01-25 13:54:34 +01:00
Martin Gräßlin
ab45659677 Add support for on-screen-message to kwineffects
Summary:
This adds support for the new on-screen-message support to the
kwineffects API and makes use of it in the colorpicker effect.

Not yet added to screenshot effect as for that we need support for
skip close animation on the on-screen-message window.

Reviewers: #plasma, #kwin

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3803
2016-12-24 09:56:48 +01:00
David Edmundson
adbd9fc54a Initialise all variables for WindowVertex.
Summary:
The default constructor shouldn't have been used anyway, but better safe
than sorry.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3453
2016-11-25 09:46:07 +00:00
Martin Gräßlin
f9f7b84cb4 Add interactive position selection to screenshot screen under cursor
Summary:
A second interactive selection mode gets added to select a position on
the screen. This is handled by the same input event filter as for the
window selection. Just that instead of returning a window, it returns a
QPoint.

This allows to pick a point on the screen which we need to screenshot
the screen under the mouse cursor and in future for color picking.

The screenshot effect provides two new dbus methods to (interactively)
select a screen or fullscreen. This allows spectacle to screenshot the
(full) screen with still having the user in control.

Reviewers: #kwin, #plasma_on_wayland, bgupta

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3475
2016-11-25 07:38:37 +01:00
Martin Gräßlin
0dc500fe94 Move linking to DL_LIBRARY to x11standalone platform
Summary:
It's only needed by the GLX backend, so only find if we have GLX at all
and only link where needed. As it was handled incorrectly before, it's
now using proper ifdef.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3448
2016-11-22 14:22:06 +01:00
Martin Gräßlin
42456bdf7b Remove epoxy/egl.h from kwinglutils_func.h
Summary:
It's not needed inside libkwinglutils. The only required usage is from
abstract_egl_backend.h where the include is moved to.

This removes an fixx11h.h from a kwin lib.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3447
2016-11-22 14:21:40 +01:00
Martin Gräßlin
b1e258d1e9 Remove useless branching on EGL/GLX in GLPlatform
Summary:
The code for EGL and GLX platform did the same checks, just with the
difference that the EGL check has another check for isGLES.

So let's just do the branching on whether isGLES or GL.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3446
2016-11-22 07:46:22 +01:00
Martin Gräßlin
17e0bad922 Drop OpenGL based color correction from KWin
Summary:
The feature has always been considered experimental. Unfortunately it is
completely unmaintained and hasn't seen any commits in years. It
requires kolor-manager to function, but that has not seen a release
based on frameworks yet. This makes it difficult to maintain. In fact I
have never been able from the introduction till now to setup a color
corrected system. One needs kolor-manager and oyranos and especially the
latter is hardly available on any linux distribution (e.g. not on the
Debian/Ubuntu systems).

Due to being unmaintained color correction in KWin did not keep up with
recent changes. Neither did it see any updates during the xlib->xcb
port, nor during the Wayland port. Especially the Wayland port with the
rendering changes make it unlikely to function correctly. E.g. Wayland
introduced a proper per-screen rendering, while color correction did a
"fake" per screen rendering. How that is going to work in combination is
something nobody ever tried. Now after the introduction of proper
per-screen rendering the solution would be to port color correction to
the new api, but that never happened.

Color correction also modified the shaders, but a newer shader API got
introduced some time ago. Whether the color correction shader support
that or not, is unknown to me. Also which shader language versions are
supported. I know it was based on 3d texture support, which back on
introduction was partially lacking in OpenGL ES. Nowadays that changed,
but color correction didn't update.

Last but not least it is completely X11 based and there is no work on
how to make it work with Wayland.

Given all the problems, especially the fact that it is unmaintained and
cannot be setup on my system, means to me that the only solution is to
remove it.

I'm open to having it reintroduced in future, but only if the
availability on Linux distributions gets addressed before. As long as
major linux distributions do not ship this feature, it should not be in
KWin. Given that I must say that it was a mistake to add it in the first
place and I need to point out that I was against the merge back then.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3402
2016-11-22 07:16:51 +01:00
Martin Gräßlin
32422fd8cc Drop kwinconfig.h include from kwinglutils_funcs.h
Not used.
2016-11-17 14:25:28 +01:00
Martin Gräßlin
9d8833afdc Remove kwinglobal.h include from kwinglutils_funcs.h
Not used.
2016-11-17 14:18:00 +01:00
Martin Gräßlin
cb3b0232dd [kwinglutils] Drop unused macro MAKE_GL_VERSION
No longer needed, as replacement there would be kVersionNumber
2016-11-17 14:15:21 +01:00
Martin Gräßlin
27376e39ef [effects] Add interactive window selection mode to ScreenshotEffect
Summary:
EffectsHandler gains a new method to startInteractiveWindowSelection
which just delegates to the one in Platform. That way a window can be
selected and returned to an Effect.

The screenshot effect makes use of this new functionality and provides
an interactive window screenshot mode which saves to a temporary file.
Note that this is not yet the variant intended for use in spectacle.

Test Plan: Took a screenshot on Wayland

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3367
2016-11-17 14:06:01 +01:00
Martin Gräßlin
e5f02e822d [kwinglutils] Remove unused s_eglExtensions variable
Left over from incomplete removal.
2016-11-17 13:58:05 +01:00
Martin Gräßlin
b9884672f4 [kwinglutils] Drop variable glTextureUnitsCount
Summary: Unused and even potentially not set.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3399
2016-11-17 13:58:05 +01:00
Martin Gräßlin
00c9560519 [kwinglutils] Drop functions related to (nearest) power of two
Summary:
Not used anywhere in KWin and annotated that they should be removed. As
we have an ABI break in 5.9 we can remove them now.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3398
2016-11-17 13:57:40 +01:00
Martin Gräßlin
d1de6899fd Move querying the egl extensions into the AbstractEglBackend
Summary:
Instead of having the egl extensions in the global kwinglutils lib it
becomes private to the AbstractEglBackend. Just like on glx the
glxextensions are moved into the platform.

The extensions are queried from initEglAPI, that is as early as possible
after initializing the EGLDisplay. This ensures that any implementing
subclass can access the extensions early enough.

As a note: the EglOnXBackend had a potentially wrong sequence for
initializing the buffer age extension. It is now moved to the correct
place where the result is needed for the first time.

From the global API eglExtensions are removed from hasGLExtension and
the eglExtensions function is dropped. As by that initEGL did not do
anything it is also dropped.

Test Plan:
Tested nested kwin on Wayland, still works, extensions shown
in debug console

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3396
2016-11-17 13:00:29 +01:00
Martin Gräßlin
dcf7f40c18 [kwinglutils] Drop eglResolveFunctions
Summary:
Method doesn't do anything. If at some point we want to resolve egl
functions again, it should be done in the Platform, just like
glxResolveFunctions is nowadays done in the platform.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3391
2016-11-17 12:59:48 +01:00
Martin Gräßlin
5d3e15ff3a [kwinglutils] Drop hasEGLVersion function
Summary:
It's unused in KWin and absolutely not needed as the call to
eglInitialize, which every platform does, also gives the version for
free. So no need to do any caching in a global method.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3390
2016-11-17 12:59:04 +01:00
Martin Gräßlin
346619aa36 Remove KWin::display from kwinglobals
Summary:
And finally nothing inside libkwineffects, libkwinglutils,
libkwinxrenderutils and kwineffect and kwin core uses KWin::display.
We are finally XLib free!

This change drops KWin::display and removes the include to QX11Info from
kwinglobals.h. And the libraries no longer need to link X11Extras.  Due
to that removal a few seeming unrelated changes are required to add the
include where needed and linkage to X11Extras.

The biggest change is to x11 platform plugin which still needs the
display and caches it in the Platform and passes it to various places in
a way that the code doesn't need to be adjusted.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3337
2016-11-16 18:00:00 +01:00
Martin Gräßlin
d7fa827644 Pass function ptr to resolve glFunctions to initGL
Summary:
KWin still resolves some OpenGL function pointers. For that it needs to
use either eglGetProcAddress or glxGetProcAddress. With other words the
method to resolve needs to know whether it is egl or glx and needs both
a dependency to egl and glx. Especially the dependency to glx is ugly as
that pulls in XLib into our library.

The way so far was to pass an enum value to the initGL method to know
whether it's EGL or GLX. With this change the enum value is removed and
replaced by a function pointer to resolve the methods.

This simplifies the resolve code and allows to completely remove the glx
variant we still had in the library. Thus kwinglutils library is now glx
and XLib free.

Test Plan: nested KWin with OpenGL/EGL still works

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3336
2016-11-16 17:59:26 +01:00
Martin Gräßlin
1c819c5e86 Drop EffectsHandler::effectsConfig
Summary:
The effectsConfig is no longer used by any Effect. ScriptedEffects use
KWin's KSharedConfigPtr and the builtin effects all have a kcfg with
kwinrc being hard coded.

The effectsConfig had the big disadvantage that it hardcoded kwinrc
while the rest of kwin uses a KSharedConfigPtr which might not point to
kwinrc.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3384
2016-11-16 15:31:33 +01:00