Bug 325949 - File dialogue stays onscreen after operation, cannot be closed, after revision 75ea4d59
Summary: File dialogue stays onscreen after operation, cannot be closed, after revisio...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: git master (please specify the git hash!)
Platform: unspecified Linux
: NOR major
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-13 09:06 UTC by Tyson Tan
Modified: 2013-10-23 20:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2013-10-13 09:06:20 UTC
After revision 75ea4d59 (Merge branch 'use-qfiledialog-yue'), Krita's file dialogue (open, save and export) become the system's native instead of the former KDE's. Once opened, the dialogue will stay onscreen forever. it doesn't automatically disappear after an operation. Clicking on the close button does not close the dialogue either, causing major usability problem.

Reproducible: Always

Steps to Reproduce:
1. Open Krita
2. Menu -> FIle -> Open
3. Open a file
4. The file is opened, but the dialogue does not disappear.
5. Click the close button.
6. Nothing happens.
Actual Results:  
The file can be opened and saved, but the file dialogue does not disappear, and it cannot be closed.

Expected Results:  
The file dialogue should close itself automatically after an operation. It can be closed manually.

You can drag the file dialogue off the screen as a workaround, but it's still kind of annoying.
Comment 1 Halla Rempt 2013-10-13 10:40:25 UTC
It only seems to happen on Linux in non-kde environments -- I just tried in Gnome 3, and I could reproduce the weirdness.
Comment 2 Halla Rempt 2013-10-17 08:25:25 UTC
I've reverted that merge.
Comment 3 Tyson Tan 2013-10-20 12:16:11 UTC
After commit 855ec0fd & 5a0b64e9, the bug is still not fully fixed.
The export dialogue won't close. Once opened, it dead locks the program.
Desktop environment is Gnome 3.4 Fallback Mode.
Comment 4 Tyson Tan 2013-10-22 09:22:45 UTC
Further report:
This bug still affects both Save and Export file diaogue, but somehow different to what it was first discovered.

1. Save as or Export a file
2. Copy the file name
3. File dialogue freezes, but you can still move it
4. File dialogue cannot be closed.
Comment 5 Halla Rempt 2013-10-22 09:33:53 UTC
Bah... I can confirm it. It happens again only in Krita, but in other Calligra apps, there's weirdness as well. In Krita the dialog hangs, but in Words, words hangs on close for some time, then ends with "QClipboard: Unable to receive an event from the clipboard manaer in a reasonable time"...
Comment 6 Halla Rempt 2013-10-22 09:47:17 UTC
Something awful is happening with the clipboard:

#0  0x00007f6f6fb917d3 in select () from /lib64/libc.so.6
#1  0x00007f6f71981998 in ?? () from /usr/lib64/libQtGui.so.4
#2  0x00007f6f719835a6 in ?? () from /usr/lib64/libQtGui.so.4
#3  0x00007f6f71983808 in ?? () from /usr/lib64/libQtGui.so.4
#4  0x00007f6f719186c6 in QInternalMimeData::formats() const ()
   from /usr/lib64/libQtGui.so.4
#5  0x00007f6f71983a12 in ?? () from /usr/lib64/libQtGui.so.4
#6  0x00007f6f719190e6 in QInternalMimeData::retrieveData(QString const&, QVariant::Type) const () from /usr/lib64/libQtGui.so.4
#7  0x00007f6f70c875be in QMimeDataPrivate::retrieveTypedData (
    this=this@entry=0x6c56ac0, format=..., type=type@entry=QVariant::Image)
    at kernel/qmimedata.cpp:107
#8  0x00007f6f70c8801a in QMimeData::imageData (this=<optimized out>)
    at kernel/qmimedata.cpp:442
#9  0x00007f6f7191612c in QClipboard::image(QClipboard::Mode) const ()
   from /usr/lib64/libQtGui.so.4
#10 0x00007f6f77be903e in KisClipboard::clipboardDataChanged (this=0x6d09dd0)
    at /home/boud/kde/src/calligra/krita/ui/kis_clipboard.cc:289
#11 0x00007f6f77be9340 in KisClipboard::qt_static_metacall (_o=0x6d09dd0, 
    _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0xffffffffffffffff)
    at /home/boud/kde/build/calligra/krita/ui/kis_clipboard.moc:61
#12 0x00007f6f70c8cd68 in QMetaObject::activate (sender=0x2181840, 
---Type <return> to continue, or q <return> to quit---
    m=<optimized out>, local_signal_index=<optimized out>, argv=0x0)
    at kernel/qobject.cpp:3556
#13 0x00007f6f7197d843 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib64/libQtGui.so.4
#14 0x00007f6f719a3882 in ?? () from /usr/lib64/libQtGui.so.4
#15 0x00007f6f69c652c6 in g_main_context_dispatch ()
   from /usr/lib64/libglib-2.0.so.0
#16 0x00007f6f69c65618 in ?? () from /usr/lib64/libglib-2.0.so.0
#17 0x00007f6f69c65a1a in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#18 0x00007f6f636c2e32 in gtk_dialog_run ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#19 0x00007f6f71c847ed in ?? () from /usr/lib64/libQtGui.so.4
#20 0x00007f6f71db8ec0 in QFileDialog::getSaveFileName(QWidget*, QString const&, QString const&, QString const&, QString*, QFlags<QFileDialog::Option>) ()
   from /usr/lib64/libQtGui.so.4
#21 0x00007f6f770d73e1 in KoFileDialogHelper::getSaveFileName (
    parent=parent@entry=0x27b6620, caption=..., dir=..., mimeList=..., 
    defaultMime=...)
    at /home/boud/kde/src/calligra/libs/main/KoFileDialogHelper.cpp:239
