1. 02 Dec, 2020 1 commit
  2. 07 Aug, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Prettify license headers · 4ce853e8
      Vlad Zahorodnii authored
      4ce853e8
    • Vlad Zahorodnii's avatar
      Switch to SPDX license markers · 1fb9f6f1
      Vlad Zahorodnii authored
      The main advantage of SPDX license identifiers over the traditional
      license headers is that it's more difficult to overlook inappropriate
      licenses for kwin, for example GPL 3. We also don't have to copy a
      lot of boilerplate text.
      
      In order to create this change, I ran licensedigger -r -c from the
      toplevel source directory.
      1fb9f6f1
  3. 17 Jun, 2020 1 commit
    • Vlad Zahorodnii's avatar
      [x11] Provide physical dimensions for outputs · bc2df9f8
      Vlad Zahorodnii authored
      Since ScreenEdge no longer uses physicalDpiX() and physicalDpiY() from
      the QPaintDevice class in favor of our own helpers, we need to ensure
      that the X11 platform provides valid output physical dimensions.
      
      BUG: 422816
      FIXED-IN: 5.19.2
      bc2df9f8
  4. 29 Apr, 2020 2 commits
  5. 20 Aug, 2019 1 commit
  6. 17 Jun, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Backport Night Color feature to X11 · 0d381846
      Vlad Zahorodnii authored
      Summary:
      The color correction manager doesn't make any specific assumptions about
      underlying platform, e.g. whether it's x11, etc. The platform just
      has to be capable of setting gamma ramps. Given that, there are no any
      significant technical blockers for making this feature work on x.
      
      Reviewers: #kwin, davidedmundson, romangg
      
      Reviewed By: #kwin, davidedmundson, romangg
      
      Subscribers: romangg, neobrain, GB_2, filipf, davidedmundson, ngraham, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D21345
      0d381846
  7. 13 Jun, 2019 1 commit
    • Roman Gilg's avatar
      [platforms/x11/standalone] Port to AbstractOutput · 1a11abc8
      Roman Gilg authored
      Summary:
      Represent outputs in the X11 session via AbstractOutput. For that we
      move all Wayland specific parts of AbstractOutput into a new subclass
      AbstractWaylandOutput and let the outputs of our Wayland backends inherit
      from there.
      
      This should allow us to get rid of the Screens class later on.
      
      Test Plan: Manually in X session.
      
      Reviewers: #kwin, zzag, davidedmundson
      
      Reviewed By: #kwin, zzag, davidedmundson
      
      Subscribers: ngraham, zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19208
      1a11abc8
  8. 05 Jan, 2019 1 commit
  9. 05 Feb, 2018 1 commit
    • Martin Flöser's avatar
      [x11] Fix interactive point selection · ea5e7011
      Martin Flöser authored
      Summary:
      The support for interactive point selection was missing. This results in
      the ColorPicker dbus API always returning an error on X11. We either need
      to disable the ColorPicker on X11 or add support for this functionality.
      
      As the X11 platform basically supports selecting a point in the
      interactive window selection it makes more sense to add this missing
      method in the platform than to disable support of color picker effect.
      
      BUG: 387720
      FIXED-IN: 5.12.1
      
      Test Plan:
      Run KWin/X11 on Xephyr and was able to pick a color and
      kill a window
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D10302
      ea5e7011
  10. 05 Nov, 2017 1 commit
    • Martin Flöser's avatar
      Don't use the global KConfig object on the OpenGL freeze detection thread · a7117e43
      Martin Flöser authored
      Summary:
      This is meant to address Bug 372114. The problem here is that the KConfig
      object (and its derivatives), that the freeze detection thread needs to
      record the freeze, are not thread safe. When it happens that the main
      thread is in fact not frozen, it is possible that the two stomp on each
      other's KConfig object.
      
      The solution applied here is to use the KSharedConfig::openConfig
      function, which is thread safe, on the freeze detection thread. As was
      mentioned by Martin Flöser in the discussion, the thread needs to obey
      the name of the main config file of KWin, which can change in the future.
      
      As a secondary issue, this patch also turns off KCrash reporting for
      aborts due to a freeze being detected. IMO it is not very user friendly
      to still show a crash report to the user, even after this bug is fixed,
      for the deliberate SIGABRT. Maybe a less intrusive notification could be
      used to tell the user why effects are suddenly disabled?
      
      I've been using kwin with this change for several weeks now and it makes
      the restarts of kwin due to freezes unobtrusive. However, most (I would
      say almost all) of these freezes are actually instances where the system
       is being slow after eg. screen resolution is changed.
      
      BUG: 372114
      FIXED-IN: 5.11.3
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: ngraham, graesslin, anthonyfieroni, cfeck, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8356
      a7117e43
  11. 01 Nov, 2017 1 commit
  12. 31 Oct, 2017 1 commit
  13. 19 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Create a dedicated X11Filter for Client sync events and move it to X11 platform · 2e868c50
      Martin Flöser authored
      Summary:
      On Wayland we have the sync disabled as it doesn't work properly. This
      allows us to also move the sync event handling into the X11 standalone
      platform.
      
      The code is slightly refactored: instead of passing the event to each
      Client, we search for the matching Client. For that the SyncAlaram struct
      is added to public section of Client. The method to handle the sync
      doesn't need the event any more and is moved from events.cpp to
      client.cpp.
      
      Test Plan:
      Run Xephyr+kwin_x11, resized a window and verified through
      gdb breakpoint that the sync still works
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D7942
      2e868c50
  14. 18 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Add a pure virtual method to Platform to describe the supported compositors · 09489a4c
      Martin Flöser authored
      Summary:
      So far KWin does not know which Compositors the platform actually
      supports. This results in KWin happily trying to use the OpenGL
      compositor on fbdev or the QPainter compositor on hwcomposer although
      that is obviously going to fail as the platform doesn't support this.
      
      By adding a pure virtual method all Platforms can define what they
      support. In a later step the Compositor can use this to create an
      appropriate scene and also perform proper fallback handling in case the
      scene creation fails.
      
      Test Plan: Compiles
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8316
      09489a4c
  15. 16 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Move X11-only specific part of EffectsHandlerImpl to x11 platform plugin · 7ef84091
      Martin Flöser authored
      Summary:
      The Platform API is extended by a call to create the EffectsHandler. In
      X11 standalone Platform a new EffectsHandlerImplX11 is added which
      contains the X11 only parts of the EffectsHandler, such as grabbing the
      X keyboard and the X11 mouse interception window.
      
      The EffectsHandlerImpl gains some virtual methods for the parts which
      are now done in the X11 specific implementation. In return we get rid of
      lots of if-else structures checking for the operation mode.
      
      Test Plan: Only compile tested.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7955
      7ef84091
  16. 22 Sep, 2017 1 commit
  17. 01 Sep, 2017 4 commits
  18. 24 Aug, 2017 1 commit
    • Martin Flöser's avatar
      Move updateXTime into the X11 standalone platform · 1cc38c92
      Martin Flöser authored
      Summary:
      KWin::updateXTime only delegates into the platform API where the method
      is a no-op. The actual implementation is moved into the X11 standalone
      platform as it uses QX11Info which is non functional except on the X11
      standalone platform.
      
      This change exposes a problem with timestamp handling: on Wayland the
      X11 timestamp does not get updated at all, causing e.g. window sync not
      work correctly (c.f. bug 374881). We cannot implement the updating in the
      same way as QX11Info/Qt xcb platform does it as that would introduce a
      blocking roundtrip to XWayland which is dangerous.
      
      As a side-effect this change removes linking to Qt5::X11Extras in kwin
      core as it's no longer needed.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7515
      1cc38c92
  19. 12 Aug, 2017 1 commit
    • Martin Flöser's avatar
      Move the X11 specific OverlayWindow into the platform/x11 · b4a79d30
      Martin Flöser authored
      Summary:
      The overlay window is only needed for the X11 based compositors. Given
      that it is better suited in the X11 platform. Unfortunately it is not
      possible to completely move it into the platform plugin as it is still
      referenced in KWin core (e.g. SceneXRender). Due to that the
      OverlayWindow in KWin core is turned into a pure virtual class with the
      implementation being moved into the plugin.
      
      The platform API gains a new virtual factory method which is only
      implemented in the X11 platform.
      
      Test Plan: Compiles
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7193
      b4a79d30
  20. 27 Jul, 2017 2 commits
  21. 16 Jul, 2017 1 commit
    • Martin Flöser's avatar
      [platforms/x11] Quit the OpenGL Freeze protection thread on shutdown · 06a558e3
      Martin Flöser authored
      Summary:
      Weird NVIDIA behavior fixup part 2. Now that we do no longer freeze when
      NVIDIA decides to create an OpenGL error on startup
      (aefb5f4d), we experience a new issue.
      KWin is terminating (no idea why, [1]) and at the same time the OpenGL freeze
      protection thread is still running. So far we did not terminate the
      thread on shutdown and thus we hit an abort in Qt.
      
      This change ensures that we properly terminate the thread on shutdown.
      
      [1] My current theory is that games terminate KWin, common pattern of
      bug reports is "steam".
      
      BUG: 382283
      FIXED-IN: 5.10.4
      
      Test Plan:
      Tortured KWin by making sure I go through the code path,
      saw the abort without the patch, no more abort with the patch
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6735
      06a558e3
  22. 14 Feb, 2017 1 commit
    • Martin Flöser's avatar
      Split modifier only handling into a dedicated InputEventSpy · 65ddd32d
      Martin Flöser authored
      Summary:
      The functionality regarding triggering modifier only shortcuts is moved
      out of Xkb - where it doesn't belong to - and is turned into an input
      event spy listening for the changes it is interested in. Previously
      the state got queried by asking e.g. for the pressed buttons, now it's
      tracked directly.
      
      The X11 side needs a larger change due to that as now pushing the events
      into Xkb does not trigger modifier only shortcuts any more. Instead the
      "normal" way through the platform API needs to be used which triggers the
      processing of filters and spies.
      
      The problem here is that our redirections only process events if they are
      inited and that only happens on Wayland. We cannot call init on them as
      that would create all the Wayland filters and spies and processing would
      probably break. As an intermediate solution the spies are now processed
      and there we know that it won't matter. A future solution would be to
      remove the init checks completely and just send through both filters and
      spies and ensure that on X11 only the supported ones are loaded.
      
      Closes T5220
      
      Test Plan: Tested on Wayland and X11
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T5220
      
      Differential Revision: https://phabricator.kde.org/D4578
      65ddd32d
  23. 17 Jan, 2017 1 commit
    • Martin Flöser's avatar
      Move X11 specific KGlobalAccel handling into the x11-standalone platform · 2904d4a0
      Martin Flöser authored
      Summary:
      InputRedirection has a workaround to add a connect on a QAction which
      is used for a global shortcut. This is specific to the X11 platform as
      the xtime needs to be updated.
      
      This change adds a new virtual method to the Platform and moves the
      implementation into the X11 standalone platform. Thus it does no longer
      gets called on Wayland.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D4168
      2904d4a0
  24. 17 Nov, 2016 1 commit
    • Martin Flöser's avatar
      Support interactive window selection through the Platform · 7b464cf2
      Martin Flöser authored
      Summary:
      A new virtual method is added to Platform:
      startInteractiveWindowSelection
      
      The interactive window selection enters a mode where the user can select
      a window through the pointer or keyboard device. The cursor is turned
      into a crosshair cursor, unless another cursor name is provided (e.g.
      pirate for kill window).
      
      Once a window is selected the provided callback method is invoked with
      the selected Toplevel as argument. In case the user cancelled the
      selection a nullptr argument is passed in.
      
      Currently it's only implemented by the X11 standalone platform using the
      logic from KillWindow. Just instead of killing the window the callback
      is invoked.
      
      KillWindow loses the X11 implementation and interacts with the new
      functionality in Platform by providing a lambda function for the
      killing.
      
      Test Plan: Killing of X11 windows is still possible
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D3363
      7b464cf2
  25. 16 Nov, 2016 1 commit
    • Martin Flöser's avatar
      Remove KWin::display from kwinglobals · 346619aa
      Martin Flöser authored
      Summary:
      And finally nothing inside libkwineffects, libkwinglutils,
      libkwinxrenderutils and kwineffect and kwin core uses KWin::display.
      We are finally XLib free!
      
      This change drops KWin::display and removes the include to QX11Info from
      kwinglobals.h. And the libraries no longer need to link X11Extras.  Due
      to that removal a few seeming unrelated changes are required to add the
      include where needed and linkage to X11Extras.
      
      The biggest change is to x11 platform plugin which still needs the
      display and caches it in the Platform and passes it to various places in
      a way that the code doesn't need to be adjusted.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3337
      346619aa
  26. 31 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Add way to hide/show cursor in Platform · e90e5968
      Martin Flöser authored
      Summary:
      Some platforms support to hide and show the cursor. This will be needed
      by e.g. the zoom effect which currently only provides this functionality
      on X11.
      
      This change introduces a new method in the Platform to hide and show the
      cursor. The methods need to be called balanced and the implementation
      takes care of only showing again if all hide got matched by a show.
      
      The actual hiding and showing is performed in the platform plugins. So
      far the DRM and X11/Standalone platforms implement the required
      functionality, though other platforms probably could implement as well.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3119
      e90e5968
  27. 25 Oct, 2016 1 commit
    • Antonio Larrosa Jimenez's avatar
      [platformx/x11] Add a freeze protection against OpenGL · 19147f5f
      Antonio Larrosa Jimenez authored
      Summary:
      With nouveau driver it can happen that KWin gets frozen when first trying
      to render with OpenGL. This results in a freeze of the complete desktop
      as the compositor is non functional.
      
      Our OpenGL breakage detection is only able to detect crashes, but not
      freezes. This change improves it by also added a freeze protection.
      
      In the PreInit stage a thread is started with a QTimer of 15 sec. If the
      timer fires, qFatal is triggered to terminate KWin. This can only happen
      if the creation of the OpenGL compositor takes longer than said 15 sec.
      
      In the PostInit stage the timer gets deleted and the thread stopeed
      again.
      
      Thus if a freeze is detected the OpenGL unsafe protection is written into
      the config. KWin aborts and gets restarted by DrKonqui. The new KWin
      instance will no longer try to activate the freezing OpenGL as the
      protection is set.
      
      If KWin doesn't freeze the protection is removed from the config as
      we are used to.
      
      Check for freezes for the first n frames, not just the first
      
      This patch changes the freeze detection code to detect freezes in the
      first 30 frames (by default, users can change that with the
      KWIN_MAX_FRAMES_TESTED environment variable). This detects
      successfully the freezes associated to nouveau drivers
      in https://bugzilla.suse.com/show_bug.cgi?id=1005323
      
      Reviewers: davidedmundson, #plasma, #kwin, graesslin
      
      Reviewed By: #plasma, #kwin, graesslin
      
      Subscribers: luebking, graesslin, kwin, plasma-devel, davidedmundson
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D3132
      19147f5f
  28. 20 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Add a PlatformCursorImage to Platform and EffectsHandler · ea52ef9e
      Martin Flöser authored
      Summary:
      There are several effects (screenshot, zoom) which need access to the
      cursor image and cursor hotspot. So far these effects used X11
      unconditionally to get the cursor which obviously does not work on
      Wayland.
      
      This change adds a new class PlatformCursorImage to kwinglobals which
      wraps what a cursor is (image and hotspot) and adds a new virtual method
      to Platform to provide such a PlatformCursorImage. By default it's the
      cursor image the Platform tracks. On X11/standalone platform this new
      virtual method is overriden and provides a PlatformCursorImage from X11
      using the code previously used in screenshot effect.
      
      Screenshot effect and zoom are adjusted to use the new API instead of
      X11.
      
      Test Plan:
      Zoom effect tested on Wayland, now gets the proper cursor icon.
      X11 functionality not yet tested.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3093
      ea52ef9e
  29. 19 Aug, 2016 2 commits
    • Martin Flöser's avatar
      Move X11Cursor into the x11standalone platform plugin · 2a8ab547
      Martin Flöser authored
      At the same time the xinput2 integration is split out of X11Cursor
      and made a standalone part of the platform plugin. XInput integration
      is nowadays not only used by the cursor position polling, but also
      for modifier only shortcuts.
      
      By splitting it out the modifier shortcuts start to work also when
      one doesn't have anything requesting a mouse position polling.
      
      This also simplifies the conditional builds: xinput integration is
      only included if we have support for it at compile time without having
      to have many ifdefs in the cursor implementation. For the inclusion of
      cursor in the kcmkwin this also removes all the ifdefs.
      
      The key events are only requested if we have xinput 2.1. Otherwise we
      would not get all raw events if the input device gets grabbed.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2473
      2a8ab547
    • Martin Flöser's avatar
      Create Cursor instance through Platform · 03700500
      Martin Flöser authored
      By default the InputRedirectionCursor is created and only the X11
      standalone platform creates the X11 specific cursor.
      
      This is a preparation step for moving the X11 specific cursor
      implementation into the x11standalone platform plugin.
      03700500
  30. 17 May, 2016 4 commits
    • Martin Flöser's avatar
      Move the OpenGL unsafe check into the Platform · 7c822fad
      Martin Flöser authored
      Summary:
      A new virtual method createOpenGLSafePoint is added to Platform.
      This is invoked through the Compositor with a PreInit and a PostInit
      argument pre and post creating the SceneOpenGL.
      
      The Platform plugin can implement this and use it for detecting whether
      creating the OpenGL compositor on this platform crashed in the past.
      Thus it's the base for the openGLIsBroken platform check.
      
      The x11 standalone plugin is the first to implement this functionality
      using the previous code which was designed for X11.
      
      This also means that a crash of the OpenGL compositor during init on
      Wayland won't result in OpenGL being disabled.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1582
      7c822fad
    • Martin Flöser's avatar
      If glx is not available try to create egl backend · 48e69b77
      Martin Flöser authored
      Summary:
      So far the OpenGL is unsafe check functionality in Compositor disabled
      OpenGL compositing if glx is not available and we are in standalone X11
      mode.
      
      This is technically no longer correct for quite some time. Just because
      GLX is not available doesn't mean that OpenGL doesn't work. We have an
      EGL backend. So let's try to use that if glx is not available.
      
      This change removes the check completely from Compositor. Instead the
      standalone x11 plugin checks whether glx is available prior to createing
      the glx backend. If not available it falls through to the egl backend.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1581
      48e69b77
    • Martin Flöser's avatar
      Provide functionality of CompositingPrefs through Platform · d15d3a5f
      Martin Flöser authored
      Summary:
      CompositingPrefs is only relevant for X11 standalone. It had some
      "hacks" to make it not block Compositing on Wayland. Thus it was in
      its current form not really useful.
      
      Now all the functionality is provided through Platform with a default
      implementation which is sensible for Wayland platforms.
      
      The X11 standalone platform implements the new methods with the
      Wayland checks removed.
      
      In addition all calls to CompositingPrefs now go through the platform
      directly and CompositingPrefs is completely dropped.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1576
      d15d3a5f
    • Martin Flöser's avatar
      Move requiresCompositing from Application to Platform · c45942a7
      Martin Flöser authored
      Summary:
      This change reduces the windowing system specific code pathes. Instead
      of checking whether we are on X11 or Wayland to decide whether
      compositing is required, we just ask the Platform.
      
      The default is true, only x11 standalone allows to not require
      compositing.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1575
      c45942a7