Bug 150177 - macOS Wildly blinking cursor and non-visible selection issues
Summary: macOS Wildly blinking cursor and non-visible selection issues
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 beta1+
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:7.6.0 target:7.5.0.2
Keywords:
Depends on:
Blocks: macOS-UI-polish HiDPI
  Show dependency treegraph
 
Reported: 2022-07-27 23:16 UTC by will.brokenbourgh2877
Modified: 2022-12-29 19:07 UTC (History)
6 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 will.brokenbourgh2877 2022-07-27 23:16:42 UTC
With both a long-time prefs folder and newly-created prefs folder (under /Users/user/Library/Application Support), after launching LibreOffice 7.3.5.2 on macOS 12.5 Intel, then after creating a new Writer document, the cursor blinks wildly inside the document and when I attempt to double-click a word or click-drag to select it, the selection does not show up.

On more involved documents, there are artifacts of previous cursor positions and some text also do not show where they are supposed to.

Please see this video for basic information about the issue:

https://www.youtube.com/watch?v=mxzX2dbxZio

Thank you!
Comment 1 Roman Kuznetsov 2022-07-31 15:53:11 UTC
Could you please try this build?

https://dev-builds.libreoffice.org/pre-releases/mac/x86_64/LibreOffice_7.4.0.1_MacOS_x86-64.dmg

I can't repro it in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: d75c5c1f61a174b3b333e9db6536ab15cc37d00b
CPU threads: 4; OS: Mac OS X 12.5; UI render: Skia/Metal; VCL: osx
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: threaded Jumbo
Comment 2 will.brokenbourgh2877 2022-07-31 20:31:53 UTC
(In reply to Roman Kuznetsov from comment #1)
> Could you please try this build?
> 
> https://dev-builds.libreoffice.org/pre-releases/mac/x86_64/LibreOffice_7.4.0.
> 1_MacOS_x86-64.dmg
> 
> I can't repro it in
> 
> Version: 7.5.0.0.alpha0+ / LibreOffice Community
> Build ID: d75c5c1f61a174b3b333e9db6536ab15cc37d00b
> CPU threads: 4; OS: Mac OS X 12.5; UI render: Skia/Metal; VCL: osx
> Locale: ru-RU (ru_RU.UTF-8); UI: en-US
> Calc: threaded Jumbo

Thanks Roman.  The download was just too slow -- it would have taken a very long time.  It was almost at or below dial-up speeds for me.  Is there another place I can download it from?

Thanks! :-)

Will B.
Comment 3 will.brokenbourgh2877 2022-07-31 21:38:21 UTC
(In reply to Roman Kuznetsov from comment #1)
> Could you please try this build?
> 
> https://dev-builds.libreoffice.org/pre-releases/mac/x86_64/LibreOffice_7.4.0.
> 1_MacOS_x86-64.dmg
> 
> I can't repro it in
> 
> Version: 7.5.0.0.alpha0+ / LibreOffice Community
> Build ID: d75c5c1f61a174b3b333e9db6536ab15cc37d00b
> CPU threads: 4; OS: Mac OS X 12.5; UI render: Skia/Metal; VCL: osx
> Locale: ru-RU (ru_RU.UTF-8); UI: en-US
> Calc: threaded Jumbo

Okay, I was able to finally download the pre-release you linked to above.  Just a note, it is *extremely* slow.

It is still the same issue.  The only difference with this pre-release is the cursor / carat does not appear to blink at all now.  The text and selections issues are still there.  This is with both existing *and* non-existing prefs folder.  Here is a screen-record of the latest:

https://www.youtube.com/watch?v=zyteDIR7Ipo
Comment 4 QA Administrators 2022-08-01 03:27:49 UTC Comment hidden (noise)
Comment 5 will.brokenbourgh2877 2022-08-01 04:23:32 UTC
Well, since this is now "Unconfirmed", I'll just leave it open in case someone else experiences this. 

I'm in a bad spot because I can't do any work in LibreOffice on macOS now.  I could dig up an old version of LO and try that, but even older versions had some issues too.

I am forced to move to Linux, for now, because I *have* to get stuff done, LO works fine on Linux and I don't expect the LO devs to perform miracles.

Thanks! :-)
Comment 6 Telesto 2022-08-02 18:24:10 UTC
No issue either
Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 7a89eae97a970939174d59aa58147eaa194acaee
CPU threads: 8; OS: Mac OS X 12.3.1; UI render: Skia/Raster; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 7 Stefan Esser 2022-08-19 17:24:16 UTC
Same issue here. Deleting user profile at ~/Library/Application Support/LibreOffice didn't help. I tried for many hours installing several versions and changed all view options but couldn't resolve it. My MacBook Pro (2017) has a retina display and I connect it to an external 4K display. Switching mac resolution scaling no effect. I thought I was the only one with that problem...
Comment 8 will.brokenbourgh2877 2022-08-19 17:30:03 UTC
(In reply to Stefan Esser from comment #7)
> Same issue here. Deleting user profile at ~/Library/Application
> Support/LibreOffice didn't help. I tried for many hours installing several
> versions and changed all view options but couldn't resolve it. My MacBook
> Pro (2017) has a retina display and I connect it to an external 4K display.
> Switching mac resolution scaling no effect. I thought I was the only one
> with that problem...

Well it's good to know that I'm not imagining it. ;-)

