1. 24 Sep, 2019 3 commits
    • Vlad Zahorodnii's avatar
      Mark Toplevel as not ready for painting by default · 64feafc1
      Vlad Zahorodnii authored
      Summary:
      Get rid of some duplication as InternalClient, XdgShellClient, Unmanaged,
      and Client initialize ready_for_painting to false.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D24189
      64feafc1
    • Vlad Zahorodnii's avatar
      Cleanup XdgShellClient header · f67db3a9
      Vlad Zahorodnii authored
      Don't put method definitions in the header file of XdgShellClient class
      as it makes the code visually inconsistent. InternalClient is a good
      example of how the header file of a subclass of AbstractClient class
      should look like.
      
      This change also cleans up the order of things in the header file, thus
      making it a bit more obvious where new things should go.
      f67db3a9
    • Vlad Zahorodnii's avatar
      Delete unused include · 1571fb5b
      Vlad Zahorodnii authored
      1571fb5b
  2. 23 Sep, 2019 3 commits
    • Vlad Zahorodnii's avatar
      Rename ShellClient to XdgShellClient · 168ea988
      Vlad Zahorodnii authored
      Summary:
      Rename ShellClient to XdgShellClient in order to reflect that it
      represents only xdg-shell clients.
      
      Test Plan: Compiles, tests still pass.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23589
      168ea988
    • Vlad Zahorodnii's avatar
      [wayland] Drop wl-shell support · 7a5447bd
      Vlad Zahorodnii authored
      Summary: wl-shell is deprecated, and pretty much no one uses it.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23562
      7a5447bd
    • Vlad Zahorodnii's avatar
      Port QPA away from Wayland · bebe8120
      Vlad Zahorodnii authored
      Summary:
      So far wayland was used by internal clients to submit raster buffers
      and position themselves on the screen. While we didn't have issues with
      submitting raster buffers, there were some problems with positioning
      task switchers. Mostly, because we had effectively two paths that may
      alter geometry.
      
      A better approach to deal with internal clients is to let our QPA use
      kwin core api directly. This way we can eliminate unnecessary roundtrips
      as well make geometry handling much easier and comprehensible.
      
      The last missing piece is shadows. Both Plasma::Dialog and Breeze widget
      style use platform-specific APIs to set and unset shadows. We need to
      add shadows API to KWindowSystem. Even though some internal clients lack
      drop-shadows at the moment, I don't consider it to be a blocker. We can
      add shadows back later on.
      
      CCBUG: 386304
      
      Reviewers: #kwin, davidedmundson, romangg
      
      Reviewed By: #kwin, romangg
      
      Subscribers: romangg, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T9600
      
      Differential Revision: https://phabricator.kde.org/D22810
      bebe8120
  3. 16 Sep, 2019 1 commit
  4. 14 Sep, 2019 1 commit
  5. 10 Sep, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Destroy ShellClient before Workspace is gone · 45c93c6c
      Vlad Zahorodnii authored
      Summary:
      Managing lifetime of objects during tear down is a bit clunky in KWin
      mostly because the wayland server outlives the workspace.
      
      3f4e7334 tried to tackle one aspect of this problem, but the proposed
      solution is good only in short term. If a ShellClient wants to discard
      force temporarily rules, it needs to access RuleBook, whose lifetime is
      bounded to the workspace, no matter what happens. Otherwise, the force
      temporarily rule will be applied again on the next startup.
      
      It's worth to mention that there was another attempt to address this
      problem, see commit 826b9742. It was reverted because some internal
      clients may need to destroy Wayland resources during tear down.
      
      This change takes another approach. In order to ensure that ShellClient
      can access RuleBook during tear down, we manually destroy Wayland clients
      in destructor of the Workspace class. Something is done already for X11
      clients.
      
      Reviewers: #kwin
      
      Subscribers: romangg, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22986
      45c93c6c
  6. 07 Sep, 2019 1 commit
  7. 10 Aug, 2019 1 commit
    • Vlad Zahorodnii's avatar
      refactor: Minimize use of geom in Toplevel subclasses · 744e2be3
      Vlad Zahorodnii authored
      Summary:
      This change makes easier to refactor geometry handling in the future.
      The main motivation for avoiding using geom directly is to make code
      more readable and ensure that the geometry is updated only through
      designated methods, e.g. setGeometry, plainResize, etc.
      
      Reviewers: #kwin, romangg
      
      Reviewed By: #kwin, romangg
      
      Subscribers: romangg, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23072
      744e2be3
  8. 07 Aug, 2019 1 commit
  9. 31 Jul, 2019 1 commit
    • Vlad Zahorodnii's avatar
      wayland: Terminate client connections before Workspace is destroyed · 826b9742
      Vlad Zahorodnii authored
      Summary:
      When ShellClient tears down, it needs to access RuleBook in order to
      discard temporary rules. The problem is that WaylandServer outlives
      Workspace and therefore so does ShellClient.
      
      We can't guard against the case when RuleBook::self() is nullptr as it
      is vital to discard temporary rules.
      
      This change adjusts termination sequence so all shell clients are
      destroyed before Workspace(and thus RuleBook) is gone.
      
      ASAN output:
          ==19922==ERROR: AddressSanitizer: heap-use-after-free on address 0x606000142060 at pc 0x7fbc0fb878bb bp 0x7ffd7d464520 sp 0x7ffd7d464518
          READ of size 8 at 0x606000142060 thread T0
              #0 0x7fbc0fb878ba in QList<KWin::Rules*>::detach() /usr/include/qt5/QtCore/qlist.h:172
              #1 0x7fbc0fb8538d in QList<KWin::Rules*>::begin() /usr/include/qt5/QtCore/qlist.h:324
              #2 0x7fbc0fb808b6 in KWin::RuleBook::discardUsed(KWin::AbstractClient*, bool) /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/rules.cpp:1144
              #3 0x7fbc0fe36e32 in KWin::ShellClient::destroyClient() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/shell_client.cpp:435
              #4 0x7fbc0fe7a726 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KWin::ShellClient::*)()>::call(void (KWin::ShellClient::*)(), KWin::ShellClient*, void**) /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
              #5 0x7fbc0fe784c3 in void QtPrivate::FunctionPointer<void (KWin::ShellClient::*)()>::call<QtPrivate::List<>, void>(void (KWin::ShellClient::*)(), KWin::ShellClient*, void**) /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
              #6 0x7fbc0fe74de9 in QtPrivate::QSlotObject<void (KWin::ShellClient::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (/home/jenkins/install-prefix/lib64/libkwin.so.5+0x1677de9)
              #7 0x7fbc04f27357 in QMetaObject::activate(QObject*, int, int, void**) (/usr/lib64/libQt5Core.so.5+0x2b3357)
              #8 0x7fbc074e1970 in KWayland::Server::Resource::unbound() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/build/src/server/KF5WaylandServer_autogen/EWIEGA46WW/moc_resource.cpp:142
              #9 0x7fbc0766b4b4 in KWayland::Server::Resource::Private::unbind(wl_resource*) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/resource.cpp:68
              #10 0x7fbc00bdc2ae  (/usr/lib64/libwayland-server.so.0+0x92ae)
              #11 0x7fbc00bdc32f in wl_resource_destroy (/usr/lib64/libwayland-server.so.0+0x932f)
              #12 0x7fbc0766b53f in KWayland::Server::Resource::Private::resourceDestroyedCallback(wl_client*, wl_resource*) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/resource.cpp:76
              #13 0x7fbbff481d8c  (/usr/lib64/libffi.so.7+0x6d8c)
              #14 0x7fbbff481179  (/usr/lib64/libffi.so.7+0x6179)
              #15 0x7fbc00bdfa5f  (/usr/lib64/libwayland-server.so.0+0xca5f)
              #16 0x7fbc00bdc6d1  (/usr/lib64/libwayland-server.so.0+0x96d1)
              #17 0x7fbc00bddc71 in wl_event_loop_dispatch (/usr/lib64/libwayland-server.so.0+0xac71)
              #18 0x7fbc07541e50 in KWayland::Server::Display::Private::dispatch() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/display.cpp:148
              #19 0x7fbc075432de in KWayland::Server::Display::dispatchEvents(int) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/display.cpp:220
              #20 0x7fbc0fe864ca in KWin::WaylandServer::dispatch() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/wayland_server.cpp:616
              #21 0x451ce0 in KWin::WaylandTestApplication::~WaylandTestApplication() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/autotests/integration/kwin_wayland_test.cpp:91
              #22 0x42faa1 in main /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/autotests/integration/globalshortcuts_test.cpp:381
              #23 0x7fbc04796bca in __libc_start_main (/lib64/libc.so.6+0x26bca)
              #24 0x413ea9 in _start (/home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/build/bin/testGlobalShortcuts+0x413ea9)
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22821
      826b9742
  10. 29 Jul, 2019 5 commits
    • Vlad Zahorodnii's avatar
      autotests: Fix zero page access · 0a693ce7
      Vlad Zahorodnii authored
      Relevant output:
      
      ==18647==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000048 (pc 0x7fbe27fb2db7 bp 0x7ffdcb6d4030 sp 0x7ffdcb6d4020 T0)
      ==18647==The signal is caused by a READ memory access.
      ==18647==Hint: address points to the zero page.
          #0 0x7fbe27fb2db6 in KWin::TabBox::TabBox::isDisplayed() const /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/tabbox/tabbox.h:231
          #1 0x7fbe286dbb85 in KWin::ShellClient::destroyClient() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/shell_client.cpp:421
          #2 0x7fbe2871f6a2 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KWin::ShellClient::*)()>::call(void (KWin::ShellClient::*)(), KWin::ShellClient*, void**) /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
          #3 0x7fbe2871d43f in void QtPrivate::FunctionPointer<void (KWin::ShellClient::*)()>::call<QtPrivate::List<>, void>(void (KWin::ShellClient::*)(), KWin::ShellClient*, void**) /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
          #4 0x7fbe28719d65 in QtPrivate::QSlotObject<void (KWin::ShellClient::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (/home/jenkins/install-prefix/lib64/libkwin.so.5+0x1677d65)
          #5 0x7fbe1d7cc357 in QMetaObject::activate(QObject*, int, int, void**) (/usr/lib64/libQt5Core.so.5+0x2b3357)
          #6 0x7fbe1fd86970 in KWayland::Server::Resource::unbound() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/build/src/server/KF5WaylandServer_autogen/EWIEGA46WW/moc_resource.cpp:142
          #7 0x7fbe1ff104b4 in KWayland::Server::Resource::Private::unbind(wl_resource*) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/resource.cpp:68
          #8 0x7fbe194812ae  (/usr/lib64/libwayland-server.so.0+0x92ae)
          #9 0x7fbe1948132f in wl_resource_destroy (/usr/lib64/libwayland-server.so.0+0x932f)
          #10 0x7fbe1ff1053f in KWayland::Server::Resource::Private::resourceDestroyedCallback(wl_client*, wl_resource*) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/resource.cpp:76
          #11 0x7fbe17d26d8c  (/usr/lib64/libffi.so.7+0x6d8c)
          #12 0x7fbe17d26179  (/usr/lib64/libffi.so.7+0x6179)
          #13 0x7fbe19484a5f  (/usr/lib64/libwayland-server.so.0+0xca5f)
          #14 0x7fbe194816d1  (/usr/lib64/libwayland-server.so.0+0x96d1)
          #15 0x7fbe19482c71 in wl_event_loop_dispatch (/usr/lib64/libwayland-server.so.0+0xac71)
          #16 0x7fbe1fde6e50 in KWayland::Server::Display::Private::dispatch() /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/display.cpp:148
          #17 0x7fbe1fde82de in KWayland::Server::Display::dispatchEvents(int) /home/jenkins/workspace/Administration/Dependency Build Plasma kf5-qt5 SUSEQt5.12/kwayland/src/server/display.cpp:220
          #18 0x7fbe2872b446 in KWin::WaylandServer::dispatch() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/wayland_server.cpp:616
          #19 0x457e08 in KWin::WaylandTestApplication::~WaylandTestApplication() /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/autotests/integration/kwin_wayland_test.cpp:91
          #20 0x43500b in main /home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/autotests/integration/debug_console_test.cpp:530
          #21 0x7fbe1d03bbca in __libc_start_main (/lib64/libc.so.6+0x26bca)
          #22 0x414ed9 in _start (/home/jenkins/workspace/Plasma/kwin/kf5-qt5 SUSEQt5.12/build/bin/testDebugConsole+0x414ed9)
      0a693ce7
    • Vlad Zahorodnii's avatar
      Drop unused includes · f57f5831
      Vlad Zahorodnii authored
      f57f5831
    • Vlad Zahorodnii's avatar
      [wayland] Update tabbox when a client is added or closed · b3bd9e7e
      Vlad Zahorodnii authored
      Summary: Update tabbox similar to how it's done in KWin/X11.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D21005
      b3bd9e7e
    • Vlad Zahorodnii's avatar
      [wayland] Implement maximize rules · 702a4ff6
      Vlad Zahorodnii authored
      Summary:
      There is still one small issue that has to be addressed in the future:
      xdg-toplevel doesn't have states like MAXIMIZED_VERT or MAXIMIZED_HORZ,
      thus Window Rules KCM should display only single maximize rule(not two)
      for wayland clients.
      
      Test Plan: The new tests pass.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19414
      702a4ff6
    • Vlad Zahorodnii's avatar
      [wayland] Implement size and position window rules · bbe89824
      Vlad Zahorodnii authored
      Test Plan: The new tests pass.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19413
      bbe89824
  11. 09 Jul, 2019 4 commits
    • Vlad Zahorodnii's avatar
      Port away from deprecated headers · c7639fd7
      Vlad Zahorodnii authored
      Summary: Headers like stdio.h are deprecated in C++.
      
      Test Plan:
      Compiles.
      
      clangd no longer spews these warnings
      
      {F6997789, size=full}
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22351
      c7639fd7
    • Vlad Zahorodnii's avatar
      [wayland] Make clients with forced minimize state unminimizeable · 6f7bea3a
      Vlad Zahorodnii authored
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: fmonteiro, graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18496
      6f7bea3a
    • Vlad Zahorodnii's avatar
      [wayland] Discard Force Temporarily rules for shell clients · 99abfe4e
      Vlad Zahorodnii authored
      Summary:
      Force Temporarily rules have to be discarded when a client is unmapped.
      Otherwise there won't be a difference between Force and Force
      Temporarily rules.
      
      Reviewers: #kwin
      
      Subscribers: graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18494
      99abfe4e
    • Vlad Zahorodnii's avatar
      [wayland] Apply window rules only to xdg-shell clients · 18844f59
      Vlad Zahorodnii authored
      Summary:
      There are rules that have to be applied only once, e.g. every Remember
      and Apply Initially rule, as well rules that need to configure the client,
      e.g. size, etc. In the best scenario the compositor would evaluate such
      rules when the client is about to be mapped.
      
      This change limits window rules only to xdg-shell clients because right
      now only this protocol lets compositors to intervene in the client
      initialization process. Also, it makes things a bit easier for us on the
      compositor side.
      
      xdg-shell protocol satisfies most of ours requirements to implement window
      rules, but not all of them. If the client is about to be mapped for the
      second time and its size is forced by a rule, then compositor may need
      to configure it. Currently, xdg-shell protocol doesn't have any mechanism
      that a client could use to notify the compositor about its intent to map.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: fmonteiro, davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19411
      18844f59
  12. 08 Jul, 2019 2 commits
    • Roman Gilg's avatar
      Rework ShellClient fullscreen control · 1347610b
      Roman Gilg authored
      Summary:
      The ShellClient::setFullScreen method was a direct copy of the Client
      version.
      
      Straighten out the function logic now and align with modern coding style.
      
      In short we check:
      1. what the manual override window rule wants,
      2. if there is a change at all with this,
      3. if such a change is possible.
      And do:
      4. (un-)set the fullscreen,
      5. emit the changed signal.
      
      Test Plan: Manually, autotests pass.
      
      Reviewers: #kwin
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T11098
      
      Differential Revision: https://phabricator.kde.org/D18132
      1347610b
    • Vlad Zahorodnii's avatar
      Fix maximize Apply Now rule · 0a9c2547
      Vlad Zahorodnii authored
      Summary:
      AbstractClient applies maximize rules by running
      
          maximize(maximizeMode());
      
      but because window rules are checked only in changeMaximize
      implementation, the if statement prevents us from applying maximize
      rules (m and maximizeMode() are equal).
      
      Reviewers: #kwin, romangg
      
      Reviewed By: #kwin, romangg
      
      Subscribers: romangg, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22255
      0a9c2547
  13. 06 Jul, 2019 1 commit
  14. 22 Jun, 2019 1 commit
  15. 05 Jun, 2019 1 commit
  16. 17 May, 2019 2 commits
  17. 10 May, 2019 2 commits
    • David Edmundson's avatar
      Revert "Handle XdgShell window geometry in configure request sizes" · 24cbe486
      David Edmundson authored
      This reverts commit bc83065c.
      
      Turns out the relevant wayland code wasn't merged. This will have to
      wait till next plasma for a fix.
      24cbe486
    • David Edmundson's avatar
      Handle XdgShell window geometry in configure request sizes · bc83065c
      David Edmundson authored
      Summary:
      The size passed to an XDG shell configure request should match the
      window size of the given window, we don't want to include the size of
      any shadows that may be drawn by the client.
      
      Kwin has the same concept of geometry for both window management, input
      and rendering.
      
      In order to approach this in a way that does not risk any regressions
      with kwin's current structure AbstractClient::geometry remains the
      canonical source and we handle the window within that internally within
      ShellClient treating the windowGeometry as a set of margins from this.
      
      This is part of a much bigger task (T10867). This patch addresses
      windows growing when starting a drag based resize.
      
      BUG: 403376
      
      Test Plan:
      Unit test
      gtk3-demo
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D20937
      bc83065c
  18. 02 May, 2019 1 commit
  19. 09 Apr, 2019 3 commits
    • David Edmundson's avatar
      [wayland] Place all toplevels before the first configure · efc62941
      David Edmundson authored
      Summary:
      Currently popups get positioned once at the initial configure, to set
      the correct size and again when they are mapped.
      
      Toplevels are currently only positioned when they are mapped. This works
      for all cases where the the toplevel defines its own size, but not if
      the window should have an initial size set by the placement strategy or
      window rules. Most notably the maximised placement strategy used on
      plasma mobile.
      
      Being out of sync and resizing later currently causes a positioning bug
      when plasma mobile is used with XdgShell.
      
      This patch repositions all top levels that don't have a position set
      through the plasma interface.
      
      Test Plan: Relevant unit test
      
      Reviewers: #kwin, bshah
      
      Reviewed By: bshah
      
      Subscribers: zzag, bshah, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D20241
      efc62941
    • David Edmundson's avatar
      [wayland] Queue XDG configure requests when resizing toplevel interactively · 985601e0
      David Edmundson authored
      Summary:
      When resizing a window particularly from the left side, we need to
      co-ordinate moving the window with when we get the resized buffer.
      
      The code in AbstractClient::handleMoveResize checks
      isWaitingForResizSync to make sure we never send more than one resize
      request at a time to keep that in sync.
      
      This makes sense on X and wl_shell_surface, but not on XDGShell where we
      can track which resize events have been handled by the client.
      
      ShellClient already keeps a stack of our pending configure requests and
      handles everything appropriately, we don't need to block.
      
      This results in a smoother dragging experience and avoids a potential
      deadlock currently seen when a client may not reply to a no-op configure
      request.
      
      CCBUG: 403376
      
      Test Plan: Async ack handling is covered by existing unit tests
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D20397
      985601e0
    • Vlad Zahorodnii's avatar
      [wayland] Finish active move-resize op when client is destroyed or unmapped · f10760d8
      Vlad Zahorodnii authored
      Summary:
      It might happen that the moving client gets closed or crashes. In that
      case, we have to manually reset Workspace::movingClient, otherwise KWin
      will most likely crash later on.
      
      BUG: 405379
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19708
      f10760d8
  20. 01 Apr, 2019 1 commit
  21. 15 Mar, 2019 1 commit
  22. 04 Mar, 2019 1 commit
    • Vlad Zahorodnii's avatar
      [wayland] Implement belongsToDesktop check · 297557bd
      Vlad Zahorodnii authored
      Summary:
      When user asks KWin to show desktop, the compositor just raises every
      desktop window, it doesn't attempt to minimize normal clients, etc.
      Because desktop windows contain stuff like background and icons, the
      compositor has to raise all clients that are somehow correlated with
      desktop (e.g. panels, etc). Otherwise it would pretty weird to show only
      desktop background.
      
      Currently, not all plasmashell's clients are raised when the compositor
      shows desktop because belongsToDesktop is not implemented for ShellClient.
      
      BUG: 404801
      
      Test Plan:
      * Show desktop;
      * Open Kickoff (without this patch Kickoff is not visible).
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19386
      297557bd
  23. 26 Feb, 2019 2 commits
    • David Edmundson's avatar
      [wayland] Finish initialising ShellClient only when commited to the surface · 2bad2b48
      David Edmundson authored
      Summary:
      Everything on the wl_surface is double buffered.
      
      When we create an XdgShell toplevel or popup we shouldn't treat it as
      attached until it's committed to the surface.
      
      A client should commit the surface after it's sent it's initial state of
      the Xdg topLevel; minimumSize, title, app_id, etc.
      
      By blocking sending configure events we will have flushed the correct
      initial state before sending a single atomic correct event to the
      client. It also adds a hook to re-evaluate rules now that all properties
      are set.
      
      Arguably this applies to WlShellSurface too, but I've left it unchanged
      as it's deprecated and hard to verify real client behaviour.
      
      Test Plan: Ran all unit tests
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18583
      2bad2b48
    • David Edmundson's avatar
      [wayland] Squash reconfigure methods · 56fb507a
      David Edmundson authored
      Summary:
      We can handle the case of a null size inside
      ShellClient::requestGeometry and that makes that method more robust.
      
      With that we don't need to handle separate code paths in
      the handler of RequestGeometryBlocker.
      
      It's not an exact identical code path, but everything still works out.
      
      If the geometry is unchanged, we'll save the positionAfterResize  but
      when we apply it doSetGeometry will no-op.
      
      There's also an assumption that toggling maximised will always send a
      valid size, but that's true for the current state.
      
      Test Plan: Ran unit tests
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19331
      56fb507a