Bug 77444 - Opening document by double-click waits a long time
Summary: Opening document by double-click waits a long time
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.3.3 release
Hardware: x86-64 (AMD64) macOS (All)
: highest major
Assignee: How can I remove my account?
URL:
Whiteboard: target:6.1.0 target:6.1.0.1
Keywords: bibisectRequest, regression
: 94560 94729 95632 96110 96898 97403 98635 98892 103660 107066 111001 111693 (view as bug list)
Depends on:
Blocks: macOS-UI-polish VCL-Scheduler
  Show dependency treegraph
 
Reported: 2014-04-14 17:48 UTC by ramuntcho
Modified: 2018-05-24 17:33 UTC (History)
18 users (show)

See Also:
Crash report or crash signature:


Attachments
Log file excerpt with comments (9.06 KB, text/plain)
2018-05-21 11:08 UTC, How can I remove my account?
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ramuntcho 2014-04-14 17:48:02 UTC
When LO is open, with no document open, opening a document by double-clic on his icon may take time, between 2 seconds and 1 minute. More strange, if we make an other click, the document opens immediately. And even if we move the mouse, the opening is quite immediate too.

Sometimes the problem doesn't appear, but in most cases, we notice it

Tested with LO 4.2.3.3 on Mac OOSX 10.9.2 on different macs
Comment 1 tommy27 2014-05-03 22:50:20 UTC Comment hidden (obsolete)
Comment 2 steve 2014-05-04 09:45:11 UTC Comment hidden (obsolete)
Comment 3 ramuntcho 2014-05-08 08:14:05 UTC
I started with a fresh profile (i delete the one existing). So here what's happening :

1° i open LO, close the window "Centre de démarrage", no document open : when i first double-clic on a LO document, it takes really a long time, more than 15 min to open. 

2° double-clic on a second document makes it open in 1 between 20 seconds.

3° i quit LO, and start again in point 1° : same behavior, it takes really a long time to open the first document by double-clic on it

4° i quit LO, and start again in point 1°, but without closing the window "Centre de démarrage" --> no problem, double-clic on a document makes it open quite immediately.


So, the problem appears when LO is open, but the window "Centre de démarrage" is closed : in this case, opening documents by double-clic takes time, especially for the first document.

Hoping that my explanations could help to resolve this bug

Christian
Comment 4 Alex Thurgood 2014-09-26 11:50:09 UTC Comment hidden (obsolete)
Comment 5 Alex Thurgood 2014-09-26 11:52:51 UTC
It is also noticeable if LO is running in taskbar with no open documents, and one double-clicks on a document in the Finder to open it, where the Finder window is on a different screen to the one that LO was first opened on.
Comment 6 Alex Thurgood 2015-09-30 09:34:56 UTC Comment hidden (obsolete)
Comment 7 Alex Thurgood 2015-10-03 14:04:33 UTC Comment hidden (obsolete)
Comment 8 Alex Thurgood 2015-11-08 10:44:51 UTC Comment hidden (obsolete)
Comment 9 Alex Thurgood 2015-11-30 08:21:07 UTC Comment hidden (obsolete)
Comment 10 steve 2015-12-03 14:49:41 UTC Comment hidden (obsolete)
Comment 11 steve 2015-12-03 15:56:49 UTC Comment hidden (obsolete)
Comment 12 mrelwood 2015-12-29 08:38:20 UTC
My latest test results with yesterday's LO Dev, fresh user profile:


If LibreOfficeDev is NOT running, an .ods file will NOT open by:

Double-clicking, Cmd O, or Cmd [Down arrow]
neither from:
Finder, Spotlight, or Desktop alias.

... until I move the mouse cursor or press a key (even Shift key works).
If I keep pressing the Cmd key when launching the file with Cmd O or Cmd Down, the file will not load until I release the Cmd key.


If LibreOfficeDev IS running, the file will open instantaneously with all methods mentioned above.


A few times I did get an .xls file to open normally from Finder, both by double-clicking and the mentioned keyboard shortcuts! After I succesfully launched an .xls file and quit LO Dev, the .ods file also launched normally with Cmd O and Cmd Down from Finder. But if I double-clicked the .ods file, it no longer launched, and we were back to square one.