I have tried all that you have, and also tried the different graphical system in LO Settings, to no avail.  I really cannot even begin to know the underlying issue, but it really is the *only* app on macOS that misbehaves like this.

Moderators, does this mean this issue is no longer 'Unconfirmed'?

Thanks! :-)
Comment 9 Roman Kuznetsov 2022-08-23 08:53:16 UTC
Set to NEW by Comment 7

But we still need someone from devs who can repro it

Possibly it's HiDPI only problem?
Comment 10 will.brokenbourgh2877 2022-08-23 15:52:54 UTC
(In reply to Roman Kuznetsov from comment #9)
> Possibly it's HiDPI only problem?

I'm not thinking it is.  I have only a standard monitor with 1920x1200 resolution, unless macOS is doing something weird behind the scenes?
Comment 11 will.brokenbourgh2877 2022-09-14 08:00:13 UTC
I have made some interesting progress on this...

I also have a Mac mini 2012 which I have also discovered has the wildly blinking caret.  After painstaking troubleshooting, I think I have found the culprit!

When I temporarily moved the following file from the Preferences folder:
/Users/user/Library/Preferences/.GlobalPreferences.plist
then start LibreOffice, the cursor now blinks properly!

I went further and found that one particular property was the cause of it:
Key: NSTextInsertionPointBlinkPeriodOff  Type: Number  Value: 0
When I deleted this key from the .GlobalPreferences.plist file, LibreOffice now behaves, and I can type, double-click and select text and it now works properly!

Can anyone else having this issue verify this?

Dear LO devs, can you see why this setting would cause LibreOffice to misbehave so badly?  NO other apps had any problem with this, including Page, OpenOffice, Text Edit, Firefox, Thunderbird, Geany, etc.

Hope this helps! :-)
Comment 12 Stefan Esser 2022-09-14 11:27:31 UTC
(In reply to will.brokenbourgh2877 from comment #11)
> I have made some interesting progress on this...
> 
> I also have a Mac mini 2012 which I have also discovered has the wildly
> blinking caret.  After painstaking troubleshooting, I think I have found the
> culprit!
> 
> When I temporarily moved the following file from the Preferences folder:
> /Users/user/Library/Preferences/.GlobalPreferences.plist
> then start LibreOffice, the cursor now blinks properly!
> 
> I went further and found that one particular property was the cause of it:
> Key: NSTextInsertionPointBlinkPeriodOff  Type: Number  Value: 0
> When I deleted this key from the .GlobalPreferences.plist file, LibreOffice
> now behaves, and I can type, double-click and select text and it now works
> properly!
> 
> Can anyone else having this issue verify this?
> 
> Dear LO devs, can you see why this setting would cause LibreOffice to
> misbehave so badly?  NO other apps had any problem with this, including
> Page, OpenOffice, Text Edit, Firefox, Thunderbird, Geany, etc.
> 
> Hope this helps! :-)

Yes, this really helps a lot! I was nearly giving up and was thinking about running LO in a virtual machine. 
But after deleting the key with the command "defaults delete .GlobalPreferences.plist NSTextInsertionPointBlinkPeriodOff" in the folder "Preferences", LibreOffice finally behaves normally!
Caret blinks as it should, text selection works and also screen refresh after zooming. All good now!

Thanks a lot!!!
Comment 13 will.brokenbourgh2877 2022-09-14 17:18:38 UTC
Okay LO devs, it appears the issue is here:

vcl/osx/salframe.cxx on line 103 in function
AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle )

The code seems to just be blindly accepting whatever is in the defaults instead of validating it.  I recommend adding sanity checks before assigning something as important as the blink time.