#22 0x00007f6f770e0d39 in KoMainWindow::saveDocument (
    this=this@entry=0x27b6620, saveas=<optimized out>, saveas@entry=true, 
    silent=silent@entry=false, specialOutputFlag=specialOutputFlag@entry=0)
---Type <return> to continue, or q <return> to quit---
    at /home/boud/kde/src/calligra/libs/main/KoMainWindow.cpp:987
#23 0x00007f6f770e3022 in KoMainWindow::slotFileSaveAs (
    this=this@entry=0x27b6620)
    at /home/boud/kde/src/calligra/libs/main/KoMainWindow.cpp:1347
#24 0x00007f6f770eeaed in KoMainWindow::qt_static_metacall (_o=0x27b6620, 
    _c=<optimized out>, _id=9, _a=0x7fffb26ac870)
    at /home/boud/kde/build/calligra/libs/main/KoMainWindow.moc:134
#25 0x00007f6f70c8cd68 in QMetaObject::activate (sender=0x5372270, 
    m=<optimized out>, local_signal_index=<optimized out>, 
    argv=0x7fffb26ac870) at kernel/qobject.cpp:3556
#26 0x00007f6f71900752 in QAction::triggered(bool) ()
   from /usr/lib64/libQtGui.so.4
#27 0x00007f6f71902123 in QAction::activate(QAction::ActionEvent) ()
   from /usr/lib64/libQtGui.so.4
#28 0x00007f6f71d2b0e9 in ?? () from /usr/lib64/libQtGui.so.4
#29 0x00007f6f71d2f619 in ?? () from /usr/lib64/libQtGui.so.4
#30 0x00007f6f71d318a7 in QMenu::keyPressEvent(QKeyEvent*) ()
   from /usr/lib64/libQtGui.so.4
#31 0x00007f6f726d33f0 in KMenu::keyPressEvent(QKeyEvent*) ()
   from /usr/lib64/libkdeui.so.5
#32 0x00007f6f71955cca in QWidget::event(QEvent*) ()
   from /usr/lib64/libQtGui.so.4
---Type <return> to continue, or q <return> to quit---
#33 0x00007f6f71d333eb in QMenu::event(QEvent*) ()
   from /usr/lib64/libQtGui.so.4
#34 0x00007f6f719068ac in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#35 0x00007f6f7190e0c1 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib64/libQtGui.so.4
#36 0x00007f6f770a9507 in KoApplication::notify (this=<optimized out>, 
    receiver=0x45b5330, event=0x7fffb26acf00)
    at /home/boud/kde/src/calligra/libs/main/KoApplication.cpp:569
#37 0x00007f6f70c790ad in QCoreApplication::notifyInternal (this=
    0x7fffb26ad8e0, receiver=0x45b5330, event=0x7fffb26acf00)
    at kernel/qcoreapplication.cpp:949
#38 0x00007f6f719a0d79 in ?? () from /usr/lib64/libQtGui.so.4
#39 0x00007f6f719a1119 in ?? () from /usr/lib64/libQtGui.so.4
#40 0x00007f6f7197cd3f in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib64/libQtGui.so.4
#41 0x00007f6f719a3882 in ?? () from /usr/lib64/libQtGui.so.4
#42 0x00007f6f69c652c6 in g_main_context_dispatch ()
   from /usr/lib64/libglib-2.0.so.0
#43 0x00007f6f69c65618 in ?? () from /usr/lib64/libglib-2.0.so.0
#44 0x00007f6f69c656bc in g_main_context_iteration ()
   from /usr/lib64/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#45 0x00007f6f70ca5d55 in QEventDispatcherGlib::processEvents (this=
    0x1f55790, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#46 0x00007f6f719a3936 in ?? () from /usr/lib64/libQtGui.so.4
#47 0x00007f6f70c77d0f in QEventLoop::processEvents (this=this@entry=
    0x7fffb26ad860, flags=...) at kernel/qeventloop.cpp:149
#48 0x00007f6f70c78005 in QEventLoop::exec (this=this@entry=0x7fffb26ad860, 
    flags=...) at kernel/qeventloop.cpp:204
#49 0x00007f6f70c7d13b in QCoreApplication::exec ()
    at kernel/qcoreapplication.cpp:1221
#50 0x00007f6f7839cacd in kdemain (argc=<optimized out>, argv=<optimized out>)
    at /home/boud/kde/src/calligra/krita/main.cc:84
#51 0x00007f6f6fad2be5 in __libc_start_main () from /lib64/libc.so.6
#52 0x00000000004009e1 in _start () at ../sysdeps/x86_64/start.S:122
Comment 7 Tyson Tan 2013-10-22 13:00:55 UTC
Looks complicated XD
Good luck on nailing down the problem! :)
Comment 8 Halla Rempt 2013-10-23 20:38:48 UTC
Git commit 82af13e2ccc20fd268fae5dc1f7c0043318a9daa by Boudewijn Rempt.
Committed on 23/10/2013 at 20:37.
Pushed by rempt into branch 'master'.

Block the clipboard signals while showing the file dialogs

The GTK native file dialogs, when you copy a file name (with ctrl-c)
do something really horrible to the clipboard. This will cause a hang if
the app connects to the QClipBoard signals.

See: https://bugreports.qt-project.org/browse/QTBUG-11187

However, https://bugreports.qt-project.org/browse/QTBUG-32853 might still
occur: that is, if the user tries to copy the filename, there'll be a
delay on closing the app, and an error message on stderr:

QClipboard: Unable to receive an event from the clipboard manager in a reasonable time

M  +41   -14   libs/main/KoFileDialogHelper.cpp

http://commits.kde.org/calligra/82af13e2ccc20fd268fae5dc1f7c0043318a9daa