<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/128567/">https://git.reviewboard.kde.org/r/128567/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Frameworks.</div>
<div>By Martin Gräßlin.</div>










<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kwindowsystem
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">A common pattern for our applications which have to do platform specific
tasks is to query the used platform with code like:
if (QX11Info::isPlatformX11()) {
    // do X11 specific stuff
} else if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"))) {
    // do Wayland specific stuff
}

The problem with that is that it involves string comparisons and is easy
to get wrong. E.g. for X11 one should use the QX11Info helper, for
Wayland one has to compare with startsWith. There is lot of domain
specific knowledge going into it to make it work correctly and in an
efficient way.

This change introduces an enum based API which encapsulates the
knowledge: it does the proper comparisons and caches the result, so
that one does not need to do string comparisons again and again.

So far the implementation supports the platforms X11/XCB and Wayland.
In addition there are convenient methods to check for a specific
platform modelled after QX11Info::isPlatformX11.

Further platforms can be added by the maintainers of the respective
platforms.</pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>autotests/CMakeLists.txt <span style="color: grey">(65ed8d4da50fd41dd3060576284456c83c3629ab)</span></li>

 <li>autotests/helper/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>

 <li>autotests/helper/wayland_platform.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>autotests/kwindowsystem_platform_wayland_test.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>autotests/kwindowsystemx11test.cpp <span style="color: grey">(cdf94e3f6573faea6dfd6038dded3ee1269e2552)</span></li>

 <li>src/kwindowsystem.h <span style="color: grey">(551b01f5831e2fbdf0d0ad30f3debf0955da189e)</span></li>

 <li>src/kwindowsystem.cpp <span style="color: grey">(4dfcce8bbfeed09f3f6ddec10a1eb5fd2d418313)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/128567/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>



  </div>
 </body>
</html>