D6852: Reset last_active_client when a ShellClient is removed

Martin Flöser noreply at phabricator.kde.org
Sun Jul 23 14:21:44 UTC 2017


graesslin created this revision.
Restricted Application added a project: KWin.
Restricted Application added subscribers: kwin, plasma-devel.

REVISION SUMMARY
  The last_active_client is set when an AbstractClient gets activated. For
  the X11 case the last_active_client was getting reset to nullptr when
  the last_active_client gets destroyed. But for the ShellClient that did
  not yet happen. This could result in a crash.
  
  This change addresses the problem and adds a test case which triggered
  the crash. The condition of the crash are difficult to generate though -
  it took me about an hour to write the test for the crash.
  
  1. Wayland client must be active
  2. Explicit focus to null (no active client)
  3. destroy Wayland window
  4. X11 client which sets focus on itself without interaction with window manager

TEST PLAN
  test case no longer crashes

REPOSITORY
  R108 KWin

BRANCH
  fix-last-active-client-wayland

REVISION DETAIL
  https://phabricator.kde.org/D6852

AFFECTED FILES
  autotests/integration/x11_client_test.cpp
  workspace.cpp

To: graesslin, #kwin, #plasma
Cc: plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170723/2edf8c92/attachment.html>


More information about the Plasma-devel mailing list