1. 29 Aug, 2016 2 commits
  2. 26 Aug, 2016 4 commits
    • Martin Flöser's avatar
      Move registerMetaType for SurfaceInterface* to main.cpp · 1c1dca6d
      Martin Flöser authored
      Toplevel has the SurfaceInterface* exposed as a property which results
      in a (incorrect) runtime warning on X11 about not registered meta type.
    • Martin Flöser's avatar
      Register metatype for KWin::EffectWindow* · 440cca91
      Martin Flöser authored
      It's used as arg in a QMetaObject::invokeMethod and there was a report
      about KWin printing a warning of unregistered metatype.
    • Martin Flöser's avatar
      DiscardWindowPixmap when Surface size changes · be79d1ae
      Martin Flöser authored
      So far this connect was only in ShellClient, but it's needed for all
      Toplevels. Also when a XWayland window has it's surface size changed,
      the pixmap needs to be discarded. Otherwise KWin might hit an assert
      in AbstractEGLTexture due to the buffer having a different size than
      the texture had previously.
      Test Plan:
      Firefox, click download on bugreports.qt.io used to trigger
      this for me. With this change no longer able to reproduce.
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2583
    • 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. 25 Aug, 2016 2 commits
    • Martin Flöser's avatar
      [autotests/integration] Add test case for rule matching on window role · 6e8a8913
      Martin Flöser authored
      New test infrastructure which supports testing window rules at runtime.
      Test exposes problem of window rules not able to match window roles in
      a case insensitive manner.
      CCBUG: 367554
    • Martin Flöser's avatar
      Forward x11 raw pointer buttons to PointerInputRedirection · 9c5f972c
      Martin Flöser authored
      The raw pointer button events intercepted in the XInput2 input filter
      get sent through the Platform to the PointerInputRedirection. This
      makes the PointerInputRedirection track the pointer button state and
      emit the signals for button changed and axis changed.
      These signals are used by the modifier-only shortcut detection to
      determine whether the shortcut should trigger.
      On X11 the "normal" input handling doesn't use the InputRedirection
      and the emitted signals are not consumed by anything else. As
      PointerInputRedirection is not inited the events are not forwarded
      to the input filter, thus won't be processed by other parts and
      won't interfere with the normal event processing on X11.
      Given that it also doesn't matter that the input filter does not
      apply the left-handed setting. The internal tracking will have a
      wrong mouse button, but nothing is going to do decisions based on
      the value of the pressed mouse button. For the moment all we are
      interested in is that a button is pressed.
      Test Plan:
      Pressed meta, clicked, scrolled, released meta: launcher
      did not open. Pressed meta, released meta: launcher opened
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D2506
      BUG: 367730
  4. 24 Aug, 2016 6 commits
    • Martin Flöser's avatar
      [effects] Add enum value for new TouchPoints effect · b78848ef
      Martin Flöser authored
      BUG: 367727
    • Martin Flöser's avatar
    • Martin Flöser's avatar
      Warp the xcb pointer whenever pointer leaves an X11 surface · 2feea783
      Martin Flöser authored
      For Xwayland windows we observed that passing pointer focus to another
      window does not trigger proper leave events on X. Which results in e.g.
      tooltip windows to show after the pointer moved to a completely
      different position on a completely different surface.
      This is a bug in Xwayland which will be fixed in 1.19 (already fixed in
      master). Given that there is a runtime version check. Although it's fixed
      in Xwayland master it's worth to carry a workaround.
      To circumvent this problem KWin warps the xcb pointer to 0/0 whever an
      X window loses pointer focus. That way the X window gets a proper leave
      through the X protocol.
      This created a problem though: when giving focus back to the X window it
      started to warp the pointer for maximized windows as KWin got pointer
      motion events through the X11 event filter for positions on the window
      decoration. These are passed into the screen edge filter which pushes
      the pointer back and warps our Wayland pointer. To solve this problem
      KWin no longer performs any actions for pointer motion in the X11 event
      filter if not on X11. The event filter needs to be reworked and most of
      it should be moved into the Platform API, if possible.
      Test Plan:
      Reproduced situations where one could see that pointer updates
      don't trigger leave. E.g. going from a highlighted window to the decoration.
      Reviewers: #kwin, #plasma_on_wayland, bshah
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2531
    • Martin Flöser's avatar
      Move implementation of iconGeometry from ShellClient to AbstractClient · 455c5c07
      Martin Flöser authored
      This allows Client to use the Wayland-specific implementation if there
      is no icon geometry set through the X11 way. That way Xwayland windows
      have an icon geometry even if Plasma is using Wayland and setting the
      icon geometry in the Wayland way. Which is expected as Plasma is
      ignorant about the windowing system a PlasmaWindow uses.
      In order to move the code from ShellClient to AbstractClient
      WaylandServer gained a new findAbstractClient(Surface*) method which
      is just like findClient(Surface*) with the difference that it returns
      an AbstractClient instead of a ShellClient*.
      Test Plan:
      minimized/unminimized an X client on Wayland, verified
      animation is correct (though broken in general for minimize)
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2530
    • Martin Flöser's avatar
      [effects] Drop the logout effect · af80a546
      Martin Flöser authored
      The new logout design doesn't want to have the vignetting. Thus the
      logout effect itself doesn't make any sense any more. All that would
      still be used is the logout blur which can also be provided by the
      blur effect nowadays for fullscreen windows. As the new logout is a
      fullscreen window it should use that one.
      The logout effect did one more thing: it kept the vignetting and the
      blur once the user selected logout. Now without the vignetting this
      would be weird and again doesn't make much sense any more.
      So overall I think it's better to just drop the logout effect and use
      blur effect in normal way. Neat side advantage: it will also work on
      Wayland out-of-the-box.
      Reviewers: #kwin, #plasma, #vdg
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D2553
    • Martin Flöser's avatar
  5. 23 Aug, 2016 9 commits
  6. 22 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Improve introspection into Scripting for KWin core/testing · c3dfacc3
      Martin Flöser authored
      This change introduces a Scripting::findScript method which returns
      the AbstractScript. Thus a test can load a script, retrieve it and
      trigger run on it. As the test would also need to know when finally
      the test is running a signal is introduced to notify about it.
      This makes the scripting ScreenEdgeTest way more reliable. The test
      had been failing on both build.kde.org and build.neon.kde.org due to
      not knowing when the script is loaded.
      Reviewers: #kwin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D2497
  7. 21 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Only trigger keyboard layout OSD if KWin manages input · 7d7bbcc5
      Martin Flöser authored
      On platforms where KWin does not manage input, that is does not
      use libinput, KWin gets the keyboard layout from another place, e.g.
      the X server. In that case KWin should of course not trigger the
      layout changed OSD if KWin thinks (for whatever reason) that the
      layout changed.
      BUG: 367637
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2521
  8. 19 Aug, 2016 9 commits
    • Martin Flöser's avatar
      [platforms/drm] Pass ownership of gbm_device to Platform · a67ccc35
      Martin Flöser authored
      Just like 4e7392b9:
      the ownership of the gbm_device must be passed to the Platform as
      the ownership of the EGLDisplay is also passed to the Platform and
      we may not destroy the gbm_device for an EGLDisplay we are still using.
      With this change I could restart the OpenGL compositor successfully
      and switch from OpenGL 3.1 to OpenGL 2 without a crash or rendering
    • Martin Flöser's avatar
      [platforms/virtual] Pass ownership of gbm_device and drm fd to Platform · 4e7392b9
      Martin Flöser authored
      The Egl backend opens the drm device and creates a gbm_device from it.
      From that it creates the EGL device. The EGL device outlives the EGL
      backend (e.g. for compositor restart). So far the EGL backend destroyed
      the gbm_device when going down which mesa did not like at all when a
      new context got created on that EGL device.
      Thus the ownership of gbm_device is also passed to the Platform so that
      the compositor can be restarted.
      This makes the TestSceneOpenGL no longer crash during the restart
      compositor test.
    • Martin Flöser's avatar
      Call setupCompositing on internal clients on startup of Compositor · 01ee957c
      Martin Flöser authored
      This fixes a regression found in TestSceneQPainter for restarting the
      Compositor. The internal clients were never added to the Scene.
      We cannot just call setupCompositing because there is a phase during
      startup where setupCompositing already passes but the Compositor is not
      yet fully initialized. Thus it could happen that it's called twice which
      makes the Scene assert.
      To solve that setupCompositing and finishCompositing are now overriden
      in ShellClient and track whether they successfully called
    • 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
    • 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.
    • Martin Flöser's avatar
      Ensure modifier locks and latches don't trigger the mod only shortcut · ec98f498
      Martin Flöser authored
      If caps lock is on the shift key should not trigger. Similar pressing
      caps lock should neither on activation press nor on deactivation press
      trigger the shortcut. Related to that are latched modifiers aka sticky
      modifiers: if the modifier is still on after releasing the key the
      shortcut should not trigger. We must assume the user wanted to use the
      modifier to activate the modifier, not to activate the shortcut.
      This change ensures that we don't track for modifier only shortcuts if
      a modifier is active before press or after release.
      The added test case demonstrates for caps lock, latched modifiers is
      currently still untested. (Needs a way to mock it).
      Test Plan: See test case for caps lock.
      Reviewers: #kwin, #plasma
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D2467
    • Martin Flöser's avatar
      Also finishCompositing for Wayland windows in Compositor::finish · facca936
      Martin Flöser authored
      We should be able to restart the Compositor also on Wayland.
      As the Compositor might be terminated after Workspace we need to
      ensure to not call into Workspace while doing finishCompositing.
      Reviewed-By: bshah
    • Martin Flöser's avatar
      Emit Workspace::deletedRemoved for every Deleted still around when terminating Workspace · 2ab8a7b8
      Martin Flöser authored
      For the exit-with-session option in kwin_wayland there is a chance that
      the window which triggered termination is currently a Deleted. The
      Wayland shutdown sequence terminates Workspace before the Compositor
      which results in that Deleted's Scene::Window surviving the shutdown
      process and thus the Shadow not being removed from the cache. This
      makes KWin assert very late in the shutdown process when the decoration
      shadow cache gets destroyed.
    • Martin Flöser's avatar
      Merge branch 'Plasma/5.7' · d03a50c6
      Martin Flöser authored
  9. 18 Aug, 2016 6 commits
    • Martin Flöser's avatar
      Ensure to directly delete old Shadow on update · fe8fc6f8
      Martin Flöser authored
      So far when deleting a Shadow we used deleteLater which caused it
      to be deleted in the next event cycle. This could in worst case result
      in the Shadow being deleted after compositing got suspended. Thus the
      Shadow not getting removed from the DecorationShadowCache which in
      turn would mess up rendering on resume of compositing as the cache
      returns a texture created for a different context.
      BUG: 361154
      FIXED-IN: 5.7.4
      Reviewers: #kwin, #plasma
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D2483
    • Bhushan Shah's avatar
      [platforms/hwcomposer] Set default old brightness to 50% (0x7f) · 88002fcb
      Bhushan Shah authored
      0xff or 100% is too much bright, this happens in first setup.
      Reviewed-by: mgraesslin
    • Martin Flöser's avatar
      [effects] Add new effect for touch point visualization · b7f49244
      Martin Flöser authored
      The new effect is based on the mouse click effect and uses the same
      rendering code (this could be improved by merging them better).
      Unlike mouse click there is no keyboard shortcut needed to activate:
      as soon as the effect is loaded all touch points are visualized.
      The visualization creates an animated circle for each touch down
      position, motion and up position. The ids are tracked and each touch
      id gets the same color. The first ten different touch ids get a
      different color. As touch ids are stable the first finger will always
      have the same color.
      Reviewers: #kwin, #plasma_on_wayland, bshah
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2464
    • Martin Flöser's avatar
      Fix crash when unminizing a ShellClient · a4af2420
      Martin Flöser authored
      On unminize we should not call windowHidden, but windowShown.
      Reviewed-By: bshah
    • Martin Flöser's avatar
      Translate Qt key events through the unicode text with xkbcommon · 9581f23e
      Martin Flöser authored
      KKeyServer does an incorrect translation to keysyms: it always
      translates to the uppercase variant.
      This change makes the default go through xkbcommon and tries to get
      the keysym from matching the unicode representation. E.g. an "a" is
      then recognized as the lower case a, and an "A" as the uppercase one.
      Only if the translation through text fails we pass back to KKeyServer
      which does a reasonable translation for non-text symbols.
      Reviewers: #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2471
    • Martin Flöser's avatar
      Introduce env variable KWIN_XKB_DEFAULT_KEYMAP to force default layout creation · ea22b8f1
      Martin Flöser authored
      The Xkb class loads keyboard layouts from the users configuration. This
      makes tests fail locally if the user has a layout which behaves
      differently to the one the test expects. E.g. on a German layout the
      right alt key is different to the one of US layout.
      In order to have a more stable test base the env variable
      KWIN_XKB_DEFAULT_KEYMAP forces the loading of the default keymap, thus
      tests have a common layout set.
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2466