However, I can no longer get the .xls to open normally either.



LibreOffice Dev -> About:

Version: 5.1.0.1.0+
Build ID: 02c113a3ab57d7880bb1f794e192fb42aea078e1
CPU Threads: 4; OS Version: -; UI Render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:libreoffice-5-1, Time: 2015-12-28_15:20:39
Locale: en-US (en.UTF-8)
Comment 13 Alex Thurgood 2016-01-05 09:24:06 UTC
*** Bug 96898 has been marked as a duplicate of this bug. ***
Comment 14 Alex Thurgood 2016-01-05 14:48:00 UTC Comment hidden (obsolete)
Comment 15 Alex Thurgood 2016-03-14 09:47:55 UTC Comment hidden (obsolete)
Comment 16 Alex Thurgood 2016-03-14 10:02:25 UTC Comment hidden (obsolete)
Comment 17 Alex Thurgood 2016-03-29 06:56:53 UTC Comment hidden (obsolete)
Comment 18 rwhite 2016-05-21 17:06:08 UTC
Still current and reproducible.

Steps to reproduce:
1. LO not open
2. Double-click a Calc document, control-click Calc document and select Open with LibreOffice, or open a Calc document from Spotlight.

Expected Behavior: 
LO launches and displays document in window

Observed Behavior: 
LO launches, but document window is not displayed until there is mouse movement or a key pressed.

If LO is already open, the expected behavior IS observed. This bug only appears when LO is not currently open. 

LO
Version: 5.0.5.2
Build ID: 55b006a02d247b5f7215fc6ea0fde844b30035b3
Locale: en-US (en.UTF-8)

Apple OS X
System Version:	OS X 10.11.4 (15E65)
Kernel Version:	Darwin 15.4.0
Comment 19 mrelwood 2016-08-06 04:44:54 UTC Comment hidden (obsolete)
Comment 20 mrelwood 2016-08-25 04:34:53 UTC Comment hidden (obsolete)
Comment 21 Alex Thurgood 2016-11-03 09:52:11 UTC Comment hidden (obsolete)
Comment 22 steve 2016-11-03 11:26:00 UTC
macOS 10.12.1 + LO Version: 5.3.0.0.alpha1+
Build ID: 3950166877bf1308f9e449992e20b558342af825
CPU Threads: 4; OS Version: Mac OS X 10.12.1; UI Render: default; Layout Engine: old; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-11-01_00:39:01
Locale: de-DE (de_DE.UTF-8); Calc: group

still happening.

LO closed, double click LO file

currently: nothing (until mouse is moved)

expected: file should open
Comment 23 steve 2016-11-03 11:26:38 UTC Comment hidden (obsolete)
Comment 24 jani 2016-11-03 11:38:09 UTC
Tested with Master of today, problem exist for at least writer/calc/impress.

It seems the document is actually loaded, but the main window never gets displayed, until a mouse event triggers a repaint (or at least so it seems, did not run it in the debugger).
Comment 25 Telesto 2016-11-05 17:13:30 UTC
A link to terminal output SAL_LOG+INFO+WARN with corresponding screen recording for this bug: https://drive.google.com/open?id=0B7DezVIXHrQOTzF3Y1J5MHVpc1E

Created with LO Version: 5.3.0.0.alpha0+
Build ID: a9afa89e953f0f32acf26b143717e7d067cbc75a
CPU Threads: 4; OS Version: Mac OS X 10.12.2; UI Render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-10-13_05:13:57
Locale: en-US (en_NL.UTF-8); Calc: group

It has something to do with a waitCondition:
34.720:info:sal.osl.condition:1667:6:sal/osl/unx/conditn.cxx:177: osl_waitCondition(0x7fd13ca974f0)
44.722:info:sal.osl.condition:1667:6:sal/osl/unx/conditn.cxx:177: osl_waitCondition(0x7fd13ca974f0)
71.620:info:sal.osl.condition:1667:1:sal/osl/unx/conditn.cxx:132: [On mouse movement]
Comment 26 Alex Thurgood 2017-04-11 07:21:13 UTC
*** Bug 107066 has been marked as a duplicate of this bug. ***
Comment 27 Lorand Andahazy 2017-04-11 13:11:50 UTC
Probable cause and example of code which could be customized to fix copied here from duplicate bug 107066.

