Commit Graph

12871 Commits (cd293220bb9b2f794dae39b415613b2cb97ea896)

Author SHA1 Message Date
Martin Gräßlin cd293220bb EGLImage -> EGLImageKHR
CI system didn't like EGLImage, but always liked EGLImageKHR. So let's
try whether using EGLImageKHR fixes build.
2015-03-17 10:46:50 +01:00
Martin Gräßlin f73da18f2e [wayland] Enforce the wayland QPA
This requires a change present in Qt 5.4.2, without the startup will
freeze. A warning message is shown if the compiled Qt version is not
at least 5.4.2. It's only a warning and an ifdef as distros might
backport the required change.
2015-03-17 10:31:18 +01:00
Martin Gräßlin 371bd4c24f [wayland] Use Surface::setCursor and ::hideCursor in WaylandBackend
Replaces the low level wayland calls and also means that we no longer
need the Wayland client library. Everything wrapped in KWayland.
2015-03-17 10:20:20 +01:00
Martin Gräßlin f600e2f6f4 [wayland] Properly handle Cursor set on focused PointerInterface
This replaces getting the Cursor through the X11CursorTracker which
is now completely dropped. The Cursor data is now passed through from
the Wayland server and forwared to the WaylandBackend.
2015-03-17 10:20:20 +01:00
Martin Gräßlin 9ca992a329 [wayland] Drop methods on Toplevel to send input events
No longer needed as InputRedirection sends input events directly
through the SeatInterface. In addition this drops the dependency on
xtest.
2015-03-17 10:20:20 +01:00
Martin Gräßlin 7bb107ba6d [wayland] Pass keyboard key press/released events to SeatInterface
Improves handling by no longer sending events with xtest.
2015-03-17 10:20:19 +01:00
Martin Gräßlin c29f96665d [wayland] Pass pointer input events to SeatInterface
Pointer events are no longer sent through the methods on Toplevel,
but properly sent through the SeatInterface. This has the advantage
that SeatInterface properly tracks which is the focused pointer surface
and does not need to use the xtest extension.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 79c49e84a4 [kwin_wayland] Pass socket file descriptor to QtWayland
WaylandServer allows to create a ClientConnection which is intended for
QtWayland. This allows us to easily identify our "own" surfaces. The
created file descriptor is set as env variable WAYLAND_SOCKET prior to
creating the Application. Wayland will unset it after connecting, so we
don't need to unset it. This removes the hack of setting and resetting
the WAYLAND_DISPLAY environment variable.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 69a13a779d [kwin_wayland] Start Xwayland through socket file descriptor
Creates a socketpair in WaylandServer and creates a ClientConnection for
Xwayland. The created file descriptor is passed to Xwayland through the
WAYLAND_SOCKET env variable.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 9dcd123438 [kwin_waylnad] Fix support for QtWayland's client buffer integration
QtWayland performs an eglInitialize in the main thread when for the first
time an OpenGL context/window is needed. In KWin's startup this happens
during initializing Scripting which creates a QDesktopWidget and triggers
the creation of a QWindow with a RasterGLSurface.

Calling eglInitialize in the main thread blocks as it calls wl_roundtrip.
We cannot just disable OpenGL as that would mean that we cannot use
QtQuick.

The workaround in this change is to create a QWindow with a
RasterGLSurface in a thread and call create on it. This ensures that
OpenGL gets initialized in the thread and doesn't block.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 54c2c5db2d [wayland] Create SeatInterface and sync with WaylandBackend's seat
If not using libinput we get the seat information from the lower
level Wayland server: let's forward the information to our own
SeatInterface.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 5b7b0f91c1 [wayland] Fix wayland cursor theme size
If our size is 0, we need to pass -1 to get the proper default size.
2015-03-17 10:20:19 +01:00
Martin Gräßlin fafa22d0c6 [wayland] Invoke frame rendered callback on damaged windows
Introduces a new time counter on Compositor to indicate the elapsed
time sine the compositor started.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 659c416879 [wayland] Handle damage events from SurfaceInterface
On Wayland we get the damage from the SurfaceInterface instead of
using a damage handle. This change ensures that the damage handle
interaction is only used on platform X11, while on Wayland we get
the damage from the SurfaceInterface directly.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 70a9c580fc [wayland] Add support for binding buffer as texture
Adds proper support for binding Wayland buffers to EGLImage.
The loading is split into a shm part and a Wayland buffer part,
so that both is supported.

Wayland buffer support is limited to format EGL_TEXTURE_RGB and
EGL_TEXTURE_RGBA. Other formats and multiple texture are not supported.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 50ef02fa1b [wayland] Start Compositor and Scene before Workspace
For Xwayland we need to have the Scene (and EglDisplay) created prior
to starting Xwayland and having X11. This requires creating the
Compositor before creating Workspace and starting Xwayland.

