1. 02 Nov, 2017 3 commits
    • Martin Flöser's avatar
      [platforms/drm] Rotate screen if requested from KScreen · b2d8bbec
      Martin Flöser authored
      Summary:
      This change hooks up the drm plane rotate with the rotation requests
      from KScreen. Our requests support more than what KScreen exposes in the
      UI, that is all the flipped variants. I do not really understand what
      the flip means, so this is not implemented yet.
      
      Furthermore this only implements the visual rotation and not the input
      rotation. This means mouse movement and touch input is currently broken
      on a rotated screen.
      
      Please note that the hardware I used seems to not support the vertical
      rotation. I'm not sure whether my code works. On my system it just
      results in atomic commit errors and we need to go back to a previous
      working state. This is not yet implemented. I need to test the vertical
      rotation on my notebook, which should (in theory) support it.
      
      Reviewers: #kwin, #plasma, subdiff, sebas
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8594
      b2d8bbec
    • Martin Flöser's avatar
      [platforms/drm] Add support for rotation property on the Plane · 77b5c3ca
      Martin Flöser authored
      Summary:
      A preparation step to support rotation of outputs. The idea is to rotate
      using DRM directly and not add it to the compositors. With this change
      and a small hack to try it, I was able to rotate the screen.
      
      Reviewers: #kwin, #plasma, subdiff
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8582
      77b5c3ca
    • Bhushan Shah's avatar
      [platforms/hwcomposer] Set value of surfaceDamage.numRects to 0 · 48590783
      Bhushan Shah authored
      Newer hwcomposer implementation seem to require this. This additional
      fix is required in addition to 54565a94 for newer hwcomposer
      interface.
      48590783
  2. 01 Nov, 2017 7 commits
    • David Edmundson's avatar
      Render GL Window decorations at the correct scale · fc887ab9
      David Edmundson authored
      Summary:
      Under wayland we support high DPI putting by putting a separation
      between the logical co-ordinate system and the resolution of rendered
      assets.
      
      When a window is on a high DPI screen, we should render at the higher
      resolution.
      
      Like the window scaling this handles any combination of a 2x scaled
      decoration being rendered on a 1x screen or vice versa.
      
      ---
      This patch is a bit different from the other scaling stuff. We have to
      generate the quads *before* we have an updated texture with the new
      scale. This means the scale isn't attached to the buffer like elsewhere.
      
      That's why I added a property in TopLevel so there's still one canonical
      source and things can't get out of sync.
      
      BUG: 384765
      
      Test Plan:
      Crystal clear breeze and oxygen decos on my @2x display
      Drag windows to attached @1x display, things still look OK when across 2
      screens
      Changing the scale of a screen updated the decos instantly
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: graesslin, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8600
      fc887ab9
    • David Edmundson's avatar
      Only cleanup XRenderUtils is we actually created it · 449c9336
      David Edmundson authored
      Summary: BUG: 386430
      
      Test Plan:
      kwin_x11 --crashes 20
      Got a dialog. Hit cancel. It didn't crash
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8593
      449c9336
    • David Edmundson's avatar
      Remove code duplication · ca645914
      David Edmundson authored
      Summary: setGlobalPos sets these, we don't need to call it twice
      
      Test Plan: Looked at setGlobalPos
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8581
      ca645914
    • David Edmundson's avatar
      Load QtQuick settings · e7b183f8
      David Edmundson authored
      Summary:
      Loads settings on whether QtQuick uses GL or software rendering
      
      Aurorae needed a fix. The rest "just works" with up-to-date plasma framework.
      
      Test Plan:
      Alt tabbed
      Showed an OSD
      Grepped kwin's QML for any custom shaders.
      (which is the only part that doesn't work here)
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: graesslin, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8040
      e7b183f8
    • David Edmundson's avatar
      Support software QtQuickRendering in Aurorae · 54b36325
      David Edmundson authored
      Summary:
      For software QtQuick rendering we want to create a pixmap buffer and
      render our contents in there.
      
      m_rendercontrol->grab does this, but also covers the GL side in pretty
      much the same way that we were currently doing.
      
      In doing so I found a bug in Qt, that's submitted upstream, and also worked round.
      
      Test Plan:
      Tested with forced software mode, could see an Aurorae decorations
      Tested without (so normal code), could see an Aurorae decorations
      Tested wayland on nvidia with software rendering, didn't freeze
      
      Whether we then end up using GL, painter or xrender rendering is irrelevant
      (but I tested two of them anyway)
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: graesslin, apol, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8039
      54b36325
    • Martin Flöser's avatar
      Guard X11 access in supportInformation · 018afd09
      Martin Flöser authored
      Caused crash when running KWin without X11 support.
      018afd09
    • Bhushan Shah's avatar
      [platforms/hwcomposer] Few fixes for hwcomposer platforms · 54565a94
      Bhushan Shah authored
      Summary:
      - Actually use double layered compositing, previously both layers were
      of type HWC_FRAMEBUFFER, instead of 2nd layer being
      HWC_FRAMEBUFFER_TARGET. Thanks to @NotKit on telegram for pointing this
      out.
      
      - Use sourceCropf instead of sourceCrop, as sourceCrop is legacy option.
      
      Test Plan: have to test on actual device, but test_hwcomposer does have similar code.
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8587
      54565a94
  3. 31 Oct, 2017 7 commits
    • Martin Flöser's avatar
      [platforms/drm] Fix typo in cleanup of eglSurface · 7739dea3
      Martin Flöser authored
      When switching modes the wrong surface was destroyed resulting in a
      crash.
      7739dea3
    • Martin Flöser's avatar
      [drm] Implement changing of modes · 33a4cf40
      Martin Flöser authored
      Summary:
      This change hooks up the bits for changing the mode when a request to
      change mode from kscreen is received. This includes:
       * setting new mode in DrmOutput
       * creating new buffers in SceneQPainter backend
       * creating new GbmSurface in SceneOpenGL backend
      
      Room for improvement:
       * detect whether the new mode works and go back to old one if it fails
      
      Test Plan:
      Started both a QPainter/OpenGL session. Used kcmshell5 kscreen
      to modify the resolution. Saw that it got applied, maximized a window to
      verify it's correct. Changed back to original resolution. Verified it looked
      good by maximizing a window.
      
      Reviewers: #kwin, #plasma, subdiff, sebas
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8398
      33a4cf40
    • Martin Flöser's avatar
      Require Qt 5.9 · a5b17b22
      Martin Flöser authored
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8331
      a5b17b22
    • Martin Flöser's avatar
      Ensure libinput connection thread uses real time scheduling · 91d78daa
      Martin Flöser authored
      Summary:
      The SCHED_RESET_ON_FORK results in threads (not only processes) to have
      the scheduling policy reset to default. This means that the libinput
      thread is not real time, but this was actually intended.
      
      To solve this problem KWin does start without the RESET_ON_FORK flag
      during startup. Once createInput has been called the scheduling is
      adjusted again and RESET_ON_FORK is added again. This results in the
      libinput thread and all threads Qt starts in between (e.g. dbus) to gain
      real time policy. But it is still not leaked to other processes or to
      threads in KWin which don't need it.
      
      Other options considered: just don't use RESET_ON_FORK and instead
      manually reset on fork. This would mean all threads in KWin gain real
      time, but we don't need this. It's only interesting for the main
      (rendering, Wayland thread) and the input thread. Also the danger to
      leak into another process is too high.
      
      Keeping the capability till the libinput thread is created and adjust
      the thread itself. This option was discarded as I don't want KWin to
      have any capabilities when the QApplication is started.
      
      Test Plan: ps -eL -o class,rtprio,cmd,comm  | grep kwin_wayland
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8065
      91d78daa
    • Martin Flöser's avatar
      Merge branch 'Plasma/5.11' · f25088c4
      Martin Flöser authored
      f25088c4
    • Martin Flöser's avatar
      Fix rendering issues of subsurfaces by using proper clipping · d7179237
      Martin Flöser authored
      Summary:
      Rendering subsurfaces in the OpenGL compositor has always resulted in
      flickering when a subsurface gets repainted and there is a window on top
      of it. Looking at the code this is rather obvious: the clipping of the
      main window is ignored and the complete subsurface is rendered as is and
      thus also rendering above windows where it should not render.
      
      This change passes the clip region and whether hardware clipping is used
      to the rendering of subsurfaces which in turn uses it for rendering the
      texture.
      
      BUG: 385924
      FIXED-IN: 5.11.3
      
      Test Plan:
      Opened systemsettings, went to decoration KCM, put a window
      partially above and scrolled. Without change: strong flicker, with change:
      no flicker.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8369
      d7179237
    • Script Kiddy's avatar
      SVN_SILENT made messages (.desktop file) - always resolve ours · aa0a25f3
      Script Kiddy authored
      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"
      aa0a25f3
  4. 30 Oct, 2017 1 commit
    • David Edmundson's avatar
      Scaled decorations in QPainter mode · 7e6721ec
      David Edmundson authored
      Summary:
      Under wayland we support high DPI putting by putting a separation
      between the logical co-ordinate system and the resolution of rendered
      assets.
      
      I didn't include window decorations in the previous wayland scaling
      patchset. They were drawn them at a standard resolution, which is
      implicitly scaled up.
      
      This uses the Qt scaling, meaning oxygen and breeze (and others) get
      perfect high DPI support with zero client changes.
      
      Like the window scaling this handles any combination of a 2x scaled
      decoration being rendered on a 1x screen or vice versa.
      
      CCBUG: 384765
      
      Test Plan:
      export KWIN_COMPOSE=Q
      Had two screens of different scales
      It was the right size on both (as before)
      Was super-sharp on the fancy screen
      
      Reviewers: #plasma, hetzenecker, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: ngraham, graesslin, plasma-devel, kwin, #kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D8504
      7e6721ec
  5. 29 Oct, 2017 2 commits
  6. 28 Oct, 2017 1 commit
  7. 27 Oct, 2017 1 commit
  8. 26 Oct, 2017 6 commits
  9. 25 Oct, 2017 1 commit
    • David Edmundson's avatar
      Fix viewport on vertically stacked monitors · 5d7e22e5
      David Edmundson authored
      Summary:
      We want to translate by the monitor position, so that needs to be
      the negative of the position.
      
      But Kwin/KScreen treats 0 as the top of all monitors. GL treats 0 as
      bottom, so that all needs inverting.
      
      Hence this should be a positive y value for the viewport.
      
      BUG: 386099
      BUG: 385655
      
      Test Plan:
      Had two monitors
      Side by side was - fine
      Stacked vertically - still fine
      
      Modded X code to extend in y instead of x.
      3 monitors worked fine.
      
      Nested wayland only seems to support one screen?
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8479
      5d7e22e5
  10. 24 Oct, 2017 3 commits
  11. 23 Oct, 2017 2 commits
  12. 20 Oct, 2017 1 commit
  13. 19 Oct, 2017 5 commits
    • 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
    • Martin Flöser's avatar
      Drop the explicit fallback to XRender · 8f4b6a89
      Martin Flöser authored
      Summary:
      With the new try of all compositor types supported there is an automatic
      fallback from OpenGL to XRender/QPainter in case OpenGL setup failed.
      So there is no need to invoke a method to do just that.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D8364
      8f4b6a89
    • Martin Flöser's avatar
      Try all supported Compositor Types of the current Platform · 729bfd04
      Martin Flöser authored
      Summary:
      The Compositor now tries to create a Scene not just once but every
      type supported by the Platform till it finds one which works. The user's
      configuration is only used as a preferred hint and tried first if the
      platform supports it.
      
      This brings as an advantage that on platforms such as framebuffer the
      user does not need to specify which compositor to use: KWin uses QPainter
      automatically.
      
      Also we don't need to do the "translation" from XRender to QPainter any
      more. XRender is not supported by any platform using QPainter, so the
      user configuration is ignored anyway.
      
      BUG: 350159
      FIXED-IN: 5.12.0
      
      Test Plan: Run on framebuffer, verified debug output.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8363
      729bfd04
    • Martin Flöser's avatar
      [QPA] Implement Screen on top of internal Screens API · abedb464
      Martin Flöser authored
      Summary:
      The test DontCrashUseractionsMenu (Waylandonly) found an issue in our
      screen handling implementation in the QPA. The code exposed a short time
      frame between the dummy screen getting destroyed and the first screen
      being added. This could result in a crash of KWin.
      
      There is actually no need to implement Screen on top of Wayland screen.
      KWin has all the knowledge, so we can also base this on top of the
      Screens API.
      
      Advantages:
       * no delays due to Wayland roundtrips
       * handle screen getting removed (was a TODO)
       * handle resolution changes (was a TODO)
      
      The new implementation has a disadvantage that it destroys and readds
      all screens whenever something around the screen changes. This shouldn't
      be an issue in practice as it's only for the internal QPA and thus only
      affects KWin internal windows which is placed in global coordinates
      anyway. If it turns out to be a problem we need to track better the
      screen changes - so far those were not tracked at all.
      
      Test Plan: Run a few unit tests which change screens
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8345
      abedb464
    • Martin Flöser's avatar
      Add physicalSize to the Screens API · 02d3daf2
      Martin Flöser authored
      Summary:
      Allows to share the implementation in a better way and is a requirement
      to get the Screen implementation in the QPA plugin to be based on
      KWin::Screens instead of KWayland::Output.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8344
      02d3daf2