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

List:       kde-frameworks-devel
Subject:    Re: Review Request 115137: Provide information about the active screen in KWindowSystem
From:       Thomas_Lübking <thomas.luebking () gmail ! com>
Date:       2014-03-04 21:14:52
Message-ID: 20140304211452.4331.18695 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115137/#review51954
-----------------------------------------------------------



src/kwindowsystem_x11.cpp
<https://git.reviewboard.kde.org/r/115137/#comment36936>

    Brainstorm.
    Assuming this is of rare interest and we would want to limit X11 roundtrips and \
pointer tracking.  
    The WM could then simply set the strategy (mouse/active window) and \
::activeOutput() could check that to calculate the reult on request.  KWindowSystem \
could (on connect notify) track the mouse/active window to emit the signal.  This way \
tracking would only be required if/while some client is really interested.  
    Downside is that 2 or more clients could be tracking simultanously.
    Benefit would be that other WMs can adapt this very easily and we don't rely on \
XI2 support (what will probably also not work if the mouse is navigated by the \
keyboard?)



src/netwm.cpp
<https://git.reviewboard.kde.org/r/115137/#comment36930>

    The API says the parameter can be NULL, nstrdup will then return a casted nullptr \
and this will segfault. (Or I missed something?)


- Thomas Lübking


On Jan. 31, 2014, 1:01 p.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115137/
> -----------------------------------------------------------
> 
> (Updated Jan. 31, 2014, 1:01 p.m.)
> 
> 
> Review request for KDE Frameworks, kdewin and kwin.
> 
> 
> Repository: kwindowsystem
> 
> 
> Description
> -------
> 
> The rational for these changes is based on the discussion in \
> http://article.gmane.org/gmane.comp.kde.devel.plasma/27579/ 
> Plasma needs to know which is the active screen and so far only KWin knows it, so \
> we need to make everybody aware of it. 
> ---
> Add convenient wrapper for active screen to KWindowSystem
> 
> A method is added to get the identifier of the active screen as a
> QString and a signal whenever the active screen changes. This method
> is only provided for X11, on Windows and Mac a null QString is returned
> as the identifier.
> 
> Add an active screen property to NETRootInfo
> 
> The active screen is intended to be set by KWin to the active screen
> it's using. This can be used by a Client to manually position e.g.
> override redirect windows on the active screen. It's intended as a help
> for multi-screen setups where a Client can only do guesses on where to
> position e.g. a notification window.
> 
> It's a KDE specific extension as property _KDE_NET_ACTIVE_SCREEN and
> announced in the supported properties.
> 
> 
> Diffs
> -----
> 
> tests/activeoutputtest.cpp PRE-CREATION 
> tests/CMakeLists.txt ce68cc505a69ea9a3cf645e9ae587bd89abe1648 
> src/netwm_p.h 41792b330f7405034f4d51fb31a4de5dd674b6d0 
> src/netwm_def.h 8b1ccb8bd731aefb9559c8f2b450337b0312ed4d 
> src/netwm.cpp 84eb137492e0afaaac80e8d26561fd8f8aff9c27 
> src/netwm.h 393a29de3153a8b291b9fb249bd3eaeb1ba4e7d5 
> src/kwindowsystem_x11.cpp 01c78c1debf95d5a176e2153139da19abf383c41 
> src/kwindowsystem_win.cpp 96148b2d808396a3046204e55fd19d767db017c5 
> autotests/netrootinfotestwm.cpp 120fbee92d0b22862d8ce746b3b30891ecd9f056 
> src/kwindowsystem.h 3de0fea179dd468a78a265808fc64704027ec30d 
> src/kwindowsystem_mac.cpp 8bd2ac763fa26ba49e7733fc3ba93e755383928c 
> 
> Diff: https://git.reviewboard.kde.org/r/115137/diff/
> 
> 
> Testing
> -------
> 
> * wm part of NETWM is unit tested
> * KWindowSystem is only compile tested (unit testing is difficult as we need a \
> window manager which supports this property which is at the moment of this writing: \
>                 none)
> * Windows and Mac is not even compile tested, that's why kdewin is included in the \
> review. If you have the time for it, please do a compile test. 
> 
> Thanks,
> 
> Martin Gräßlin
> 
> 