To support this the startup of Compositor is split into two parts:
prior and after Workspace creation.

The change might also be interesting for the kwin_x11 case as it could
result in the compositor being up in a quicker way.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 659ff1c732 [wayland] Don't check whether GLX is available
We won't use it, so let's not check for it.
2015-03-17 10:20:19 +01:00
Martin Gräßlin f39c3c8cbb Emit signal from Application once Workspace is created
Allows interesting parties to delay initialization till Workspace is
ready.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 58d79e2da4 Compositor: connect to configChanged emitted by Options instead of Workspace
Removes dependency to Workspace in ctor.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 147af71f8a Drop Workspace dependency from Scene
Only used for one connect which can also be done outside of Scene.
Subclasses got the singleton pointer and just passed to the parent.
2015-03-17 10:20:19 +01:00
Martin Gräßlin f1f87c7a7d Guard access to Display in GLPlatform::getXServerVersion
On wayland OpenGL might get initialized before we have a connection
to the XServer and we might only have an xcb connection. So let's
guard the access.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 820af0ce4a Guard X11 usage in InputRedirectionCursor
In kwin_wayland the InputRedirectionCursor is created before the X11
connection is established. Because of that possible usage needs to
be guarded. This is only in cursorTracking so far. The parent class
exposes whether the cursor is tracked and the doStartCursorTracking
gets invoked again when the x11Connection becomes available.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 40c52035a8 [wayland] Better track if WaylandBackend is ready
The WaylandBackend emits a signal when the backend is ready. If a user
connects to it after it became ready, it will never get notified.
Therefore the WaylandBackend tracks also whether it is ready and
implements connectNotify to emit the signal again if a user connects and
the backend is already ready.

Users of the signal need to disconnect if they cannot handle it being
invoked multiple times. So far the only user does handle this properly.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 7e0fcc5f1a [kwin_wayland] Create screens prior to Xwayland
Gives us the correct outputs in Xwayland direct from start.
2015-03-17 10:20:19 +01:00
Martin Gräßlin dc0f040185 [kwin_wayland] Init Outputs from screen information
Removes the hack for startup. Still needs proper physical size.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 0f945f53fe Move creation of InputRedirection, Cursor and Screens out of Workspace
Do not depend on Workspace and do not depend on X11 thus can be started
earlier allowing to get more things started prior to depending on
Workspace.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 00739867b4 [kwin_wayland] Move starting Xwayland into performStartup 2015-03-17 10:20:19 +01:00
Martin Gräßlin 7c3197b1eb Use new ctors for KXMessages and KSelectionOwner
Allows to pass the connection and rootWindow and doesn't depend on
QX11Info.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 7369a2c3a5 [kwin_wayland] Support using platform wayland for the QPA
This reorders the startup sequence quite a bit:
1. Create QAbstractEventDispatcher and install it on QCoreApplication
2. Create Application
3. Start Xwayland, use thread to get when its ready
4. Create xcb connection
5. perform startup

For using the wayland QPA it needs a patch in QtWayland which will be
part of Qt 5.4.2, otherwise it blocks.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 2c169e4bca [egl/wayland] Bind Wayland Display to EGL display 2015-03-17 10:11:13 +01:00
Martin Gräßlin a0b2a938aa [wayland] Support creating Texture from Wayland shm buffer
EglWaylandBackend gains support for creating textures from a
BufferInterface. At the same time it loses the possibility to use
the Xcb shm extension to load the texture. That is Xwayland is
required.

In order to support it in a better way the WindowPixmap is passed
to the Texture for loading and updating. Which is then passed to the
backend specific implementation.
2015-03-17 10:08:27 +01:00
Martin Gräßlin 19d90e4e0e [scene] Add basic support for Wayland Buffer in WindowPixmap
The concept of Buffers do not match WindowPixmap perfectly. With X11
we had a pixmap as long as the size was the sime, then it got discarded.
With Wayland we get a new Buffer whenever the window gets damaged.
Furthermore the Buffer might get destroyed any time (especially if the
client disconnects) or the data becomes invalid (it's a shm section after
all).

This adds some constraints on how the Buffer can be used. It's suggested
that the implementing sub-classes do a deep copy of the Buffer's data
when accessing it. For OpenGL that's rather obvious, for QPainter it
needs a dedicated QImage::copy.

WindowPixmap holds a pointer to the currently used Buffer, but doesn't
guarantee that it stays valid. Every time the window gets damaged, the
pointer needs to be updated.

