Bug 146225

Summary: Experiencing delay when exiting from gtk3 ui
Product: LibreOffice Reporter: Hossein <hossein>
Component: LibreOfficeAssignee: Hossein <hossein>
Status: RESOLVED FIXED    
Severity: normal CC: hossein, suokunlong, xiscofauli
Priority: medium Keywords: bisected, regression
Version: 7.4.0.0 alpha0+   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Hossein 2021-12-14 12:43:33 UTC
Description:
After 489d7298d2e609ee5900f05ba0064845a7a551ce, when exiting from LibreOffice gtk3 ui, and it takes several seconds to completely exit. This is a regression from the above commit.

Steps to Reproduce:
1. Open Libreoffice with gtk3 ui
   ./instdir/program/soffice -env:SAL_USE_VCLPLUGIN=gtk3
2. Exit immediately.
3. You will see the extra messages and it takes several seconds to exit

Actual Results:
This is a sample of the extra outputs in the console:

warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 1000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 2000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 3000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 4000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 5000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 6000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 7000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 8000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 9000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 10000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 11000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 12000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 13000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 14000
warn:vcl.schedule:23522:23522:vcl/source/app/svapp.cxx:488: ProcessEventsToIdle: 15000


Expected Results:
LibreOffice should exit immediately


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 98c3dd1b7147ea9c235a65c276e9005290fe108b
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Commit Notification 2021-12-15 11:10:22 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4812c8df39cb03b59d8c033005e8e9dc45a260dd

tdf#146225 Fix delay when exiting from the gtk3 ui

It will be available in 7.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 2 Hossein 2021-12-16 05:27:24 UTC
It should be fixed now by the above patch.
@Xisco, could you please verify the fix?
Comment 3 Kevin Suo 2021-12-17 03:32:05 UTC
This has caused a series of serious regressions:

1. Now in Calc, if I click cell a cell (e.g. C1), the cell focus is still in cell A1, although the Name Box shows the new cell address (e.g. C1).

2. Now it is now possible to select text, either in Calc or in Writer, 

3. Now if I insert a text box in Writer or Draw and type, the text typed is not visible until I put focus to anther place. Even worse, in Writer if I insert a text box and type, it is now impossible to exit from the text box.

4. It is now impossible to scroll up and down the view using the mouse wheel in Calc or Writer.

5. .... I think there are more issues.

git bisect log:

# good: 2021-12-15 10:19:57 source-hash-3769508f4
# bad: 2021-12-15 12:09:42 source-hash-4812c8df3

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 4812c8df39cb03b59d8c033005e8e9dc45a260dd
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Build Platform: Fedora34@X64, Branch:master, bibisect-linux-64-7.4-CN
Calc: threaded

Fedora 34 x64, Gnome 40.4, Wayland.

In my opinion this commit (4812c8df3) should be reverted ASAP.
Comment 4 Xisco Faulí 2021-12-17 09:57:05 UTC
(In reply to Kevin Suo from comment #3)
> This has caused a series of serious regressions:
> 
> 1. Now in Calc, if I click cell a cell (e.g. C1), the cell focus is still in
> cell A1, although the Name Box shows the new cell address (e.g. C1).
> 
> 2. Now it is now possible to select text, either in Calc or in Writer, 
> 
> 3. Now if I insert a text box in Writer or Draw and type, the text typed is
> not visible until I put focus to anther place. Even worse, in Writer if I
> insert a text box and type, it is now impossible to exit from the text box.
> 
> 4. It is now impossible to scroll up and down the view using the mouse wheel
> in Calc or Writer.
> 
> 5. .... I think there are more issues.
> 
> git bisect log:
> 
> # good: 2021-12-15 10:19:57 source-hash-3769508f4
> # bad: 2021-12-15 12:09:42 source-hash-4812c8df3
> 
> Version: 7.4.0.0.alpha0+ / LibreOffice Community
> Build ID: 4812c8df39cb03b59d8c033005e8e9dc45a260dd
> CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: gtk3
> Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
> Build Platform: Fedora34@X64, Branch:master, bibisect-linux-64-7.4-CN
> Calc: threaded
> 
> Fedora 34 x64, Gnome 40.4, Wayland.
> 
> In my opinion this commit (4812c8df3) should be reverted ASAP.

Confirmed in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 57ad86fec9e5b4981332392bdb5c5a1f5e468bfe
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 5 Xisco Faulí 2021-12-17 10:00:40 UTC
(In reply to Kevin Suo from comment #3)

> In my opinion this commit (4812c8df3) should be reverted ASAP.

https://gerrit.libreoffice.org/c/core/+/127002
Comment 6 Commit Notification 2021-12-17 11:39:24 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4d396956b06c80bd7ade3825ef1a9fe1e787488c

tdf#146225 Revert "Use g_get_real_time instead of g_get_current_time"

It will be available in 7.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Xisco Faulí 2021-12-17 14:51:08 UTC
the patch was reverted. closing
Comment 8 Kevin Suo 2021-12-17 15:13:36 UTC
(In reply to Xisco Faulí from comment #7)

Reset to NEW - The original bug report (in *this* bug report) was another issue, a patch was committed trying to fix that issue, but caused a regressions, and I commented in *this* bug (sorry).

As a result, the original bug is back after the patch is now reverted.
Comment 9 Hossein 2021-12-17 20:21:05 UTC
(In reply to Kevin Suo from comment #8)
> (In reply to Xisco Faulí from comment #7)
> 
> Reset to NEW - The original bug report (in *this* bug report) was another
> issue, a patch was committed trying to fix that issue, but caused a
> regressions, and I commented in *this* bug (sorry).
> 
> As a result, the original bug is back after the patch is now reverted.

The first commit (489d7298d2e609ee5900f05ba0064845a7a551ce) lead to this specific issue. When fixing a single function in the second patch (4812c8df39cb03b59d8c033005e8e9dc45a260dd), it lead to the issue that you have described in the comment 3. Now both are reverted, and we are back at the previous state of the gtkdata.hxx/gtkdata.cxx, as it was in 4836e15ba980ea3bdccd3c063eb94f52e35646b0.

Could you please explain what issue is still remaining? I no longer experience extra delay when exiting from gtk3 ui. Do you?
Comment 10 Kevin Suo 2021-12-18 05:58:29 UTC
(In reply to Hossein from comment #9)
OK.