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

List:       kde-panel-devel
Subject:    Re: Review Request 123836: Ensure KNotification can be used from a non-GUI thread
From:       "Martin Klapetek" <martin.klapetek () gmail ! com>
Date:       2015-05-18 15:36:24
Message-ID: 20150518153624.16315.81175 () mimi ! kde ! org
[Download RAW message or body]

--===============1293993648872473822==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit



> On May 18, 2015, 4:15 p.m., Aleix Pol Gonzalez wrote:
> > This fixes my boot. I wasn't able to boot for the whole day because it was \
> > showing a QWidget from the wrong thread. 
> > On a related note, let's port away from QDesktopWidget, it has these things...
> 
> Martin Klapetek wrote:
> Ok, QScreen then?
> 
> Aleix Pol Gonzalez wrote:
> That would work. You can do notification->widget()->screen()->geometry()->top().

That wouldn't work because the widget() does not need to be set. So I'll use QScreen \
directly.


- Martin


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


On May 18, 2015, 5:34 p.m., Martin Klapetek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123836/
> -----------------------------------------------------------
> 
> (Updated May 18, 2015, 5:34 p.m.)
> 
> 
> Review request for KDE Frameworks and Plasma.
> 
> 
> Repository: knotifications
> 
> 
> Description
> -------
> 
> The NotifyByPopup plugin is accessing QApplication::desktop()
> in constructor which Qt does not like when that happens on non-GUI
> thread and asserts. So this moves that code only when actually
> needed plus it checks first if the code is run in non-GUI thread
> and does nothing if it's not.
> 
> This is only for the popup fallback notifications, normal notifications
> work just fine.
> 
> 
> Diffs
> -----
> 
> src/notifybypopup.cpp 2f84ab0 
> 
> Diff: https://git.reviewboard.kde.org/r/123836/diff/
> 
> 
> Testing
> -------
> 
> Tested with both multi-threaded and single-threaded codes.
> 
> 
> Thanks,
> 
> Martin Klapetek
> 
> 


--===============1293993648872473822==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit




<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/123836/">https://git.reviewboard.kde.org/r/123836/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On May 18th, 2015, 4:15 p.m. CEST, <b>Aleix Pol \
Gonzalez</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">This fixes my boot. I wasn't able to boot for the \
whole day because it was showing a QWidget from the wrong thread.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">On a related note, let's port away from QDesktopWidget, it has these \
things...</p></pre>  </blockquote>




 <p>On May 18th, 2015, 5:03 p.m. CEST, <b>Martin Klapetek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ok, \
QScreen then?</p></pre>  </blockquote>





 <p>On May 18th, 2015, 5:14 p.m. CEST, <b>Aleix Pol Gonzalez</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">That \
would work. You can do \
notification-&gt;widget()-&gt;screen()-&gt;geometry()-&gt;top().</p></pre>  \
</blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">That \
wouldn't work because the widget() does not need to be set. So I'll use QScreen \
directly.</p></pre> <br />










<p>- Martin</p>


<br />
<p>On May 18th, 2015, 5:34 p.m. CEST, Martin Klapetek wrote:</p>








<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 and Plasma.</div>
<div>By Martin Klapetek.</div>


<p style="color: grey;"><i>Updated May 18, 2015, 5:34 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
knotifications
</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">The NotifyByPopup plugin is accessing \
QApplication::desktop() in constructor which Qt does not like when that happens on \
non-GUI thread and asserts. So this moves that code only when actually
needed plus it checks first if the code is run in non-GUI thread
and does nothing if it's not.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">This is only for the popup fallback notifications, \
normal notifications work just fine.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Tested with both multi-threaded and single-threaded \
codes.</p></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>src/notifybypopup.cpp <span style="color: grey">(2f84ab0)</span></li>

</ul>

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






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







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


--===============1293993648872473822==--


[Attachment #3 (text/plain)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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