The QPainter based scene is the first to implement support for Buffers:
on creation a deep copy is performed, on damage the changed parts are
painted into the deep copy.
2015-03-17 10:08:27 +01:00
Martin Gräßlin 07c972b6d4 [wayland] Add a SurfaceInterface to Toplevel
Adds the SurfaceInterface identified by the surface id we get from
Xwayland. This allows in an easier way to map a Toplevel to a
Wayland surface and will also be useful for Wayland clients.
2015-03-17 10:08:27 +01:00
Martin Gräßlin e463905f04 Add Workspace::findToplevel
Like findClient and findUnmanaged, just a little bit more generic.
Toplevel::findInList got adjusted to support it.
2015-03-17 10:08:27 +01:00
Martin Gräßlin 7843bbdbfb [xwayland] Drop options to start Xephyr or Xvfb
Only --xwayland stays supported. The option --displayfd and --rootless
are always set. Simplifies the feature matrix and the other X servers
don't make any sense now that we can start a proper rootless Xwayland.
2015-03-17 10:08:27 +01:00
Martin Gräßlin 47bdce074e Let the fun begin: start a WaylandServer in kwin_wayland
The WaylandServer is at the moment only used to support starting an
Xwayland. It does not support Wayland clients yet, so don't get
excited.

For Xwayland it's using the trick of creating the Display before the
QApplication is created with manual event dispatching.
2015-03-17 10:08:27 +01:00
Martin Gräßlin f651007ebe [xwayland] Don't update xrandr in WaylandScreens
Xwayland is able to update randr information based on the Wayland
Outputs, so it's not needed to do so from KWin.
2015-03-17 10:08:27 +01:00
Martin Gräßlin 76b4d8f2d5 [xwayland] Claim selection WM_S0
Xwayland expects the window manager to claim WM_S0, no matter which
display number is really used.
2015-03-17 10:03:05 +01:00
Martin Gräßlin 2cd25257d9 [wayland] Add safety check for WaylandCursorTheme::get
It's possible that loadTheme fails in which case m_theme is null
and would crash the wayland cursor library.
2015-03-17 10:03:05 +01:00
Martin Gräßlin 65007cd104 [xwayland] Add a dedicated --xwayland option to kwin_wayland
The --xwayland option starts a rootles Xwayland server. If a
rootless Xwayland server is used OperationModeXwayland is used
which is introduced with this change as well.
2015-03-17 10:03:05 +01:00
Martin Gräßlin e7019d9545 [xwayland] Add support for WL_SURFACE_ID
When XWayland associates a Wayland surface with an X window it
sends a WL_SURFACE_ID client message to the window manager.

KWin listens for this client message in Toplevel and provides it
as a member in Toplevel.

This requires KWin to actually start a Wayland server (and XWayland)
to make proper use of the information.
2015-03-17 10:03:04 +01:00
Martin Gräßlin 8c15da99ae Use property for x11AppScreen in KWin::Application
Already provided by KWin::Application so let's use it instead of
QX11Info::appScreen.

REVIEW: 122683
2015-03-17 09:44:53 +01:00
Martin Gräßlin 0d51952d78 Provide x11Connection as a property on the KWin::Application
KWin::connection() uses the property to resolve the value instead of
using QX11Info. In practice this doesn't change anything at the moment,
but allows kwin_wayland to provide an xcb connection without depending
on QX11Info.

As we cannot make xcb_connection_t* available as a metatype, the
property's type is set to void*.
2015-03-17 09:44:53 +01:00
Martin Gräßlin fe9873e4b1 Provide x11RootWindow as a property on the KWin::Application
KWin::rootWindow() uses the property to resolve the value instead of
using QX11Info. In practice this doesn't change anything at the moment,
but allows kwin_wayland to provide a root window without depending on
QX11Info.
2015-03-17 09:44:53 +01:00
Martin Gräßlin d66a804bbb Drop not needed includes of QX11Info 2015-03-17 09:44:53 +01:00
Martin Gräßlin c383d6074c Replace QX11Info::appScreen() with KWin::Application::x11ScreenNumber()
No need to go through QX11Info for information we have.
2015-03-17 09:44:53 +01:00
Martin Gräßlin c61ecc887a Replace QX11Info::appRootWindow() by KWin::rootWindow()
No need to go through QX11Info for information we already cache.
2015-03-17 09:44:53 +01:00
l10n daemon script 01b61a9ede 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-03-16 10:12:25 +00:00
l10n daemon script 9361fb8610 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-03-15 09:56:33 +00:00
l10n daemon script 17f808db9a 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-03-14 10:20:33 +00:00