1. 23 Sep, 2017 2 commits
  2. 19 Sep, 2017 2 commits
    • Martin Flöser's avatar
      Support mapping QKeyEvent to xkb_keysym_t · a17c85a9
      Martin Flöser authored
      Summary:
      This is needed in virtual keyboard and also used KKeyServer so far. With
      this change it is moved to new API provided in Xkb. The new translation
      map is now also used for the direction from Qt::Key +
      Qt::KeyboardModifier to xkb_keysym_t.
      
      New implementation is supported by a new test case covering the same
      combinations as in the existing direction.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7356
      a17c85a9
    • Jesse Pullinen's avatar
      Fix TouchEvent::id() returning -1, fixes a crash · 0eba3f3c
      Jesse Pullinen authored
      Summary:
      Libinput returns -1 when calling libinput_event_touch_get_slot on an event
      from a single-touch touchscreen. The returned value is used in
      DecorationEventFilter to determine the touch which is acting on it. The value -1
      is used to signify that the decoration is not being acted on. Thus when
      releasing the touch, it checks whether it was being dragged, and as it thinks
      it isn't, it doesn't handle it and the decoration is still being dragged.
      Clicking on the decoration then crashes kwin.
      
      Test Plan: Move a window by dragging the decoration with a single-touch touchscreen.
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: graesslin, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7854
      0eba3f3c
  3. 18 Sep, 2017 1 commit
  4. 17 Sep, 2017 1 commit
  5. 12 Sep, 2017 1 commit
    • Martin Flöser's avatar
      Move XRandR event filter into XRandRScreens · 4fa41165
      Martin Flöser authored
      Summary:
      The code in events.cpp was problematic as it was called in a Wayland
      session. So KWin changed outputs, this gets mirrored to XWayland and
      then KWin reacted on the XRandR event and might have even changed the
      refresh rate due to that - bad idea.
      
      This change moves the code into the already existing X11EventFilter for
      XRandR events in XRandRScreens.
      
      Test Plan: Run kwin_x11 in gdb on Xephyr, breakpoint in new code and triggered XRandR event
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7654
      4fa41165
  6. 08 Sep, 2017 1 commit
  7. 07 Sep, 2017 1 commit
    • Martin Flöser's avatar
      Delay syncing internal window geometry to end of cycle · e0f95fd9
      Martin Flöser authored
      Summary:
      The syncing of the window geometry to the internal geometry can
      unfortunately cause a freeze in very special conditions:
      1. create QML component
      2. a Plasma::Dialog gets created
      3. It creates the DialogShadows
      4. This triggers QGlobalStatic creation which locks a non-recursive
      mutex
      5. The creation of DialogShadows creates a Registry and triggers a
      roundtrip on the Wayland server
      6. KWin processes all Wayland events
      7. This triggers the creation of a ShellClient
      8. The ShellClient has a PlasmaShellSurface which requested a position
      9. The new geometry does not match the geometry of the Plasma::Dialog
      10. ShellClient syncs the geometry to the Plasma::Dialog
      11. Plasma::Dialog updates the theme because window geometry changed
      12. This accesses the DialogShadows...
      
      which is still in the non recursive mutex and we have a freeze.
      
      By delaying the sync to the end of cycle we jump out of this deadly
      sequence.
      
      BUG: 384441
      
      Test Plan:
      The freeze doesn't hit any more. It's possible that some test
      cases need adjustments.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7712
      e0f95fd9
  8. 01 Sep, 2017 5 commits
    • Martin Flöser's avatar
      Provide a virtual Scene::qpainterRenderBuffer() -> QImage* method · c398db3c
      Martin Flöser authored
      Needed by testing of QPainter scene to access the back buffer. Exposed
      as a virtual method in Scene, so that the test does not have to cast to
      SceneQPainter.
      c398db3c
    • Martin Flöser's avatar
    • Martin Flöser's avatar
      Port some displayWidth/displayHeight usages to Screens::size() · 1e13deaa
      Martin Flöser authored
      Summary:
      KWin::displayWidth and KWin::displayHeight are bound to X11 which
      doesn't make much sense on X11. In addition KWin internally knows
      the overall display dimensions through the Screens singleton class.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D1798
      1e13deaa
    • Martin Flöser's avatar
      Add <number> to Wayland captions if the caption is the same · 6685288d
      Martin Flöser authored
      Summary:
      Bringing another caption feature from X11 to Wayland. If we have
      multiple windows with the same caption, starting from the second window
      a suffix <number> is added.
      
      E.g. if we have three windows with caption "foo", the naming is:
       * foo
       * foo <2>
       * foo <3>
      
      The change tries to use as much shared code between the X11 and Wayland
      implementation. Unfortunately it's not possible to share completely as
      the X11 implementation does X11 specific things like editing the visible
      name.
      
      By sharing the code the numbering also works cross windowing system.
      That is if a window is called "foo" on X11, a new window on Wayland with
      caption "foo" will get adjusted to "foo <2>" and vice versa.
      
      The change also eliminates a duplicated signal for captionChanged in
      ShellClient (found by test case).
      
      By using the shared implementation on X11 side a bug gets fixed which
      got introduced with the support of "unresponsive", this is no longer
      considered and the numbering still works even if there is a window which
      is unresponsive.
      
      Test Plan: New test case and manual testing
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7425
      6685288d
    • Martin Flöser's avatar
      Move X11 specific event filtering for ScreenEdges into x11 standalone platform · 833f933c
      Martin Flöser authored
      Summary:
      This change splits out the X11 specific event filtering into a dedicated
      X11EventFilter. It is created in the x11 standalone platform plugin when
      the first Edge is being created.
      
      Some of the X11 specific code is removed from ScreenEdges, though more
      refactoring is possible in ScreenEdges to share more code between X11
      specific and generic implementation.
      
      Test Plan: Run KWin on Xephyr, screen edge approach effect still shows
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7406
      833f933c
  9. 30 Aug, 2017 1 commit
    • David Edmundson's avatar
      ARGB buffers are premultiplied · b57a525e
      David Edmundson authored
      D7460 in kwayland assumes all WL_SHM_FORMAT_ARGB8888 buffers have
      opacity premultipied RGB values.
      
      Kwin tests need updating to do the same.
      Rendering code did not need changing.
      
      Test Plan: Tests now pass
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7607
      b57a525e
  10. 24 Aug, 2017 2 commits
    • Martin Flöser's avatar
      [autotests] Fix testX11TimestampUpdate after latest change · 28534e36
      Martin Flöser authored
      We need to init the X11 standalone platform plugin now.
      28534e36
    • David Edmundson's avatar
      Send output enter/leave events to surfaces · f0971532
      David Edmundson authored
      Summary:
      A surface has an API to know which screen(s) it's on, this is useful
      especially for knowing the scale it should render at.
      
      In practice Qt currently doesn't do anything with this information; but
      that's set to change.
      
      Test_helpers is changed as we need to create output objects in order for
      wl_surface to map them.
      
      Closes task T4467
      
      Test Plan:
      Attached unit test.
      As mentioned above, it doesn't have any real world impact currently, so not a lot
      to test.
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: johanhelsing, graesslin, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T4467
      
      Differential Revision: https://phabricator.kde.org/D7359
      f0971532
  11. 21 Aug, 2017 1 commit
    • Martin Flöser's avatar
      Use xcb-icccm to read the name property · c87230c3
      Martin Flöser authored
      Summary:
      The KWindowSystem call which we used doesn't work on Wayland as it's only
      implemented in the xcb variant and cannot be made available for Wayland
      in an easy way as it is still XLib based.
      
      This change turns the optional XCB-ICCCM dependency in a required one
      and thus can use the functionality provided by said library to implement
      what KWindowSystem provided.
      
      BUG: 382789
      
      Test Plan: New test case which failed with old code
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7046
      c87230c3
  12. 19 Aug, 2017 2 commits
    • Martin Flöser's avatar
      Send QKeyEvent with Qt::Key as expected by Qt to internal windows · 70bc9524
      Martin Flöser authored
      Summary:
      KWin passes the current keysym converted to a Qt::Key in the QKeyEvent.
      The current keysym does not always change when a key gets released, so
      when pressing a shortcut the release carry a Qt::Key which could be
      considered as wrong.
      
      QtWayland transforms the actual pressed/released key into a keysym and
      passes that through the QKeyEvent. This change does the same for the
      internal windows. A new QKeyEvent is created and adjusted in a way that
      it matches what Qt expects.
      
      Why not change everything to how Qt expects it? The key is used at
      various places and in KWin internally we expect the behavior how it is
      currently implemented. So it's better to use Qt's expectation only when
      interacting with Qt.
      
      Also the change carries a workaround for a bug in QKeySequenceEdit
      (see QTBUG-62102) and transforms Super to Meta. As this adjustment only
      makes sense for the internal windows we need to send in an adjusted
      QKeyEvent anyway, so another argument for using the Qt behavior only in
      this place.
      
      Test Plan:
      Can set a shortcut on Wayland and it can be used to activate
      the window.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D6828
      70bc9524
    • Martin Flöser's avatar
      [platforms/x11] Use a GlxContextAttributeBuilder · f88c322a
      Martin Flöser authored
      Summary:
      Based on the work of 3f4995fb this change
      introduces a GlxContextAttributeBuilder to make the requesting of context
      attributes cleaner, more verbose and less error prone copy and paste.
      
      Test Plan:
      Switched between Core and legacy and verified the output;
      extended auto test
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D6411
      f88c322a
  13. 18 Aug, 2017 1 commit
    • David Edmundson's avatar
      Track outputs in kwin integration tests · 34de2c2b
      David Edmundson authored
      Summary:
      Split from the last review, as in order to track output's removed (in
      any way that's useful) the registry needs to be on the heap and the change grew.
      
      Test Plan:
      Every test that previously passed on my system still does
      Though currently that's not every test (for some reason) which was
      my main motivation for splitting.
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7377
      34de2c2b
  14. 16 Aug, 2017 2 commits
    • Martin Flöser's avatar
      Migrate Xkb::toQtKey away from KKeyServer · 5d101ce2
      Martin Flöser authored
      Summary:
      Turn Xkb into a QObject
      
      Reduced dependencies on other classes and allows to emit signal directly
      instead of emitting a signal on another class.
      
      Dependency inject KWayland::Server::SeatInterface into Xkb
      
      No need to depend on WaylandServer from within Xkb.
      
      [autotests] Add test case for Xkb::toQtKey
      
      Tests all key codes KKeyServer is able to map to Qt.
      
      Migrate Xkb::toQtKey away from KKeyServer
      
      The regression in kwindowsystem in
      32526718eae99ccb594360627586eebdf793372b showed once more that it's time
      to migrate the xkb keysym to Qt::Key mapping away from KKeyServer. The
      main problem with KKeyServer is that it's made for X11 and we don't have
      X11 here. This causes warnings printed at runtime and the code only
      works by accident at all because KKeyServer fails to initialise
      modifiers. That is normally KKeyServer would include the modifiers, but
      that is nothing we are interested in for mapping xkb keysyms to Qt::Key.
      
      So to address this, KWin now implements the mapping itself. It's based
      on the implementation in KKeyServer, but also improved by providing
      faster xkb to Qt conversion (which matters for KWin more than the other
      direction).
      
      Long term plan is to extend this so that also on X11 it can be used.
      Then it should be split out and be used in KKeyServer as a replacement
      for the current implementation which could support both X11 and Wayland.
      
      Test Plan:
      New test case added which covers all keysyms supported by
      existing KKeyserver mapping
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7336
      5d101ce2
    • Martin Flöser's avatar
      [autotests] Add test case for Xkb::toQtKey · 801fe410
      Martin Flöser authored
      Tests all key codes KKeyServer is able to map to Qt.
      801fe410
  15. 13 Aug, 2017 3 commits
  16. 12 Aug, 2017 1 commit
    • Martin Flöser's avatar
      Implement the shortcut caption suffix for Wayland windows · bbca8c66
      Martin Flöser authored
      Summary:
      The generation of the shortcut caption part is moved from Client to
      AbstractClient. The ShellClient also has a captionSuffix and implements
      the full part in caption.
      
      Overall this needs more refactoring to support more sharing between the
      two implementations. But one step at a time.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D7093
      bbca8c66
  17. 09 Aug, 2017 2 commits
  18. 08 Aug, 2017 2 commits
  19. 02 Aug, 2017 1 commit
  20. 31 Jul, 2017 2 commits
  21. 29 Jul, 2017 2 commits
    • Martin Flöser's avatar
      [autotests] Fix unused function warnings · 1447f464
      Martin Flöser authored
      The functions are defined in a common header but not used in all tests.
      This creates needless warning noise, so hide them through an ifdef.
      1447f464
    • Martin Flöser's avatar
      Replace Workspace::slotWindowQuickTileFoo by a quickTileWindow with argument · 64da6c8d
      Martin Flöser authored
      Summary:
      Thanks to std::bind we don't need that many different slots to setup the
      global shortcut connections. Instead we can have one shared
      implementation which takes the argument and passes it to the window.
      
      To support std::bind arguments in kwinbindings the initShortcut method
      and dependencies are adjusted as well as a new macro is added.
      
      As I don't want to include abstract_client.h in workspace.h a new enum
      is created for the quick tiling flags used in Workspace. This caused a
      larger refactoring as the change to an enum class also caused quite some
      changes.
      
      Test Plan: Affected test cases still pass
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6783
      64da6c8d
  22. 28 Jul, 2017 2 commits
  23. 27 Jul, 2017 2 commits