1. 24 Nov, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Introduce colord integration · f037a69f
      Vlad Zahorodnii authored
      This change introduces basic colord integration in wayland session. It
      is implemented as a binary plugin.
      
      If an output is connected, the plugin will create the corresponding
      colord device using the D-Bus API and start monitoring the device for
      changes.
      
      When a colord devices changes, the plugin will read the VCGT tag of the
      current ICC color profile and apply it.
      f037a69f
    • Vlad Zahorodnii's avatar
      Introduce infrastructure for compositor extensions · c766e5da
      Vlad Zahorodnii authored
      The scripting api is not suitable for implementing all features that
      should not be implemented in libkwin. For example, the krunner
      integration or screencasting are the things that don't belong to be
      compiled right into kwin and yet we don't have any other choice.
      
      This change introduces a quick and dirty plugin infrastructure that
      can be used to implement things such as colord integration, krunner
      integration, etc.
      c766e5da
  2. 24 Jul, 2020 1 commit
  3. 23 Jul, 2020 1 commit
  4. 01 Jun, 2020 1 commit
  5. 17 Mar, 2020 1 commit
  6. 26 Feb, 2020 1 commit
    • Daniel Vrátil's avatar
      Decode full monitor vendor name from EDID using hwdata · 33a1777a
      Daniel Vrátil authored
      Test Plan:
      KScreen now shows "Dell Inc." instead of DEL and
      "Eizo Nano Corporation" instead of ENC in output names, which
      matches closer to what's written on my monitors.
      
      Reviewers: graesslin, davidedmundson, #plasma
      
      Reviewed By: davidedmundson, #plasma
      
      Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D10041
      33a1777a
  7. 15 Apr, 2019 1 commit
    • Erik Kurzinger's avatar
      [platforms/drm] EGLStream DRM Backend Initial Implementation · c898f96d
      Erik Kurzinger authored
      Summary:
      This is the initial implementation of a DRM backend based on the EGLDevice,
      EGLOutput, and EGLStream extensions, supporting NVIDIA graphics hardware using
      their proprietary driver. The new backend will be used if the environment
      variable KWIN_DRM_USE_EGL_STREAMS is set. On initialization, it will attempt to
      create an EGLDevice based on the DRM device currently in use and create
      EGLOutputs and EGLStreams for any attached displays. These are used to control
      presentation of the final composited frame. Additionally, it will register the
      wl_eglstream_controller Wayland interface so that native EGL windows created by
      clients can be attached to an EGLStream allowing buffer contents to be shared
      with the compositor as a GL texture.
      
      At this time there are two known bugs in the NVIDIA driver's EGL implementation
      affecting desktop functionality. The first can result in tooltip windows drawn
      by plasmashell to contain incorrect contents. The second...
      c898f96d
  8. 04 Feb, 2018 1 commit
    • Martin Flöser's avatar
      Require libinput and udev · bbf00fdd
      Martin Flöser authored
      Summary:
      The main reason for not having it as a mandatory dependency was that BSD
      doesn't support it. But as I learned recently it is available on our CI
      system. So BSDs have support now.
      
      Even more it showed that the code doesn't compile if the dependency is
      missing. And there's one thing I hate: broken build configuration
      options.
      
      So let's make UDEV and libinput a required dependency and get rid of the
      problems.
      
      Test Plan: Compiles
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D10057
      bbf00fdd
  9. 21 Jan, 2018 1 commit
  10. 04 Jan, 2018 1 commit
    • Martin Flöser's avatar
      [libinput] Add support for switch devices and events · ac2f41c8
      Martin Flöser authored
      Summary:
      This change adds support for the switch devices introduces with libinput
      1.7 (lid) and 1.9 (tablet mode). So far it's not yet used internally in
      KWin, but only exposed through the Device and Events.
      
      As KWin currently only requires libinput 1.5 and we are rather late in
      the release cycle the new functionality is ifdef'ed. The requirement
      will be raised once master is 5.13. It is already available on
      build.kde.org, but e.g. Neon only has 1.6.
      
      The switch events are interesting as they report whether the lid is
      closed (might be interesting for e.g. powerdevil) and whether a
      convertible is in tablet mode (supported for e.g. Lenovo Yogas with
      recent kernel). This can be used by KWin internally to enable/disable
      the virtual keyboard. And can be exposed globally to switch to Plasma
      Mobile shell in future.
      
      Test Plan:
      Only through test case as my Lenovo Yoga uses Neon which has a
      too old libinput
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, ...
      ac2f41c8
  11. 29 Sep, 2017 1 commit
    • Martin Flöser's avatar
      Use real-time scheduling policy for kwin_wayland · 7c8003f7
      Martin Flöser authored
      Summary:
      The base idea behind this change is to keep the system responsive no
      matter what other processes do. All input and rendering needs to go
      through the windowing system, so keeping it responsive is important.
      
      Currently KWin competes with all other processes for resources and this
      can render the system unusable. Consider some processes running amok. In
      this case the user might not be able to easily close the applications as
      KWin does not get the cpu time to perform the input tasks requested by
      the user.
      
      Or in the case of playing a demanding game it is important that KWin
      gets scheduled to forward the pointer input events. The user doesn't
      want that the game (or another process) wins against the windowing
      sytem.
      
      The disadvantage is that KWin always wins against other processes with
      real time scheduling. This could result in KWin running amok stalling
      the system. On the other hand this is no change to the current situation
      as if KWin runs amok the sytem is unusable.
      
      The change uses libcap to set CAP_SYS_NICE on kwin_wayland executable.
      KWin_wayland on start sets the scheduling policy to SCHED_RR with the
      lowest possible priority. Thus any other SCHED_RR process will win
      against KWin. So real time processes are not affected by this change!
      
      After adjusting the scheduling (which requires CAP_SYS_NICE) KWin drops
      this capability again.
      
      Test Plan:
      Verified that KWin adjusts the scheduler, that it is not passed
      to child processes, that the capability gets dropped and not passed to
      child processes.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7757
      7c8003f7
  12. 30 Jul, 2017 1 commit
  13. 05 May, 2017 1 commit
    • Martin Flöser's avatar
      [helper] Terminate xclipboardsyncer if kwin_wayland goes down · 572f730e
      Martin Flöser authored
      Summary:
      Normally the xclipboardsyncer should terminate because the socket
      becomes unusable. But we have reports of it not really going down and
      running amok.
      
      In order to prevent such situations this change registers SIGTERM to be
      sent to xclipboardsyncer when the parent process (that is kwin_wayland)
      dies in whatever way. This ensures that xclipboardsyncer cannot become
      an orphan.
      
      BUG: 371862
      
      Test Plan: Only compile tested, no way to get into the problematic situation
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D5589
      572f730e
  14. 08 Aug, 2016 1 commit
  15. 03 Aug, 2016 1 commit
  16. 21 Jul, 2016 1 commit
    • Martin Flöser's avatar
      [platforms/virtual] Use rendernode or vgem device if available for egl · 56ce6689
      Martin Flöser authored
      Summary:
      The egl implementation for the virtual platform tries to use a render
      node if available. If there is no render node it looks for a virtual
      (kernel driver vgem) device, which unfortunately does not create a
      render node in mainline kernel (there are patches in ChromiumOS).
      
      For this the Udev wrapper is extended to search for renderNode devices
      and for virtual dri devices.
      
      If either render node or vgem dri device is found, it is tried to be
      opened (without logind escalation) and on success a gbm device is
      created on it. If any step of this fails the so far default behavior
      of default device is tried for creating the EGLDisplay.
      
      All of this is compile optional, so that the virtual platform does not
      hard depend on udev and/or gbm.
      
      Test Plan:
      Auto tests which need OpenGL executed and verified that they
      use the render node or vgem device.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2216
      56ce6689
  17. 29 Jun, 2016 1 commit
    • Martin Flöser's avatar
      Support for syncing the clipboard from X11 to Wayland and vice versa · 3493e976
      Martin Flöser authored
      Summary:
      The clipboard sync is done by a dedicated helper binary launched by
      KWin. This helper binary is forced to xcb platform to piggy-back on
      Qt's implementation of the X11 clipboard. In addition it implements
      the Wayland clipboard - which is much simpler. Reading the Wayland
      clipboard is based on the implementation in QtWayland.
      
      KWin internally knows the DataDeviceInterface belonging to the helper
      application. Whenever an xwayland client is focussed, this DataDevice
      is allowed to set the selection and KWin manually updates the current
      selection in the SeatInterface. By that the sync from X11 to Wayland
      is implemented. When afterwards a Wayland client is selected, it's sent
      the current selection which references the X clipboard and a data
      transfer can be initiated in the normal Wayland way.
      
      For the other direction KWin sends the current selection to the helper's
      DataDevice whenever an xwayland window is focused. The helper application
      reads the Wayland clipboard and sets it on the X11 clipboard. Thus the
      Wayland clipboard is synced to X11.
      
      The approach used here will also be useful for implementing a clipboard
      manager (aka klipper).
      
      Currently the implementation is not yet fully completed. We need to
      make sure that the helper application gets restarted in case of a crash.
      
      Test Plan: See added test case
      
      Reviewers: #plasma_on_wayland, #kwin
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D1973
      3493e976
  18. 10 May, 2016 1 commit
    • Tobias C. Berner's avatar
      Disallow ptrace on greeter and kwin_wayland process on FreeBSD [... for the future] · 2ea5feb3
      Tobias C. Berner authored
      Summary:
      Similar to[[ https://phabricator.kde.org/D1216 |  D1216 ]] add procctl call to disable ptrace on FreeBSD.
      
      We cannot do the procfs-lookup to check whether the process is already being run inside gdb -- however, on FreeBSD, we could use the P_TRACED flag of the process to figure this out:
      > sys/proc.h:#define P_TRACED        0x00800 /* Debugged process being traced. */
      
      And the code would look something similar to
      
      ```
          pid_t pid = getpid();
          struct procstat *prstat = procstat_open_sysctl();
          struct kinfo_proc *procinfo;
          unsigned int cnt;
          procinfo = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt);
          long p_flags = procinfo->ki_flag;
          int p_traced = p_flags & P_TRACED;
          if (p_traced != P_TRACED) {
              mode = PROC_TRACE_CTL_DISABLE;
              procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode);
          }
          procstat_freeprocs(prstat,procinfo);
          procstat_close(prstat);
      ```
      
      But as wayland is [far] in the future on FreeBSD, and that check above is a bit lengthy, I think it is enough if we add it once it is needed.
      
      Reviewers: rakuco, graesslin
      
      Reviewed By: graesslin
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1425
      2ea5feb3
  19. 12 Apr, 2016 1 commit
  20. 14 Jan, 2016 1 commit
    • Martin Flöser's avatar
      Use XInput for "polling" the mouse positing · 5a316184
      Martin Flöser authored
      Replaces the timer based polling approach. If XInput is available we
      listen for the RawMotion event on the root window and use this to
      trigger a mouse pointer position.
      
      BUG: 357692
      FIXED-IN: 5.6.0
      REVIEW: 126733
      5a316184
  21. 08 Dec, 2015 1 commit
    • Martin Flöser's avatar
      [wayland] Disallow ptrace on kwin_wayland process · e5a27cff
      Martin Flöser authored
      In order to increase the security we disable ptrace on kwin_wayland.
      This makes it impossible for a another process running as the same
      user to attach to kwin_wayland to install a key logger. It doesn't
      protect against higher privileged users, but that's no problem: they
      can just read the input device file and don't need to attach to KWin
      to become a key logger.
      
      This change is highly inspired by a similar change to kscreenlocker.
      A difference is that KWin checks whether we are running under a
      debugger. In such a case we still want to allow ptrace.
      e5a27cff
  22. 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
      d89777bc
  23. 01 Oct, 2015 1 commit
  24. 12 Aug, 2015 4 commits
  25. 07 Jul, 2015 1 commit
    • Martin Flöser's avatar
      Port away from KToolInvocation · f6458fa1
      Martin Flöser authored
      The problem with KToolInvocation is that it creates a dead lock on
      Wayland in case kdeinit is not already running. It starts kdeinit
      and does a QProcess::waitForFinished and our kdeinit needs to interact
      with the wayland server. So dead lock.
      
      As KRun also calls into the dangerous code path it's no option which
      leaves us with QProcess to start the processes.
      
      A nice side-effect is that we no don't need to link KF5::Service any
      more from kwin_core. Now once Plasma and Notification don't use it
      any more, it will be gone completely.
      f6458fa1
  26. 04 Jun, 2015 2 commits
    • Martin Flöser's avatar
      Require XCB 1.10 · 6c0c5138
      Martin Flöser authored
      We need XCB 1.10 for sync to work. Sync was optional with a version check
      to make it work on build.kde.org. The CI system supports XCB 1.10 now, so
      it's better to have it as a mandatory requirement.
      6c0c5138
    • Martin Flöser's avatar
      XCB::CURSOR becomes a required dependency · 8a9bbf7c
      Martin Flöser authored
      It was only optional because build.kde.org did not provide it when the
      dependency got introduced.
      8a9bbf7c
  27. 08 May, 2015 1 commit
    • Martin Flöser's avatar
      Add a hwcomposer backend based on libhybris · e12400a6
      Martin Flöser authored
      This backend interacts with libhybris to create a hwcomposer which is
      used for creating the egl context and surface. The initial version of
      this backend is based on test_hwcomposer.cpp provided by libhybris.
      
      Please note that using the hwcomposer backend requires a newer libepoxy,
      the latest stable release is not able to bring up OpenGLES, so one needs
      a master build of libepoxy.
      
      Notes on licensing:
      libhybris is Apache 2.0 licensed, which is not compatile with GPLv2.
      But it is compatible with GPLv3. Thus the source files in the hwcomposer
      backend are licensed GPLv3+ and not GPLv2+ as the rest of KWin. If one
      uses KWin without the hwcomposer backend (which is obviously the default)
      the licence doesn't change. But if the hwcomposer backend is used the
      overall license of KWin changes to GPLv3+.
      e12400a6
  28. 24 Apr, 2015 2 commits
    • Martin Flöser's avatar
      Initial implementation of EglGbmBackend · 877c33fe
      Martin Flöser authored
      Uses EGL_MESA_platform_gbm to get an EglDisplay from a gbm_device.
      The DrmBackend can provide a DrmBuffer for a gbm_surface and present
      it.
      
      Unfortunately buffer age seems to be slightly broken and we still have
      artefacts.
      877c33fe
    • Martin Flöser's avatar
      [wayland] Add a basic drm/kms backend · c7595513
      Martin Flöser authored
      Introduces a new (optional) dependency: libdrm.
      
      The DrmBackend currently supports finding the first connected output.
      It can create shared memory buffers which are used by SceneQPainter to
      do double buffered rendering.
      
      There is still lots to do, the following things are not yet working:
      * multiple outputs
      * page flip
      * OpenGL (through gbm)
      * restoring mode setting to start value
      c7595513
  29. 23 Mar, 2015 3 commits
    • Martin Flöser's avatar
      Drop support for KAppmenu · b405fda2
      Martin Flöser authored
      We released three versions with it being disabled and it doesn't look
      like it will come back any time soon. Also the build was broken at least
      since the repo splitting due to incorrect path to dbus xml.
      
      In addition the connection to decorations got dropped already with the
      change to kdecoration2. Which means it anyway needs large adjustements
      to get the code working again.
      
      Overall it doesn't look like it makes lots of sense to keep the code
      around for someone working on it in future. If that happens this change
      can be reverted.
      b405fda2
    • Martin Flöser's avatar
      Drop KWIN_BUILD_DESKTOPCHANGEOSD from conig-kwin.h · 5088314e
      Martin Flöser authored
      Not referenced anywhere in build system.
      5088314e
    • Martin Flöser's avatar
      [wayland] Make Wayland::Cursor a proper optional build dep · 75d60d4f
      Martin Flöser authored
      Only needed in the Wayland backend and can easily be ifdefed there.
      75d60d4f
  30. 20 Mar, 2015 1 commit
  31. 06 Feb, 2015 2 commits
    • Martin Flöser's avatar
      Switch to xcb for sync extension · 551b3a4c
      Martin Flöser authored
      Since XCB 1.10 the sync extension is working properly. At the time of
      the 5.3 release 1.10 will have been out for ~15 months, enough time
      for distros to catch up and should allow us to use it.
      
      As our CI system only supports 1.9 at the moment we cannot hard depend
      on the version, instead we use feature info. As soon as our CI system
      supports it, we should update the required min version and kick out the
      ifdef.
      
      REVIEW: 122377
      551b3a4c
    • Martin Flöser's avatar
      Use xcb_cursor library instead of Xlib based one in Cursor · 0faf2fbc
      Martin Flöser authored
      Straight forward port from XLib based XCursor library to the
      xcb variant which is considerably new. The xcb variant only allows
      to create xcb_cursor_t for the default theme and size. Which suits
      the needs in Cursor quite well, but means it's not a replacement for
      the usage in zoom effect.
      
      REVIEW: 122290
      0faf2fbc