<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/121351/">https://git.reviewboard.kde.org/r/121351/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On Januar 13th, 2015, 11:41 vorm. UTC, <b>Christoph Feck</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;">It looks like Daniel cannot provide feedback right now.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Wolfgang, does changing the modality of the configure dialog mean it can now be openend twice?</p></pre>
</blockquote>
<p>On Januar 13th, 2015, 12:58 nachm. UTC, <b>Wolfgang Bauer</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;">As far as I can tell, no.
If I click on "Configure" for the same printer, the already opened dialog is given focus, no new dialog is opened.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It is possible to open a new configure dialog for a different printer now though when one is open already, which even makes sense somehow IMHO.</p></pre>
</blockquote>
<p>On Januar 13th, 2015, 3:01 nachm. UTC, <b>Thomas Lübking</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;">A modal window is ALWAYS modal for exactly one other window.
The assumption
"Launching a modal dialog (for example, as password dialog) from a modal dialog won't give the focus to the second dialog." in bug #314633 is -generally- wrong for sure.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Beyond this, Qt supports client wide modality, but that's about event processing.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">You can set QWidget::setWindowModality(Qt::WindowModal) rather than QWidget::setModal(true) (the latter implies QWidget::setWindowModality(Qt::ApplicationModal) to impact this.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Notice that Qt will set the main window to the parent window - you must use KWindowSystem::setMainWindow(QWidget*, WId) if you need anything special.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">KWin (unlike mutter) does not support some sort of system wide modality at all. I cannot say what exactly causes the behavior of bug #314633 but a modal dialog for MainWindow A has no impact on windows in clients B unless A and B have a common MainWindow C which is NOT the root window.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">==> The bug is here:
https://projects.kde.org/projects/kde/kdeutils/print-manager/repository/revisions/1595ef0614f824a6a871d51327eff3a108e6e251</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Why would the password dialog block plasma? Because it's ApplicationModal or because it was set modal for some common plasma dialog dummy window?
If the dialog has an actual (visible, real, probably not the desktop or a panel) parent window, it should be WindowModal for that one window only. (I strongly assume the the password dialog better should be modal since its input is probably expected by some other window?!) If not (ie. the dialog spawns out of the void), then of course it should be not modal at all.</p></pre>
</blockquote>
<p>On Januar 15th, 2015, 3:43 nachm. UTC, <b>Wolfgang Bauer</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;">I fully agree that the password dialog should better be modal.
But as I understand bug #314633, the password dialog can also be shown directly by the plasmoid, i.e. it <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">can</em> spawn out of the void apparently.
I never saw that problem though (I don't use remote printers), and AFAICS the real cause was never identified sufficiently.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">OTOH, I don't really see a point for making the "Configure Printer" dialog modal.
Why should it be prevented to do some other stuff in the KCM while that dialog is open, like cleaning the heads or printing a test page.</p></pre>
</blockquote>
<p>On Januar 15th, 2015, 4:15 nachm. UTC, <b>Thomas Lübking</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;">Modality should be client controlled then (ie. the printer dialog would set it QWidget::setWindowModality(Qt::WindowModal) - it MUST be a child of the printer dialog, resp. through KWindowSystem::setMainWindow(passwordDlg, printerDlg->winId()) )</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I would instinctively agree on the printer dialog modality, but can't say - I installed printer stuff only back then to check the modality constallation but am not in tree killing business otherwise ;-)</p></pre>
</blockquote>
<p>On Januar 16th, 2015, 9:35 vorm. UTC, <b>Wolfgang Bauer</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;">So if I understand you correctly, dialog->setWindowModality(Qt::WindowModal) should be called instead of dialog->setModal(), and then KWindowSystem::setMainWindow() to specify the window that should be blocked (i.e. the "Configure Printer" dialog in this case).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">AFAICS KWindowSystem::setMainWindow() is actually called already (added by the mentioned commit), so all that would be left is change dialog->setModal() to dialog->setWindowModality(Qt::WindowModal) in KCupsPasswordDialog.cpp?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">But KWindowSystem::setMainWindow() should be called <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">before</em> dialog->show() (not afterwards as it is now) if I correctly understand the documentation, right?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">And I think the KWindowSystem::forceActiveWindow(dialog->winId()) should be removed as well, or not?</p>
<hr style="text-rendering: inherit;margin: 0;padding: 0;white-space: normal;border: 1px solid #ddd;line-height: inherit;" />
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Regarding <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">this</em> review request: configure-printer (i.e. the printer configuration dialog) is a separate application anyway (/usr/lib64/kde4/libexec/configure-printer on my system, it is started via DBUS). So the setModal(true) here is totally useless I'd say.
It has absolutely no effect on the KCM window at all, that one is not blocked even without this patch. I noticed this already when I came up with this patch, but somehow forgot to mention that here.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">So I think there's no need to discuss whether the "configure printer" dialog should be modal or not.</p></pre>
</blockquote>
<p>On Januar 16th, 2015, 9:44 vorm. UTC, <b>Wolfgang Bauer</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;">PS: I did notice a change now:
When setModal(true) is called, all other open "Configure Printer" dialog windows are blocked when you open a new one.
I'm not sure whether this is desirable or not though. But I'd rather say no. It should not matter in which order you press OK/Cancel in the open windows I think...</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;"><blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">dialog->setWindowModality(Qt::WindowModal) should be called instead of dialog->setModal()</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This will block only the event processing for the main window of the dialog (in the client) - other windows would not be affected.
So if you'd like to be able to open multiple printer config dialogs (in one process), this would be the correct statement - yes.</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">and then KWindowSystem::setMainWindow()</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">NOTICE:
There are TWO INDEPENDENT states of MODALITY involved here
a) the window manager won't pass focus to a (usually ONE) window that is blocked by a modal dialog. The WM operates on the relations hinted by XWindow properties and is affected by KWindowSystem::setMainWindow()
b) the client (Qt) maintains its own modality concept. setWindowModality(Qt::WindowModal) does ONLY make sense if "modalDialog = new QDialog(m_mainWindow);"
If the dialog has no usable parent, this is useless (Qt can either stall eventprocessign while the dialog is up, or not)
If the dialogs parent is sane, Qt will implicitly do what KWindowSystem::setMainWindow() would do.
==> You do only have to mess around with KWindowSystem::setMainWindow() if mainwindow and modal dialog are in different processes. Otherwise just make the dialog qobject child of its mainwindow and set setWindowModality(Qt::WindowModal) as it pleases you.</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">KWindowSystem::forceActiveWindow(dialog->winId()) should be removed</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If a modal dialog is opened for a window tha has currently the focus, KWin will pass the input focus to the dialog - you don't have to manage focus if the windows hint their relations in the correct way (or it's a kwin bug ;-)</p></pre>
<br />
<p>- Thomas</p>
<br />
<p>On Januar 13th, 2015, 11:40 vorm. UTC, Wolfgang Bauer 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 Okular, Print Manager, Daniel Nicoletti, and Thomas Lübking.</div>
<div>By Wolfgang Bauer.</div>
<p style="color: grey;"><i>Updated Jan. 13, 2015, 11:40 vorm.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=328014">328014</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
print-manager
</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;"><a href="https://projects.kde.org/projects/kde/kdeutils/print-manager/repository/revisions/1595ef0614f824a6a871d51327eff3a108e6e251" style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Commit 1595ef0614f824a6a871d51327eff3a108e6e251</a> (a partial fix for bug 314633) changed the password dialog to be non-modal.
But the printer configuration dialog is still modal, so if a password is needed to apply/save the configuration it cannot be entered because the password dialog cannot get focus.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch sets the configuration dialog to be non-modal as well to prevent this problem.</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;">Open the "Printer" KCM in systemsettings, select a printer, click on "Configure", change some setting and click "Apply" or "OK".
A password dialog appears (unless you have the necessary privileges to change the CUPS settings of course), this has focus and you can actually enter the username/password now whereas you could not without this patch.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Also tested by other users and included in openSUSE's official packages, see https://bugzilla.opensuse.org/show_bug.cgi?id=889187#c7.</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>configure-printer/ConfigureDialog.cpp <span style="color: grey">(ace91a2)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/121351/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>