Commit Graph

286 Commits (f4ee319c6a2cb5d2017108000bf942111de5b3c9)

Author SHA1 Message Date
Martin Gräßlin f4ee319c6a Move XShm helper class to xcbutils
That way it can be used also in other parts of KWin.
2014-01-08 09:22:40 +01:00
Martin Gräßlin baf477ac00 Split out non-EGL functionality of WaylandBackend into own source files
The functionality to create the connection to a Wayland compositor and
creating a fullscreen surface is moved into wayland_backend.(h|cpp). The
wl_egl_window for the surface is moved into the EglWaylandBackend to have
the actual WaylandBackend free from Egl. This will allow in future to
implement other compositing backends for Wayland which do not use egl.
This means that egl is no longer a build requirement for the wayland
related functionality.
2014-01-08 09:22:40 +01:00
Martin Gräßlin 144003a0aa [kwin] Generate dbus interface for Appmenu
Generated code > hand written code.
2014-01-07 14:06:56 +01:00
Martin Gräßlin d536532f66 [kwin/tabbox] Use a QmlComponent instead of a QQuickView for TabBox
By not using a QQuickView it becomes possible to just use a
PlasmaCore.Dialog or a Quick.Window in the TabBox qml and thus it's
possible to simplify the qml code.

To support this a new SwitcherItem is introduced and exported to QML.
It's a simple QObject providing all the properties which used to be
exported to the root context. A declarative TabBox is expected to
use one of these items. The C++ side finds the Switcher and for that
supports the case that the SwitcherItem is the rootItem or a child
item.

