1. 28 Oct, 2016 2 commits
  2. 26 Aug, 2016 1 commit
    • Martin Flöser's avatar
      [plugins/qpa] Call makeCurrent on the QOpenGLContext instead of the one in the platform context · 8909f878
      Martin Flöser authored
      SharingPlatformContext::swapBuffers needs to make the context current.
      For this is calls makeCurrent. Later on this tries to bind a fbo, which
      checks calls into the current QOpenGLContext. As we called makeCurrent on
      our own platform context Qt doesn't know that the context is current and
      returns in the worst case a nullptr and crashes.
      This change calls makeCurrent on the QOpenGLContext so that Qt also knows
      that this context is current now. The QOpenGLContext calls makeCurrent on
      the platform context, so what our code tried to do is still being done.
      In addition the method context() in AbstractPlatformContext is renamed to
      eglContext to no longer shadow the method in QPlatformContext.
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2582
  3. 08 Aug, 2016 1 commit
  4. 20 Jul, 2016 1 commit
    • Martin Flöser's avatar
      [plugins/qpa] Support SharingPlatformContext on the existing eglSurface and eglconfig · 44843f46
      Martin Flöser authored
      So far SharingPlatformContext was only used if the OpenGL context
      supports EGL_KHR_surfaceless_context. If not supported, KWin tried to
      create a context through the Wayland API. Unfortunately on hwcomposer
      platform this results in a crash as libhybris only supports the init
      of EGLDisplay for one native platform.
      This change tries to also use the SharingPlatformContext if there is
      an OpenGL context in general. It reuses the native EGLSurface created
      for the compositing scene and makes its own OpenGL context current on
      that surface, too. As KWin creates an FBO, it never renders to it, so
      it shouldn't matter at all.
      In order to prevent EGL_BAD_MATCH errors when making Qt's OpenGL context
      current also the EGLConfig from the scene is used to create the context.
      Test Plan: Tested on Nexus5 with qtvirtualkeyboard in KWin
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2231
  5. 19 Jul, 2016 1 commit
  6. 18 Jul, 2016 2 commits
  7. 02 Jun, 2016 2 commits
    • Martin Flöser's avatar
      [plugins/qpa] Handle case that qtvirtualkeyboard plugin is not available more gracefully · 5344bf16
      Martin Flöser authored
      We didn't check whether creating the QPlatfromInputContext worked and
      accessed the m_inputContext unconditionally which obviously crashed.
      Now the connects related to QInputMethods are not setup if we failed
      to create the QPlatfromInputContext.
      Reviewed-By: bshah
    • Martin Flöser's avatar
      Integrate QtVirtualKeyboard into KWin/Wayland · f26f2fe1
      Martin Flöser authored
      The idea is to have KWin provide a virtual keyboard. To support this
      KWin uses the QT_IM_MODULE qtvirtualkeyboard and makes sure that the
      QPA plugin loads it.
      KWin has a new class VirtualKeyboard which acts as the focus object and
      the "proxy" for input methods. The QPA plugin ensures that this is the
      focusObject, so that all input method related events are sent to this
      class. From there it will be possible to delegate to other applications
      through the Wayland interfaces.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Tags: #plasma
      Differential Revision: https://phabricator.kde.org/D1638
  8. 17 May, 2016 1 commit
  9. 07 Apr, 2016 2 commits
  10. 16 Mar, 2016 1 commit
  11. 11 Mar, 2016 1 commit
  12. 10 Mar, 2016 1 commit
    • Martin Flöser's avatar
      [plugins/qpa] Add a dummy screen on startup · 51ee5142
      Martin Flöser authored
      Qt has problems initializing everything correctly if there is no screen
      at startup. E.g. the breeze widget style tries to initialize some pixmaps
      and this fails. In worst case hitting asserts in Qt (debug build).
      This change creates a dummy screen which gets destroyed as soon as there
      is a real screen.
      Reviewed-By: notmart and sebas
  13. 09 Mar, 2016 1 commit
  14. 17 Feb, 2016 1 commit
    • Martin Flöser's avatar
      [plugins/qpa] Implement a custom QPlatformCursor · 7d81e9cf
      Martin Flöser authored
      This makes QCursor::pos and QCursor::setPos function correctly. KWin
      actually wouldn't need it as KWin has the KWin::Cursor replacement, but
      it allows Qt internal API to have it function correctly and also the
      zoom effect does use QCursor::setPos.
  15. 09 Feb, 2016 1 commit
  16. 18 Dec, 2015 1 commit
  17. 01 Dec, 2015 1 commit
    • Martin Flöser's avatar
      Make Wayland::EGL optional again · d89777bc
      Martin Flöser authored
      This is needed to make KWin build-able on non-Linux, but is actually
      only a workaround. The dependency should also be available on non-Linux.
      This disables the EGL integration in the Wayland backend (QPainter still
      available) and the EGL fallback in the qpa plugin (preferred context
      sharing still available, but requires a working OpenGL Scene).
      REVIEW: 126202
  18. 16 Nov, 2015 1 commit
  19. 10 Nov, 2015 2 commits
    • Martin Flöser's avatar
      [wayland] Fix cleanup handling on tear down · 8175562a
      Martin Flöser authored
      ASAN righly complained: we need to delete our Wayland objects before
      we destroy the internal client connection. Solved by better setting
      parent relationships in the QPA plugin and correctly delete objects
      in destroy of internal client connection.
    • Martin Flöser's avatar
      [wayland] Improve tear-down to not crash if X11 applications are still around · 1998d5ac
      Martin Flöser authored
      We need to destroy the compositor after Xwayland terminated and after
      the internal Wayland connection is destroyed. This means when destroying
      the Workspace we may no longer destroy the Compositor at the same time.
      Also we need to ensure that other tear down functionality doesn't call
      into the no longer existing internal client connection.
      With this change kwin doesn't crash when exiting with Wayland and/or
      X11 windows still open.
  20. 03 Nov, 2015 2 commits
  21. 02 Oct, 2015 1 commit
    • Martin Flöser's avatar
      [autotest] Welcome to integration testing KWin · 7fed20f1
      Martin Flöser authored
      This is the beginning of a new testing era for KWin: finally we are
      able to test against a running KWin. This works by making use of the
      new virtual framebuffer backend for Wayland. It starts a specific
      Application subclass which is mostly a fork of ApplicationWayland.
      The individual tests are able to influence the socket name and the
      size of the virtual screen. This is supposed to be done in
      initTestCase. To know when KWin is fully started one can use the
      workspaceCreated signal of KWin::Application. KWin is not started in
      another process, but the kwin library is used, so the test has pretty
      much full introspection to everything going on inside KWin. It can
      access the Workspace, WaylandServer, fake input events through
      InputRedirection and so on.
      Once the test KWin is running it's possible to connect to it using
      KWayland::Client library. This allows to introspect the Workspace
      to see whether all worked as expected (e.g. correct stacking order,
      active window and so on).
      This first autotest is mostly meant to illustrate how to setup a
      test and how one can use KWayland::Client to interact with the mock
      KWin. For more tests it is suggested to move the connections to the
      Wayland server in the init() and cleanup() methods.
      The change also affects the qpa plugin: the specific check to only
      run in binaries called kwin_wayland doesn't hold any more. This can
      now be overwritten by an env variable.
      Please note that this first test will probably fail in the CI system
      as it might not have XWayland which is needed by KWin.
  22. 25 Aug, 2015 4 commits
    • Martin Flöser's avatar
      [qpa] Use QPlatformIntegrationFactoryInterface_iid for Q_PLUGIN_METADATA · f0f8421c
      Martin Flöser authored
      Makes it work with both Qt 5.4 and Qt 5.5.
    • Martin Flöser's avatar
      [wayland] Create event dispatcher in QPA plugin · abb9bf13
      Martin Flöser authored
      We no longer need to have the event dispatcher created before starting
      the QApplication, thus we can leave it to the QPA plugin to creat it.
      Also we don't need to implement our own dispatcher any more but can
      use one from Qt5PlatformSupport as we link it anyways. The special
      need for dispatching the WaylandServer is no longer needed as we can
      explicitly dispatch it from the QPA plugin if needed.
    • Martin Flöser's avatar
      [qpa] Dispatch Wayland server before trying to find a ShellClient · a10be8a7
      Martin Flöser authored
      Ensures that all pending events are processed and we actually have
      created the ShellSlient.
    • Martin Flöser's avatar
      [wayland] Add a QPA plugin for kwin_wayland · 26b3569a
      Martin Flöser authored
      This introduces an own QPA plugin for KWin. QtWayland's plugin is not
      a good solution for KWin as QtWayland is meant for Wayland clients and
      not for a Wayland server. Given that it makes more sense to have a very
      minimal QPA plugin which supports the use cases we actually have.
      With our own QPA plugin we should be able to improve the following
      * no need to create Wayland server before QApplication
      * Qt::BypassWindowManagerHint can be supported
      * no workaround for creating OpenGL context in main thread
      * sharing OpenGL context with Qt
      * OpenGL context for Qt on libhybris backend
      The plugin supports so far the following features:
      * creating a QPlatformWindow using KWayland::Client (ShellSurface)
      * creating a QPlatformBackingStore using a ShmPool
      * creating a QPlatformOpenGLContext with Wayland::EGL
      * or creating a QPlatformOpenGLContext which shares with KWin's scene
      * creating a QPlatformScreen for each KWayland::Client::Output
      * QPlatformNativeInterface compatible to QtWayland