D7712: Delay syncing internal window geometry to end of cycle

Martin Flöser noreply at phabricator.kde.org
Wed Sep 6 19:04:41 UTC 2017


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

REVISION 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.

REPOSITORY
  R108 KWin

BRANCH
  delay-internal-geometry-sync

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

AFFECTED FILES
  shell_client.cpp

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


More information about the Plasma-devel mailing list