A declarative TabBox has also to create a QQuickWindow, e.g. a
PlasmaCore.Dialog. The visibility of that window should be controlled
through the visible property on the SwitcherItem. The underlying C++
implementation assumes that a TabBox only uses one window (it needs to
get destroyed once it's hidden and included in highlight windows).

Thanks to this change it's no longer needed to reload the TabBox
whenever it gets shown or the alternative TabBox gets shown. Instead
the same QML script can get reused. Other created switchers are ignored
as the visible property won't be changed to true.
2013-12-12 09:37:29 +01:00
Martin Klapetek 54bc491c46 Port to KF5 renaming changes 2013-12-11 21:41:47 +01:00
Martin Gräßlin c063978591 Adjust to new KGlobalAccel framework 2013-12-10 07:38:54 +01:00
Martin Gräßlin fc21f99df6 [kwin] Remove the image provider for the TabBox
No longer needed as we have the icon passed to QML.

A nice side-effect: we don't need KIconThemes in KWin any more.
2013-12-06 16:26:21 +01:00
Martin Gräßlin a192734ac9 [kwin] Good bye KDE4Support 2013-12-06 10:33:45 +01:00
Martin Gräßlin e92d02ab61 [kwin] Remove include of kdemacros.h from kwinglobals
Instead we generate an export header for kdeinit_kwin and use it
to declare the KWIN_EXPORT. With this change our libs don't include
any KDE4Support headers any more. One step closer to no KDE4Support.
2013-12-06 08:37:16 +01:00
Jacob Logan 199ed87c61 [libkdecorations] Generate an export header
REVIEW: 114247
2013-12-05 10:00:46 +01:00
Aleix Pol 94f31606e6 CMake macros porting
kconfig_add_kcfg_files
qt5_add_dbus_adaptor
qt5_generate_dbus_interface
2013-11-27 16:11:14 +01:00
Martin Gräßlin 29926f3caf [kwin] Drop check for KDE_PLATFORM_PROFILE 2013-11-25 13:59:45 +01:00
Aleix Pol 7b110f0671 Improve CMake usage
It's basically a run of the port-cmake.sh script in here, mostly the changes
are the following:
- Using KF5::* targets
- Using the proper macros, following recent developments in frameworks
2013-11-15 13:37:47 +01:00
Martin Gräßlin c32ec9b32b [kwin] Work around broken xcb_sync_create_alarm
The xcb sync protocol is incorrectly defined (see [1]) which results in
xcb_sync_create_alarm not creating a valid alarm. To work around this
issue we only create the alarm without setting the int64 values. For
those we use the XLib XSyncChangeAlarm call after we verified that the
alarm got created. This unfortunately reintroduces linking against
libxext. But at least resizing works again.

[1] http://lists.freedesktop.org/archives/xcb/2013-June/008375.html
2013-11-11 11:36:26 +01:00
Martin Gräßlin 324aae916a [kwin] Drop testapp for detecting whether direct rendering works on glx
The main purpose of the opengl testapp was to set the environment
variable LIBGL_ALWAYS_INDIRECT if direct rendering is not supported
before glx gets initialized.

With Qt5 we may no longer set this environment variable. QtQuick
requires direct rendering. On IvyBridge QtQuick is crashing if the
variable is set. Thus we are no longer allowed to set it and thus the
complete test becomes pointless.

The test app basically whitelisted most drivers anyway, the only
drivers which were problematic are the proprietary Catalyst drivers.
It that's still a problem we can also disable OpenGL compositing on
those drivers through the recommendation in the GLPlatform.

This also means that the KWIN_DIRECT_GL variable is no longer useful.
2013-11-05 14:48:40 +01:00
David Edmundson 59e3d0e099 kde4_install_icons -> ecm_install_icons
REVIEW: 113600
2013-11-04 13:24:41 +01:00
Aurélien Gâteau 05b6de1002 ${KDE4Support_LIBRARIES} => KF5::KDE4Support
Fixes a few link errors
2013-10-29 13:00:46 +01:00
Sebastian Kügler b68867463e Change KF5::plasma to KF5::Plasma
Library name has changed in plasma-framework to bring it in line with
KF5:CamelCasing naming.
2013-10-16 01:36:56 +02:00
Martin Gräßlin e3618e8796 [kwin] Follow Qt's OpenGL choice for KWin
As KWin indirectly uses Qt's OpenGL through QtQuick we need to ensure
to not mix OpenGL and OpenGLES. So we have to built KWin only against
OpenGL if Qt is built against OpenGL and we have to built KWin only
against GLESv2 if Qt is built against GLESv2.

This means the kwin_gles binary is no more. There is only kwin which
either links GL or GLESv2.
2013-10-14 09:04:03 +02:00
Sebastian Kügler 1c3e540507 kde4_add_kdeinit_executable becomes kf5_add_kdeinit_executable 2013-10-08 01:00:27 +02:00
Sebastian Kügler bfe710dce7 KF5::KDeclarative 2013-10-04 22:21:22 +02:00
Martin Gräßlin a63ca0c311 Fix linking and includes
Seems like there were some changes, we need more explicit linking.
2013-10-02 15:23:56 +02:00
Martin Gräßlin 5d185a9adc Welcome back to kcmkwin - so far only desktop
Note to people compiling from source: it's only the default of the
cmake variable which got changed. You have to delete the variable
from the cache to get this change.
2013-09-27 13:45:25 +02:00
Sebastian Kügler a1641efdf1 Remove kdeqt5staging
Reviewed-by: Martin
2013-09-11 13:57:41 +02:00
Martin Gräßlin caad13ff95 Use new components based Find XCB 2013-09-09 06:03:35 +02:00
Martin Gräßlin 489addf901 Add default debug area to KWin main CMakeLists 2013-09-02 10:34:00 +02:00
Martin Gräßlin a536e07488 Use kdeqt5staging for QCommandLineParser
Makes it also compile with not latest Qt.
2013-08-29 16:22:30 +02:00
Martin Gräßlin fb111be903 Use Qt5::Script in linker definition of KWin core
Missed that one in the other commit.
2013-08-20 10:49:33 +02:00
Martin Gräßlin e21225fa47 Use XCB Shape instead of XLib Shape in KWin core 2013-08-20 09:48:14 +02:00
Martin Gräßlin 84a2f3020b Use Qt5:: in target link libraries in KWin 2013-08-20 09:14:24 +02:00
Martin Gräßlin 5ca6654eb8 Fix linking
KDEUI is dead which caused collateral damage.
2013-08-20 08:47:47 +02:00
Martin Gräßlin 5007a19062 Add a ScreenEdgeItem to reserve a screen edge from QML
Usage:
ScreenEdgeItem {
    edge: ScreenEdgeItem.LeftEdge
    onActivated: doSomething()
}
2013-08-13 09:57:51 +02:00
Martin Gräßlin 96bde02b38 New QML Type DBusCall
The DBusCall is exported as a QObject to the QML environment. It is
intended as a declarative replacement for the callDBus method which used
to be exported on global scope in the QtQuick 1 world.

Example usage:
DBusCall {
    id: dbus
    service: "org.kde.KWin"
    path: "/KWin"
    method: "setCurrentDesktop"
    arguments: [1]
    Component.onCompleted: dbus.call()
}
2013-08-13 09:57:51 +02:00
Martin Gräßlin abbe84bab4 Port declarative scripting to QtQuick
Getting all functionality from old solution into new one is not really
possible. Main problems are that QtScript provided more functionality
than the QJSEngine. For example it's no longer possible to just export
functions to the engine. We need to have a Qt wrapper object. At the
moment this wrapper object doesn't export all functions as the callbacks
are tricky. A solution might be to create specific QML types
encapsulating functionality which used to be exported on the functions.

Nevertheless a basic QML script loads and works and the ported readConfig
function works, too.
2013-08-13 09:57:51 +02:00
Martin Gräßlin 69b109b5b9 Adjust the ThumbnailItems to QtQuick2
AbstractThumbnailItem inherits from QQuickPaintedItem using QPainter to
do the fallback painting of icons.

The scene is adjusted to get the information from QQuickItem instead of
QDeclarativeItem. Clipping got a little bit more complex as the clip
path does not exist any more. To get it right the ThumbnailItem needs to
specify the parent it wants to be clipped to with the clipTo property.
E.g.:
clipTo: listView

The scene uses this clipTo parent item to correctly calculate the clip
region. Also the ThumbnailItem needs to have clipping enabled.

Note: this commit currently breaks TabBox as the qml and view are not
yet adjusted. In scripting the export of the item is disabled, but any
qml script using a ThumbnailItem would obviously also fail.
2013-08-09 11:47:17 +02:00
Martin Gräßlin 9291b18cee Merge branch 'master' into frameworks-scratch
Conflicts:
	CMakeLists.txt
	kwin/effects.cpp
	kwin/effects/logout/logout.cpp
	kwin/effects/presentwindows/main.qml
	kwin/effects/presentwindows/presentwindows.cpp
	kwin/effects/presentwindows/presentwindows.h
	kwin/effects/zoom/zoom_config.cpp
	kwin/libkwineffects/kwinglutils_funcs.cpp
	kwin/libkwineffects/kwinxrenderutils.cpp
	kwin/nvidiahack.cpp
	kwin/xcbutils.h
	plasma/desktop/containments/desktop/plasma-containment-desktop.desktop
	plasma/generic/wallpapers/image/image.cpp
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
2013-08-07 10:10:06 +02:00
Thomas Lübking 3c593f4357 remove nvidiahack lib
1. it apparently is ineffective
2. if it was effective, it's current behavior would be not exactly helpful
   (sets __GL_YIELD to NOTHING, causing busy waits on doublebuffer swapping)
3. it does for sure pollute the doublebuffer/usleep detection (setenv is set to override),
   ie. the overehad detection code gets a different opinion on __GL_YIELD than libGL

REVIEW: 111858
CCBUG: 322060
2013-08-05 20:43:27 +02:00
Martin Gräßlin c16c0c3753 Port invert screen from XLib xrandr to xcb randr
With this we can drop the linking to xrandr in KWin core.
2013-08-01 10:26:39 +02:00
Martin Gräßlin dcc273fe0f KWin core doesn't need to link some XLib libs any more
* XExt
* ICE
* SM
* XRender
* XDamage
* XFixes
2013-07-31 07:28:15 +02:00
Martin Gräßlin 4141c101f1 Enable building of the Oxygen window decoration
Demo and config stays disabled - we are only interested in the window
decoration for now.

Seems to work :-)

