[kwin] Fix ifdefs for Wayland
With the switch to FindWayland from ECM WAYLAND_FOUND was no longer set thus the ifdef didn't work. Now we use HAVE_WAYLAND and HAVE_WAYLAND_EGL.
This commit is contained in:
parent
9f22a99887
commit
92761e9e30
9 changed files with 19 additions and 15 deletions
|
@ -59,6 +59,8 @@ endif()
|
|||
# for things that are also used by kwin libraries
|
||||
configure_file(libkwineffects/kwinconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/libkwineffects/kwinconfig.h )
|
||||
# for kwin internal things
|
||||
set(HAVE_WAYLAND ${Wayland_Client_FOUND})
|
||||
set(HAVE_WAYLAND_EGL ${Wayland_Egl_FOUND} AND ${Wayland_Client_FOUND})
|
||||
configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h )
|
||||
|
||||
|
||||
|
|
|
@ -8,3 +8,5 @@
|
|||
#define KWIN_NAME "${KWIN_NAME}"
|
||||
#define KWIN_CONFIG "${KWIN_NAME}rc"
|
||||
#define KWIN_VERSION_STRING "${KDE4WORKSPACE_VERSION}"
|
||||
#cmakedefine01 HAVE_WAYLAND
|
||||
#cmakedefine01 HAVE_WAYLAND_EGL
|
||||
|
|
|
@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <assert.h>
|
||||
#include "composite.h"
|
||||
#include "xcbutils.h"
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
#include "wayland_backend.h"
|
||||
#endif
|
||||
|
||||
|
@ -771,7 +771,7 @@ void EffectsHandlerImpl::startMouseInterception(Effect *effect, Qt::CursorShape
|
|||
return;
|
||||
}
|
||||
if (kwinApp()->operationMode() != Application::OperationModeX11) {
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
if (Wayland::WaylandBackend *w = Wayland::WaylandBackend::self()) {
|
||||
w->installCursorImage(shape);
|
||||
}
|
||||
|
@ -1265,7 +1265,7 @@ QSize EffectsHandlerImpl::virtualScreenSize() const
|
|||
void EffectsHandlerImpl::defineCursor(Qt::CursorShape shape)
|
||||
{
|
||||
if (!m_mouseInterceptionWindow.isValid()) {
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
if (Wayland::WaylandBackend *w = Wayland::WaylandBackend::self()) {
|
||||
w->installCursorImage(shape);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "eglonxbackend.h"
|
||||
// for Wayland
|
||||
#include "config-workspace.h"
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND_EGL
|
||||
#include "egl_wayland_backend.h"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -224,7 +224,7 @@ SceneOpenGL *SceneOpenGL::createScene()
|
|||
break;
|
||||
case EglPlatformInterface:
|
||||
#ifdef KWIN_HAVE_EGL
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND_EGL
|
||||
if (kwinApp()->shouldUseWaylandForCompositing()) {
|
||||
backend = new EglWaylandBackend();
|
||||
} else {
|
||||
|
|
|
@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "main.h"
|
||||
#include "paintredirector.h"
|
||||
#include "toplevel.h"
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
#include "wayland_backend.h"
|
||||
#endif
|
||||
#include "workspace.h"
|
||||
|
@ -75,7 +75,7 @@ void QPainterBackend::setFailed(const QString &reason)
|
|||
m_failed = true;
|
||||
}
|
||||
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
//****************************************
|
||||
// WaylandQPainterBackend
|
||||
//****************************************
|
||||
|
@ -209,7 +209,7 @@ bool WaylandQPainterBackend::needsFullRepaint() const
|
|||
SceneQPainter *SceneQPainter::createScene()
|
||||
{
|
||||
QScopedPointer<QPainterBackend> backend;
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
if (kwinApp()->shouldUseWaylandForCompositing()) {
|
||||
backend.reset(new WaylandQPainterBackend);
|
||||
if (backend->isFailed()) {
|
||||
|
|
|
@ -100,7 +100,7 @@ private:
|
|||
bool m_failed;
|
||||
};
|
||||
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
namespace Wayland {
|
||||
class Buffer;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "workspace.h"
|
||||
#include "xcbutils.h"
|
||||
#include "kwinxrenderutils.h"
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
#include "wayland_backend.h"
|
||||
#endif
|
||||
|
||||
|
@ -256,7 +256,7 @@ bool X11XRenderBackend::usesOverlayWindow() const
|
|||
//****************************************
|
||||
// WaylandXRenderBackend
|
||||
//****************************************
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
static void handleFrameCallback(void *data, wl_callback *callback, uint32_t time)
|
||||
{
|
||||
Q_UNUSED(data)
|
||||
|
@ -367,7 +367,7 @@ bool WaylandXRenderBackend::usesOverlayWindow() const
|
|||
SceneXrender* SceneXrender::createScene()
|
||||
{
|
||||
QScopedPointer<XRenderBackend> backend;
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
if (kwinApp()->shouldUseWaylandForCompositing()) {
|
||||
backend.reset(new WaylandXRenderBackend);
|
||||
if (backend->isFailed()) {
|
||||
|
|
|
@ -152,7 +152,7 @@ private:
|
|||
xcb_render_pictformat_t m_format;
|
||||
};
|
||||
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
class WaylandXRenderBackend : public XRenderBackend
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "useractions.h"
|
||||
#include "virtualdesktops.h"
|
||||
#include <config-workspace.h>
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
#include "wayland_backend.h"
|
||||
#endif
|
||||
#include "xcbutils.h"
|
||||
|
@ -150,7 +150,7 @@ Workspace::Workspace(bool restore)
|
|||
InputRedirection::create(this);
|
||||
|
||||
// start the Wayland Backend - will only be created if WAYLAND_DISPLAY is present
|
||||
#ifdef WAYLAND_FOUND
|
||||
#if HAVE_WAYLAND
|
||||
Wayland::WaylandBackend::create(this);
|
||||
#endif
|
||||
// start the cursor support
|
||||
|
|
Loading…
Reference in a new issue