This bug is likely due to the code not using a delegate to initiate the application.
 
Example of a delegate:

#import "AppDelegate.h"
#import "yourapp.h"
@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
    [_window setAlphaValue:1.00];   //etc. as needed
}

- (void)applicationDidBecomeActive:(NSNotification *)aNotification
{
    [_window setAlphaValue:1.00];
}

- (void)applicationDidResignActive:(NSNotification *)aNotification
{
    [_window setAlphaValue: _controller.alphaState];
}

- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
    return NSTerminateNow;      //NSTerminateCancel
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
{
    return YES;
}
@end
Comment 28 ckakman 2017-06-09 22:38:32 UTC
Issue still reproducible on OS X.

From the About dialog:
Version: 5.3.4.1
Build ID: 1b1606c6e1203cdc3fd5ffbc16e74ecea300241a
CPU Threads: 8; OS Version: Mac OS X 10.11.6; UI Render: GL; Layout Engine: new

Disabling GL doesn't change anything.
Comment 29 Alex Thurgood 2017-08-03 06:57:06 UTC
*** Bug 111001 has been marked as a duplicate of this bug. ***
Comment 30 Xisco Faulí 2017-08-11 13:57:12 UTC
*** Bug 111693 has been marked as a duplicate of this bug. ***
Comment 31 ckakman 2017-09-15 16:09:43 UTC
The issue still present on macOS 10.12.6 for LO 5.4.1.2 with or without GL rendering.
Comment 32 Telesto 2017-09-22 15:33:47 UTC
Repro with:
Version: 6.0.0.0.alpha0+
Build ID: f95e7ef38e0bf79fa9662bfd50de612d50ef71de
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2017-09-22_12:57:48
Locale: nl-NL (nl_NL.UTF-8); Calc: grou
Comment 33 ckakman 2017-12-21 19:06:39 UTC
Reproducible on:
Version: 5.4.4.2
Build ID: 2524958677847fb3bb44820e40380acbe820f960
CPU threads: 8; OS: Mac OS X 10.12.6; UI render: GL

Disabling GL doesn't change anything.
Comment 34 How can I remove my account? 2018-05-21 11:08:38 UTC
Created attachment 142227 [details]
Log file excerpt with comments

Can reproduce. I have LibreOffice running, no window open (not even Start Centre). In tan idle state, every ten seconds some timer fires in LO and it prints a handful of SAL_INFO lines (and some SAL_DEBUG ones I added).

When I then double-click on a file associated to that LO installation (but don't do anything else, don't move the mouse (I actually a Trackpad, not a mouse), a few lines are printed right away, but nothing "interesting" happens until the ten-second timer fires again. Only then it starts opening the file etc.
Comment 35 How can I remove my account? 2018-05-21 14:59:10 UTC
Suggested fix at https://gerrit.libreoffice.org/#/c/54643/
Comment 36 Commit Notification 2018-05-22 06:55:06 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=059872b47ed957e847a3fe63bd35793ba93c4c32

tdf#77444: Call TriggerUserEventProcessing() in a few key places

It will be available in 6.1.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 37 How can I remove my account? 2018-05-24 12:01:17 UTC
Edited title to match initial description (and the behaviour that was fixed).
Comment 38 Commit Notification 2018-05-24 17:09:18 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=158da8687f043dd5e38dce4e9c3a79c314d507e1

tdf#77444: Follow-up fix: Guard against GetSalData()->mpInstance being null

It will be available in 6.1.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 39 Commit Notification 2018-05-24 17:33:28 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=31c12e0b19edad32d1ae2aea4f8923056dff594e&h=libreoffice-6-1

tdf#77444: Follow-up fix: Guard against GetSalData()->mpInstance being null

It will be available in 6.1.0.1.

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.