CCMAIL: hugo@oxygen-icons.org
2013-07-30 07:57:15 +02:00
Martin Gräßlin 48b1c388bc Re-enable compilation of KWin decorations
Only Aurorae gets compiled for now. Oxygen is disabled by config option
and legecay decos are commented in CMakeLists.txt.
2013-07-25 18:05:58 +02:00
Martin Gräßlin 2fcc26d29b Enable compilation of a KWin subset again
To ease porting a few features are disabled, this includes:
* kcms
* decorations
* activities

Note: KWin doesn't work yet, the event filter is not yet ported!
2013-07-24 09:58:45 +02:00
Martin Gräßlin 9ab751042a Drop X11_XCB library dependency
We don't need it anymore - the xcb connection is also provided by
QX11Info.
2013-07-24 09:58:43 +02:00
Martin Gräßlin b800d58a3d Disable compilation of data subdirectory for porting
It's probably not worth to port those update scripts.
2013-07-24 09:58:42 +02:00
Martin Gräßlin f04b39c548 Adjust target link libraries 2013-07-24 09:58:42 +02:00
Fredrik Höglund a87e8f5e8e kwin: Drop the xcb_icccm dependency
This dependency is causing build problems on a number of systems,
and it doesn't make much sense to bring in a whole library for three
one-line convenience functions.
2013-07-02 00:21:32 +02:00
Martin Gräßlin b7423a45cd Only build Wayland backend if both Wayland and EGL are found 2013-06-07 11:57:08 +02:00
Martin Gräßlin b6990078ec Add support for Wayland seat: keyboard and pointer
Rudimentary support for input events. Events from Wayland are forwarded
to X's root window using the XTest extension.