(Sorry, don't know how to add code tags to these reports)

- - - - -
    mpParent = dynamic_cast<AquaSalFrame*>(pParent);

    initWindowAndView();

    SalData* pSalData = GetSalData();
    pSalData->mpInstance->insertFrame( this );
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    if (userDefaults != nil)
    {
        id setting = [userDefaults objectForKey: @"NSTextInsertionPointBlinkPeriodOn"];
        if (setting)
            mnBlinkCursorDelay = [setting intValue];
        else
        {
            setting = [userDefaults objectForKey: @"NSTextInsertionPointBlinkPeriodOff"];
            if (setting)
                mnBlinkCursorDelay = [setting intValue];
        }
    }
- - - - -
Comment 14 Telesto 2022-09-14 17:24:20 UTC
@Xisco
(In reply to will.brokenbourgh2877 from comment #13)
> Okay LO devs, it appears the issue is here:
> 
> vcl/osx/salframe.cxx on line 103 in function
> AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags
> salFrameStyle )
> 
> The code seems to just be blindly accepting whatever is in the defaults
> instead of validating it.  I recommend adding sanity checks before assigning
> something as important as the blink time.
> 
> (Sorry, don't know how to add code tags to these reports)
> 
> - - - - -
>     mpParent = dynamic_cast<AquaSalFrame*>(pParent);
> 
>     initWindowAndView();
> 
>     SalData* pSalData = GetSalData();
>     pSalData->mpInstance->insertFrame( this );
>     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
>     if (userDefaults != nil)
>     {
>         id setting = [userDefaults objectForKey:
> @"NSTextInsertionPointBlinkPeriodOn"];
>         if (setting)
>             mnBlinkCursorDelay = [setting intValue];
>         else
>         {
>             setting = [userDefaults objectForKey:
> @"NSTextInsertionPointBlinkPeriodOff"];
>             if (setting)
>                 mnBlinkCursorDelay = [setting intValue];
>         }
>     }
> - - - - -
Comment 15 Xisco Faulí 2022-09-15 08:15:04 UTC
Hello will.brokenbourgh2877,
Could you please submit a patch to gerrit ( the platform we use to review and discuss patches )? More info in https://wiki.documentfoundation.org/Development/gerrit
Comment 16 will.brokenbourgh2877 2022-09-15 15:47:57 UTC
(In reply to Xisco Faulí from comment #15)
> Hello will.brokenbourgh2877,
> Could you please submit a patch to gerrit ( the platform we use to review
> and discuss patches )? More info in
> https://wiki.documentfoundation.org/Development/gerrit

I will try, but compiling all of LO may be a challenge for me.  I will comment here if successful.

Thanks! :-)
Comment 17 will.brokenbourgh2877 2022-09-15 18:01:19 UTC
(In reply to Xisco Faulí from comment #15)
> Hello will.brokenbourgh2877,
> Could you please submit a patch to gerrit ( the platform we use to review
> and discuss patches )? More info in
> https://wiki.documentfoundation.org/Development/gerrit

After viewing the gerrit information, it looks a little too complicated for a simple person such as myself.  I suffered a number of physical injuries and issues in the past which often limits my mental abilities.  I _am_ the author of a couple of open-source projects, but they just use Makefiles and the projects are small enough where I can just go to a line of code and fix it without needing patches.

Given that this issue was only reported by me and Stefan, it doesn't look like it affects too many other people.  If anyone else does come across it, hopefully the information in this bug report will help others.

Thank you! :-)
Comment 18 Telesto 2022-12-22 15:28:47 UTC
@Patrick
Only a nudge :-). Feel free the ignore if uninterested (it's a bit of corner case). The problem here has been identified (comment 11) and a patch proposal suggested (comment 13), it 'only' needs someone checking the patch & pushes the patch to gerrit.
Comment 19 Patrick (volunteer) 2022-12-22 20:02:56 UTC
(In reply to Telesto from comment #18)
> @Patrick
> Only a nudge :-). Feel free the ignore if uninterested (it's a bit of corner
> case). The problem here has been identified (comment 11) and a patch
> proposal suggested (comment 13), it 'only' needs someone checking the patch
> & pushes the patch to gerrit.

I have implemented a minimum blink rate of 500 milliseconds in the code identified in comment 13 in the following patch:

https://gerrit.libreoffice.org/c/core/+/144775

In the above patch, I set the blink rate to the maximum of
500 milliseconds, NSTextInsertionPointBlinkPeriodOn, and
NSTextInsertionPointBlinkPeriodOff.

The patch needs still needs to be reviewed and tested before it appears in a nightly build. But if there any people who have a macOS LibreOffice build that can test the patch, that would be very much appreciated.
Comment 20 Commit Notification 2022-12-23 13:49:08 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1b6acdc60bc284c3e78bb05f70c24a2e36b2ccc7

tdf#150177 Limit minimum blink cursor rate

It will be available in 7.6.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 21 Commit Notification 2022-12-26 15:57:07 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/e6ffb550a948ff1fdfb411d89013b265995ed387

tdf#150177 Limit minimum blink cursor rate

It will be available in 7.5.0.2.

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 22 will.brokenbourgh2877 2022-12-29 19:07:03 UTC
While I'm not on macOS for now, I really appreciate this being fixed.  Thank you all for your hard work and contributions! :-D