[Attachment #5 (text/html)]

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











<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/115137/diff/3/?file=241111#file241111line256" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/kwindowsystem_x11.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool \
KWindowSystemPrivate::nativeEventFilter(xcb_generic_event_t *ev)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">256</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="n">emit</span> <span class="n">s_q</span><span \
class="o">-&gt;</span><span class="n">activeOutputChanged</span><span \
class="p">(</span><span class="n">QString</span><span class="o">::</span><span \
class="n">fromUtf8</span><span class="p">(</span><span \
class="n">activeOutput</span><span class="p">()));</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Brainstorm. \
Assuming this is of rare interest and we would want to limit X11 roundtrips and \
pointer tracking.

The WM could then simply set the strategy (mouse/active window) and ::activeOutput() \
could check that to calculate the reult on request. KWindowSystem could (on connect \
notify) track the mouse/active window to emit the signal. This way tracking would \
only be required if/while some client is really interested.

Downside is that 2 or more clients could be tracking simultanously.
Benefit would be that other WMs can adapt this very easily and we don&#39;t rely on \
XI2 support (what will probably also not work if the mouse is navigated by the \
keyboard?)</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/115137/diff/3/?file=241113#file241113line1931" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/netwm.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">1931</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">if</span> <span class="p">(</span><span class="n">p</span><span \
class="o">-&gt;</span><span class="n">active_output</span><span \
class="p">[</span><span class="mi">0</span><span class="p">]</span> <span \
class="o">!=</span> <span class="sc">&#39;\0&#39;</span><span class="p">)</span> \
<span class="p">{</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The API \
says the parameter can be NULL, nstrdup will then return a casted nullptr and this \
will segfault. (Or I missed something?)</pre> </div>
<br />



<p>- Thomas Lübking</p>


<br />
<p>On January 31st, 2014, 1:01 p.m. UTC, Martin Gräßlin wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

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


<p style="color: grey;"><i>Updated Jan. 31, 2014, 1:01 p.m.</i></p>









<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;">The rational for these changes is based on the discussion in \
http://article.gmane.org/gmane.comp.kde.devel.plasma/27579/

Plasma needs to know which is the active screen and so far only KWin knows it, so we \
need to make everybody aware of it.

---
Add convenient wrapper for active screen to KWindowSystem

A method is added to get the identifier of the active screen as a
QString and a signal whenever the active screen changes. This method
is only provided for X11, on Windows and Mac a null QString is returned
as the identifier.

Add an active screen property to NETRootInfo

The active screen is intended to be set by KWin to the active screen
it&#39;s using. This can be used by a Client to manually position e.g.
override redirect windows on the active screen. It&#39;s intended as a help
for multi-screen setups where a Client can only do guesses on where to
position e.g. a notification window.

It&#39;s a KDE specific extension as property _KDE_NET_ACTIVE_SCREEN and
announced in the supported properties.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">* wm part of NETWM is unit tested
* KWindowSystem is only compile tested (unit testing is difficult as we need a window \
                manager which supports this property which is at the moment of this \
                writing: none)
* Windows and Mac is not even compile tested, that&#39;s why kdewin is included in \
the review. If you have the time for it, please do a compile test.</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>tests/activeoutputtest.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/CMakeLists.txt <span style="color: \
grey">(ce68cc505a69ea9a3cf645e9ae587bd89abe1648)</span></li>

 <li>src/netwm_p.h <span style="color: \
grey">(41792b330f7405034f4d51fb31a4de5dd674b6d0)</span></li>

 <li>src/netwm_def.h <span style="color: \
grey">(8b1ccb8bd731aefb9559c8f2b450337b0312ed4d)</span></li>

 <li>src/netwm.cpp <span style="color: \
grey">(84eb137492e0afaaac80e8d26561fd8f8aff9c27)</span></li>

 <li>src/netwm.h <span style="color: \
grey">(393a29de3153a8b291b9fb249bd3eaeb1ba4e7d5)</span></li>

 <li>src/kwindowsystem_x11.cpp <span style="color: \
grey">(01c78c1debf95d5a176e2153139da19abf383c41)</span></li>

 <li>src/kwindowsystem_win.cpp <span style="color: \
grey">(96148b2d808396a3046204e55fd19d767db017c5)</span></li>

 <li>autotests/netrootinfotestwm.cpp <span style="color: \
grey">(120fbee92d0b22862d8ce746b3b30891ecd9f056)</span></li>

 <li>src/kwindowsystem.h <span style="color: \
grey">(3de0fea179dd468a78a265808fc64704027ec30d)</span></li>

 <li>src/kwindowsystem_mac.cpp <span style="color: \
grey">(8bd2ac763fa26ba49e7733fc3ba93e755383928c)</span></li>

</ul>

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







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








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



_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


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

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