Download it now!
Bug 101795 - GTK3: It seems to be impossible to link section to another (dialog not hiding)
Summary: GTK3: It seems to be impossible to link section to another (dialog not hiding)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.0.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.3.0 target:5.2.2
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-30 13:22 UTC by Ludovic CHEVALIER
Modified: 2016-09-05 20:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic CHEVALIER 2016-08-30 13:22:33 UTC
Hi!

In 5.2.0 version, but from few versions, I can't link a section from a document to a section from another document anymore.
In 5.2.0 version, when I browse to select original document, a select file dialog is displayed but, when I select it, the dialog is still open. :-(
Comment 1 Ludovic CHEVALIER 2016-08-30 13:59:42 UTC
Step by step to reproduce the bug:
- Create a file and insert a section (Menu Insert/Section and click to dialog box insert button);
- Write some text in this section;
- Save your file (Menu File/Save, choose a path and a name and click to save button);
- Open a new file and insert a section (Menu Insert/Section), check the link check box and browse to the file you just create before;
- A browsing dialog open and you can select your first file.
- When you want to click to open button to validate your choice, the browsing dialog still be opened. :-(
- But, you can click on "Insert button" into section dialog box and its ok.
Comment 2 Jean-Baptiste Faure 2016-09-01 04:39:21 UTC
Reproducible in LO 5.2 with the GTK3 vclplugin but not with the GTK2 plugin.
We have the same problem in Calc when inserting a sheet from a csv file. Seems to be a filepicker related bug.

Maxim, does that ring a bell for you?

@Ludovic: the command 
SAL_USE_VCLPLUGIN="gtk" && libreoffice
I gave you on irc does not work well with LO 5.2.0.4. To switch to vclplugin GTK2, you need to do 
export SAL_USE_VCLPLUGIN="gtk"
libreoffice
in a terminal.


Best regards. JBF
Comment 3 Maxim Monastirsky 2016-09-01 09:28:02 UTC
Well this seems to do the trick, but no idea how correct it is:

diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
index 968051d..96df4b7 100644
--- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
@@ -182,10 +182,8 @@ gint RunDialog::run()
     if (mxToolkit.is())
         mxToolkit->removeTopWindowListener(this);
 
-#if !GTK_CHECK_VERSION(3,0,0)
     if (nStatus != 1)   //PLAY
         gtk_widget_hide( mpDialog );
-#endif

Adding Caolán to CC.
Comment 4 Caolán McNamara 2016-09-02 15:20:21 UTC
I want to not hide right after execute so that if there is a (native gtk) overwrite warning dialog then it has the right parent.

But if the dialog is executed and then not destroyed it hangs around of course. Typically its destroyed, but not by this sfx::DocumentInserter thing.

Let me try to make DocumentInserter do what I expected to happen, and happens in general.
Comment 5 Caolán McNamara 2016-09-02 20:41:55 UTC
nah, that seems super difficult to achieve. More sensible seems to hide it at the end of ::execute, but not at the end of each RunDialog::run so it always disappears at the end of ::execute but remains visible and mapped if "do you want to overwrite" is necessary and then goes away after all that is done
Comment 6 Commit Notification 2016-09-03 10:21:20 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=696e83b663d4f3e00f23947613f9f3916a4dd14d

Resolves: tdf#101795 restore hiding on end of Gtk fpicker execute

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Jean-Baptiste Faure 2016-09-03 12:27:56 UTC
Hi Caolán,

Thank you very much for the fix. I tested it in the master for both cases section linked to another section in Writer and sheet linked to a csv file in Calc, and both work now as expected.
Do you plan to backport this fix to 5.2 branch ?

Best regards. JBF
Comment 8 Caolán McNamara 2016-09-03 17:44:23 UTC
yeah, its in the queue as https://gerrit.libreoffice.org/#/c/28642/
Comment 9 Commit Notification 2016-09-05 20:33:58 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=21188796975be8187e234de446aae4371c3b360a&h=libreoffice-5-2

Resolves: tdf#101795 restore hiding on end of Gtk fpicker execute

It will be available in 5.2.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.