D6852: Reset last_active_client when a ShellClient is removed

2017-07-23 Thread Martin Flöser
This revision was automatically updated to reflect the committed changes.
Closed by commit R108:bd158a632100: Reset last_active_client when a ShellClient 
is removed (authored by graesslin).

REPOSITORY
  R108 KWin

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D6852?vs=17060=17061

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

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

To: graesslin, #kwin, #plasma, davidedmundson
Cc: davidedmundson, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas


D6852: Reset last_active_client when a ShellClient is removed

2017-07-23 Thread Martin Flöser
graesslin added a comment.


  In https://phabricator.kde.org/D6852#127904, @davidedmundson wrote:
  
  > there's 3 other differences between removeClient that I think should also 
be here:
  
  
  yep I know, guess what I will work on next ;-)
  
  should_get_focus is btw. currently not yet a problem as a ShellClient never 
gets added to that list.

REPOSITORY
  R108 KWin

BRANCH
  fix-last-active-client-wayland

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

To: graesslin, #kwin, #plasma, davidedmundson
Cc: davidedmundson, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas


D6852: Reset last_active_client when a ShellClient is removed

2017-07-23 Thread David Edmundson
davidedmundson accepted this revision.
davidedmundson added a comment.
This revision is now accepted and ready to land.


  there's 3 other differences between removeClient that I think should also be 
here:
  
  ---
  
should_get_focus.removeAll(c);
  
  (this looks like it could lead to a similar crash)
  
  ---
  
if (c == most_recently_raised)
most_recently_raised = 0;
  
  ---
  
  #ifdef KWIN_BUILD_TABBOX
  
if (tabBox->isDisplayed())
tabBox->reset(true);
  
  #endif

REPOSITORY
  R108 KWin

BRANCH
  fix-last-active-client-wayland

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

To: graesslin, #kwin, #plasma, davidedmundson
Cc: davidedmundson, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas


D6852: Reset last_active_client when a ShellClient is removed

2017-07-23 Thread Martin Flöser
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