Currently supported:
* left/middle/right mouse button
* keyboard events

Not supported:
* additional mouse buttons
* mouse wheel
* touch events

Obviously this is a rather huge hack and is only intended till we have
XWayland support and proper input redirection inside KWin.
2013-06-05 13:46:00 +02:00
Martin Gräßlin bab5f16d3c Egl Backend using a Wayland surface for rendering
This backend is able to composite on a Wayland surface instead of an X11
overlay window. It can be considered as a prototype for a Wayland session
compositor.

For texture from X11 pixmap the backend uses XShm. This is far from
optimal, but the KHR_image_pixmap extension is not available in Mesa's
Wayland backend. It's a temporary solution till we have XWayland and
texture from Wayland buffer.

To use this backend one needs to specify the environment variable
KWIN_OPENGL_INTERFACE with "egl_wayland". In future KWin should probably
use this backend if the Wayland display env variable is defined.

To use this setup:
1. Have a normal X-Server running on e.g. VT7
2. Start Weston on VT1
3. Start a terminal on Weston
4. start KWin with:

DISPLAY=:0 KWIN_OPENGL_INTERFACE=egl_wayland kwin --replace &

This should map a Wayland surface to Weston showing the content of the X
setup. At the moment it's not yet possible to interact with the surface
as input events are not yet recieved in the backend.

There are still a lot of limitations as documented in the code.
2013-06-05 13:45:45 +02:00
Martin Gräßlin 9d1fb072d4 Find xcb_icccm and link it in KWin core
We need it for porting some aspects of Client to XCB.
2013-05-28 11:55:38 +02:00