[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    D7521: [WIP] make use of foreign protocol
From:       Martin_Flöser <noreply () phabricator ! kde ! org>
Date:       2017-08-25 19:21:23
Message-ID: 20170825192115.50003.62C62AF0222E6492 () phabricator ! kde ! org
[Download RAW message or body]

graesslin added a comment.


  What I absolutely don't understand is why you want to make it modal. I don't see a \
reason for this to be modal and the X11 variant where this was used is not modal. \
E.g. kwallet is not modal, polkit is not modal and a file dialog through a flatpack \
portal should not be modal .  
  Furthermore our Wayland implementation does not even support any modal windows yet:
  
    AbstractClient *ShellClient::findModal(bool allow_itself)
    {
        Q_UNUSED(allow_itself)
        return nullptr;
    }

INLINE COMMENTS

> shell_client.h:64-66
> +    KWayland::Server::XdgShellSurfaceInterface *xdgShellSurface() const {
> +        return m_xdgShellSurface;
> +    }

I don't see this new method being used.

> wayland_server.cpp:166-173
> +        if (findClient(parent) == client) {
> +            if (childClient && client && client->surface() == parent) {
> +                childClient->setModal(true);
> +            }
> +        //we are the child, just manage parent lost in this case
> +        } else if (childClient == client && !parent) {
> +            childClient->setModal(false);

why the setModal? Why should a foreign transient be modal?

> wayland_server.cpp:174
> +        }
> +        emit foreignTransientChanged(child, parent);
> +    });

as an alternative feel free to make ShellClient::setTransient public (it's only \
private because nothing used it so far) and do:

   if (childClient && childClient->surface() == child) {
      childClient->setTransient();
  }

> wayland_server.h:198
> void initialized();
> +    void foreignTransientChanged(KWayland::Server::SurfaceInterface *child, \
> KWayland::Server::SurfaceInterface *parent); 

why add the parent if it's never used?

REPOSITORY
  R108 KWin

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

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


[Attachment #3 (unknown)]

<table><tr><td style="">graesslin added a comment.
</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/D7521" rel="noreferrer">View \
Revision</a></tr></table><br /><div><div><p>What I absolutely don&#039;t understand \
is why you want to make it modal. I don&#039;t see a reason for this to be modal and \
the X11 variant where this was used is not modal. E.g. kwallet is not modal, polkit \
is not modal and a file dialog through a flatpack portal should not be modal .</p>

<p>Furthermore our Wayland implementation does not even support any modal windows \
yet:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; padding: \
12px; margin: 0; background: rgba(71, 87, 120, 0.08);">AbstractClient \
*ShellClient::findModal(bool allow_itself) {
    Q_UNUSED(allow_itself)
    return nullptr;
}</pre></div></div></div><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/D7521#inline-30786" \
rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: \
bold;">shell_client.h:64-66</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, 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">KWayland</span><span style="color: #aa2211">::</span><span \
class="n">Server</span><span style="color: #aa2211">::</span><span \
class="n">XdgShellSurfaceInterface</span> <span style="color: #aa2211">*</span><span \
class="n">xdgShellSurface</span><span class="p">()</span> <span style="color: \
#aa4000">const</span> <span class="p">{</span> </div><div style="padding: 0 8px; \
margin: 0 4px; background: rgba(151, 234, 151, .6);">        <span style="color: \
#aa4000">return</span> <span class="n">m_xdgShellSurface</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 \
don&#039;t see this new method being used.</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/D7521#inline-30787" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">wayland_server.cpp:166-173</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, 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">if</span> <span class="p">(</span><span class="n">findClient</span><span \
class="p">(</span><span class="n">parent</span><span class="p">)</span> <span \
style="color: #aa2211">==</span> <span class="n">client</span><span \
class="p">)</span> <span class="p">{</span> </div><div style="padding: 0 8px; margin: \
0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: \
#aa4000">if</span> <span class="p">(</span><span class="n">childClient</span> <span \
style="color: #aa2211">&amp;&amp;</span> <span class="n">client</span> <span \
style="color: #aa2211">&amp;&amp;</span> <span class="n">client</span><span \
style="color: #aa2211">-&gt;</span><span class="n">surface</span><span \
class="p">()</span> <span style="color: #aa2211">==</span> <span \
class="n">parent</span><span class="p">)</span> <span class="p">{</span> </div><div \
style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">          \
<span class="n">childClient</span><span style="color: #aa2211">-&gt;</span><span \
class="n">setModal</span><span class="p">(</span><span style="color: \
#304a96">true</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 style="padding: 0 8px; margin: 0 4px; background: \
rgba(151, 234, 151, .6);">        <span style="color: #74777d">//we are the child, \
just manage parent lost in this case</span> </div><div style="padding: 0 8px; margin: \
0 4px; background: rgba(151, 234, 151, .6);">        <span class="p">}</span> <span \
style="color: #aa4000">else</span> <span style="color: #aa4000">if</span> <span \
class="p">(</span><span class="n">childClient</span> <span style="color: \
#aa2211">==</span> <span class="n">client</span> <span style="color: \
#aa2211">&amp;&amp;</span> <span style="color: #aa2211">!</span><span \
class="n">parent</span><span class="p">)</span> <span class="p">{</span> </div><div \
style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">          \
<span class="n">childClient</span><span style="color: #aa2211">-&gt;</span><span \
class="n">setModal</span><span class="p">(</span><span style="color: \
#304a96">false</span><span class="p">);</span> </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">why \
the setModal? Why should a foreign transient be modal?</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/D7521#inline-30789" rel="noreferrer">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">wayland_server.cpp:174</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, 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 class="n">emit</span> <span \
class="n">foreignTransientChanged</span><span class="p">(</span><span \
class="n">child</span><span class="p">,</span> <span class="n">parent</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;">as \
an alternative feel free to make ShellClient::setTransient public (it&#039;s only \
private because nothing used it so far) and do:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; padding: \
12px; margin: 0; background: rgba(71, 87, 120, 0.08);"> if (childClient &amp;&amp; \
childClient-&gt;surface() == child) {  childClient-&gt;setTransient();
}</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/D7521#inline-30788" \
rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: \
bold;">wayland_server.h:198</span></div> <div style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; white-space: \
pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; \
margin: 0 4px; ">    <span style="color: #aa4000">void</span> <span style="color: \
#004012">initialized</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 style="color: #004012">foreignTransientChanged</span><span \
class="p">(</span><span class="n">KWayland</span><span style="color: \
#aa2211">::</span><span class="n">Server</span><span style="color: \
#aa2211">::</span><span class="n">SurfaceInterface</span> <span style="color: \
#aa2211">*</span><span class="n">child</span><span class="p">,</span> <span \
class="n">KWayland</span><span style="color: #aa2211">::</span><span \
class="n">Server</span><span style="color: #aa2211">::</span><span \
class="n">SurfaceInterface</span> <span style="color: #aa2211">*</span><span \
class="n">parent</span><span class="p">);</span> </div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">why \
add the parent if it&#039;s never used?</p></div></div></div></div></div><br \
/><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br \
/><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D7521" \
rel="noreferrer">https://phabricator.kde.org/D7521</a></div></div><br \
/><div><strong>To: </strong>mart, Plasma, graesslin<br /><strong>Cc: \
</strong>graesslin, davidedmundson, plasma-devel, kwin, KWin, ZrenBot, progwolff, \
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, \
lukas<br /></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic