<table><tr><td style="">zzag added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D27338">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160726">View Inline</a><span style="color: #4b4d51; font-weight: bold;">display.cpp:49</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #304a96">#include</span> <span class="cpf">"inputmethod_interface.h"</span><span style="color: #304a96"></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Stray new line. Please remove it.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160723">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.cpp:25</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #aa4000">class</span> <span style="color: #00702a">InputMethodContextInterface</span><span style="color: #aa2211">::</span><span style="color: #a0a000">Private</span> <span class="p">:</span> <span style="color: #aa4000">public</span> <span class="n">QtWaylandServer</span><span style="color: #aa2211">::</span><span class="n">zwp_input_method_context_v1</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Add Q_DECL_HIDDEN.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160716">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.cpp:125</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">void</span> <span class="n">zwp_input_method_context_v1_destroy</span><span class="p">(</span><span class="n">QtWaylandServer</span><span style="color: #aa2211">::</span><span class="n">zwp_input_method_context_v1</span><span style="color: #aa2211">::</span><span class="n">Resource</span> <span style="color: #aa2211">*</span><span class="n">resource</span><span class="p">)</span> <span style="color: #aa4000">override</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">In the destructor request, we need to destroy the wl_resource with <tt style="background: #ebebeb; font-size: 13px;">wl_resource_destroy()</tt>. When the resource is destroyed and it isn't inert, destroy <tt style="background: #ebebeb; font-size: 13px;">q</tt>.</p>

<hr class="remarkup-hr" />

<p style="padding: 0; margin: 8px;">We probably need to destroy the wl_resource resource here.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="cpp" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span class="n">wl_resource_destroy</span><span class="p">(</span><span class="n">resource</span><span style="color: #aa2211">-></span><span class="n">handle</span><span class="p">);</span></pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160724">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.cpp:145-146</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">for</span> <span class="p">(</span><span style="color: #aa4000">auto</span> <span style="color: #a0a000">r</span> <span class="p">:</span> <span class="n">d</span><span style="color: #aa2211">-></span><span class="n">resourceMap</span><span class="p">())</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">d</span><span style="color: #aa2211">-></span><span class="n">send_commit_state</span><span class="p">(</span><span class="n">r</span><span style="color: #aa2211">-></span><span class="n">handle</span><span class="p">,</span> <span class="n">serial</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I also prefer not to put braces around for's and if's when the body contains only one statement. Code looks more compact; but we follow the Frameworks coding style and should put braces even if it's a single statement.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160717">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.cpp:179</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #aa4000">class</span> <span style="color: #00702a">InputPanelSurfaceInterface</span><span style="color: #aa2211">::</span><span style="color: #a0a000">Private</span> <span class="p">:</span> <span style="color: #aa4000">public</span> <span class="n">QtWaylandServer</span><span style="color: #aa2211">::</span><span class="n">zwp_input_panel_surface_v1</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Shouldn't <tt style="background: #ebebeb; font-size: 13px;">InputPanelSurfaceInterface</tt> be also a subclass of <tt style="background: #ebebeb; font-size: 13px;">SurfaceRole</tt>?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160718">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.cpp:199-200</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">InputPanelSurfaceInterface</span> <span style="color: #aa2211">*</span><span style="color: #aa4000">const</span> <span class="n">q</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="n">QPointer</span><span style="color: #aa2211"><</span><span class="n">SurfaceInterface</span><span style="color: #aa2211">></span> <span class="n">m_surface</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">bool</span> <span class="n">m_overlay</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">false</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="p">};</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Naming nitpick: in <tt style="background: #ebebeb; font-size: 13px;">FooPrivate</tt> classes, we avoid putting <tt style="background: #ebebeb; font-size: 13px;">m_</tt>.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160721">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.cpp:220</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">void</span> <span class="n">zwp_input_panel_v1_get_input_panel_surface</span><span class="p">(</span><span class="n">Resource</span> <span style="color: #aa2211">*</span><span class="n">resource</span><span class="p">,</span> <span style="color: #aa4000">uint32_t</span> <span class="n">id</span><span class="p">,</span> <span style="color: #aa4000">struct</span> <span style="color: #aa2211">::</span><span class="n">wl_resource</span> <span style="color: #aa2211">*</span><span class="n">surface</span><span class="p">)</span> <span style="color: #aa4000">override</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Naming nitpick: it would be nice to avoid names such as <tt style="background: #ebebeb; font-size: 13px;">surfaceIface</tt> or <tt style="background: #ebebeb; font-size: 13px;">surfaceInterface</tt>. I would like to highlight that <tt style="background: #ebebeb; font-size: 13px;">surfaceIface</tt> is a bad name according to the Frameworks coding style.</p>

<p style="padding: 0; margin: 8px;">Suggestion: rename <tt style="background: #ebebeb; font-size: 13px;">surface</tt> to <tt style="background: #ebebeb; font-size: 13px;">surfaceResource</tt> and then do <tt style="background: #ebebeb; font-size: 13px;">auto surface = SurfaceInterface::get(surfaceResource);</tt>.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160722">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.cpp:224</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: #aa4000">auto</span> <span class="n">ipsi</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">new</span> <span class="n">InputPanelSurfaceInterface</span><span class="p">(</span><span style="color: #aa4000">nullptr</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span class="n">ipsi</span><span style="color: #aa2211">-></span><span class="n">d</span><span style="color: #aa2211">-></span><span class="n">init</span><span class="p">(</span><span class="n">resource</span><span style="color: #aa2211">-></span><span class="n">client</span><span class="p">(),</span> <span class="n">id</span><span class="p">,</span> <span class="n">resource</span><span style="color: #aa2211">-></span><span class="n">version</span><span class="p">());</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">No abbreviations.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160732">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.h:13</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #304a96">#include</span> <span class="cpf">"resource.h"</span><span style="color: #304a96"></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Do we actually need it?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D27338#inline-160730">View Inline</a><span style="color: #4b4d51; font-weight: bold;">inputmethod_interface.h:102</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #a0a000">Q_SIGNALS</span><span class="p">:</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #aa4000">void</span> <span class="n">inputPanelSurfaceAdded</span><span class="p">(</span><span class="n">quint32</span> <span class="n">id</span><span class="p">,</span> <span class="n">InputPanelSurfaceInterface</span> <span style="color: #aa2211">*</span><span class="n">surface</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">API design nitpick: it would be nice to have a signal with only parameter - InputPanelSurfaceInterface *surface. Is there a reason why InputPanelSurfaceInterface can't have an id getter?</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R127 KWayland</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27338">https://phabricator.kde.org/D27338</a></div></div><br /><div><strong>To: </strong>apol, KWin, Frameworks<br /><strong>Cc: </strong>zzag, kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns<br /></div>