Recent

Author Topic: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible - Raspberry Pi 3  (Read 10379 times)

ertank

  • Sr. Member
  • ****
  • Posts: 274
Hello,

I am using Lazarus mainly on Raspberry Pi - Jessie (Linux raspberrypi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux).

I have no problem after a reboot of the OS. I start working with Lazarus and after a while I see no cursor on the Editor window. I can still type, delete, select, etc. I can see my column and row numbers are changing when moving the cursor in editor file. I simply cannot see my cursor blinking.

I could not understand how exactly problem happens. However, it happens like always after a while. Setting Option "Always visible cursor" did not help me.

Problem is only with Lazarus Editor. Switching to a browser of a TextEditor, and I can see my cursor blinking in there.

My searches in the internet did not help much. I feel like I am the only person having such a problem. Therefore, I wanted to give it a try making my problem public.

Are there anybody out there having such a problem of cursor not visible? If yes, do you have a solution?

As I do not know how to reproduce the problem, I cannot post a bug report about this in mantis which also makes me feel like I need to live with it.

Any help is appreciated.

Thanks & regards,
Ertan
« Last Edit: November 01, 2017, 07:48:54 pm by ertank »

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #1 on: July 30, 2017, 01:21:39 pm »
I am currently using linux-arm: it does not have the problem. Yesterday I was on win64: it dd not have the problem. I am using trunk, though (1.9, with FPC trunk r36814)
Specialize a type, not a var.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #2 on: July 30, 2017, 01:50:42 pm »
Did you use other versions of Lazarus in the past? e.g. 1.6.4 ?
Did the problem happen with any of them?


Please (re-)compile your IDE with the following settings:
-Criot -gh -gw -gttt -Sa -O-

Start your IDE from a console/shell and set the environment
HEAPTRC="keepreleased"

Note the HEAPTRC="keepreleased"  will eat a lot of memory over time, and you may only be able to run for a short time.
If that is the case, then skip setting it.

If you run from console, you should see some output there. If there are any stacktraces, then copy them and past them here.
If you do not run from console, use lazarus --debug-log=/home/yourname/laz.log or similar.

If the issue goes away, the recompile and change the settings to
-Criot -gh -gw -gttt -Sa -O1

and again test, and if ok increase the last bit to -O2 and then -O3

-------------------------------
When you have the IDE in a state that fails, go to menu: tools > options, then page: Editor > Display > Markup and Matches
and disable "Outline (global)

-------------------------------
RC1 had a similar issue, the caret was shown, but at a wrong location. But I thought it was fixed / I had no feedback though.

ertank

  • Sr. Member
  • ****
  • Posts: 274
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #3 on: July 30, 2017, 02:22:48 pm »
Did you use other versions of Lazarus in the past? e.g. 1.6.4 ?
Did the problem happen with any of them?
I started to use Lazarus on Raspberry with 1.8.0RC1

Please (re-)compile your IDE with the following settings:
-Criot -gh -gw -gttt -Sa -O-
Do you mean to use a command line like below to (re)-compile?
Code: [Select]
make bigide -Criot -gh -gw -gttt -Sa -O-

Start your IDE from a console/shell and set the environment
HEAPTRC="keepreleased"

Note the HEAPTRC="keepreleased"  will eat a lot of memory over time, and you may only be able to run for a short time.
If that is the case, then skip setting it.
I think I do not want to try this before trying re-compiling and saving a log file.

If you run from console, you should see some output there. If there are any stacktraces, then copy them and past them here.
If you do not run from console, use lazarus --debug-log=/home/yourname/laz.log or similar.
I do run from console. However, it is not possible to read output easily. Making Lazarus keeping a log file would be more convenient.

If the issue goes away, the recompile and change the settings to
-Criot -gh -gw -gttt -Sa -O1

and again test, and if ok increase the last bit to -O2 and then -O3
I hope to have it fixed by recompiling or else, I presume checking log file will be a pain.

-------------------------------
When you have the IDE in a state that fails, go to menu: tools > options, then page: Editor > Display > Markup and Matches
and disable "Outline (global)
You above suggestions, I will be looking at them if  I can find a point it works & another point where it doesn't.

-------------------------------
RC1 had a similar issue, the caret was shown, but at a wrong location. But I thought it was fixed / I had no feedback though.
Maybe that's it. Assuming that caret is shown in a location so wrong that I cannot even see it.

BTW, What I could find is basically below link about the situation. If that rings anything to anybody.
http://lists.lazarus.freepascal.org/pipermail/lazarus/2008-August/037756.html

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #4 on: July 30, 2017, 04:41:35 pm »
Quote
Do you mean to use a command line like below to (re)-compile?
Code: Pascal  [Select][+][-]
  1. make bigide -Criot -gh -gw -gttt -Sa -O-

I think it is more like
Code: Pascal  [Select][+][-]
  1. make bigide OPT="-Criot -gh -gw -gttt -Sa -O-"

Not 100% sure, I usually build via the tools menu.
There is an entry "configure build lazarus", where you can set the options, and start the compile


Quote
I do run from console. However, it is not possible to read output easily. Making Lazarus keeping a log file would be more convenient.
Then use the --debug-log=file option

Quote
I hope to have it fixed by recompiling or else, I presume checking log file will be a pain.
you would just be looking for something like
Code: Pascal  [Select][+][-]
  1. Stack trace:
  2.   $00439E86
  3.   $00439E33
  4.   $004D47C4  TCONTROL__CLICK,  line 2251 of ./include/control.inc
  5.   $0050391F  TBUTTONCONTROL__CLICK,  line 62 of ./include/buttoncontrol.inc
  6.   $00503E46  TCUSTOMBUTTON__CLICK,  line 174 of ./include
should not be too hard to spot.
Then post it to the forum (or IF the log has a trace, attach the whole log)


---
For reference, the RC1 I refered to:
http://forum.lazarus-ide.org/index.php/topic,36907.msg246796.html#msg246796

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #5 on: July 30, 2017, 04:50:16 pm »
Quote
Problem is only with Lazarus Editor. Switching to a browser of a TextEditor, and I can see my cursor blinking in there.
Yes Lazarus paints its own caret (cursor). So this is nothing to do with the system caret.

I assume, that restarting the IDE fixes the issue (temporarily)?

ertank

  • Sr. Member
  • ****
  • Posts: 274
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #6 on: July 30, 2017, 07:29:32 pm »
Oddly enough, restarting the IDE is not fixing my problem.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #7 on: July 30, 2017, 08:56:34 pm »
This is really odd.

The caret is just a paint operation (paint xor).
So I assumed that if it is not painted, then something in the IDE gets corrupted. But that would be fixed by a restart.

If it persists, then it is likely that none of my suggestion will help at all. (They were mostly to track memory corruption)

Something must be allocating a resource from the OS. Or otherwise affecting the OS.
Unfortunately not my area of expertise.

Are you using gtk or qt?

You can try this.
Open the file components\synedit\syneditpointclasses.pas
go to line 2885

Code: Pascal  [Select][+][-]
  1. procedure TSynEditScreenCaretPainterInternal.Init;
  2. begin
  3.   {$IFDEF LCLCarbon}
  4.     FForcePaintEvents := True;
  5.   {$ELSE}
  6.   {$IF DEFINED(LCLQt) OR DEFINED(LCLQt5)}
  7.     FForcePaintEvents := True;
  8.   {$ELSE}
  9.     FForcePaintEvents := False;
  10.   {$ENDIF}
  11.   {$ENDIF}
  12.  
  13.     FForcePaintEvents := True; // insert this line, always TRUE
  14.  
  15.   FSavePen := TPen.Create;
  16.   FColor := clBlack;
  17.   FOldY := -1;
  18.   FCanPaint := True;
  19.   inherited Init;
  20. end;

Save the file with the added line.
Recompile the IDE

And hope for the best.

------------
Or try this / not recommended. ( it disables the multi caret mode)
open ide\sourcesyneditor.pas
line 1660...
Code: Pascal  [Select][+][-]
  1. constructor TIDESynEditor.Create(AOwner: TComponent);
  2. var
  3.   MarkupFoldColors: TSynEditMarkupFoldColors;
  4. begin
  5.   inherited Create(AOwner);
  6.   FUserWordsList := TFPList.Create;
  7.   FTemplateEdit:=TSynPluginTemplateEdit.Create(Self);
  8.   FSyncroEdit := TSynPluginSyncroEdit.Create(Self);
  9.   FMultiCaret := TSynPluginMultiCaret.Create(Self);
  10.   FMultiCaret.MouseActions.Clear; // will be added to SynEdit
  11.   FMultiCaret.KeyStrokes.Clear;
  12.  

replace "Self" with "nil" / this will leak some memory....
(or edit the entire file, and remove all stuff to do with FMultiCaret)

Not sure, not tested.

ertank

  • Sr. Member
  • ****
  • Posts: 274
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #8 on: July 30, 2017, 09:09:13 pm »
As expected, recompiling did not succeed. My log file is below and I do not see any cursor at the time Lazarus loads.
Code: [Select]
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/pi/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=arm-linux-gtk2 New=arm-linux-gtk2 FPC=True LCL=False
TComponentTreeView.SetSelection: Updating component node values.
FindMissingClass DB:TZConnection IsInherited=False
FindMissingClass qry:TZQuery IsInherited=False
FindMissingClass qryOnayHicSayimVarMi:TZReadOnlyQuery IsInherited=False
FindMissingClass ZSQLMonitor1:TZSQLMonitor IsInherited=False
FindMissingClass sqlErrorInsert:TZSQLProcessor IsInherited=False
TLazSourceFileManager.LoadLFM loading nested class TZSQLProcessor needed by /home/pi/myprojectudata.pas
TLazSourceFileManager.LoadComponentDependencyHidden /home/pi/myproject/udata.pas AComponentClassName=TZSQLProcessor AComponentClass=nil AncestorClass=nil LFMFilename=
NOTE: Window with stalled focus found!, faking focus-out event
TLazSourceFileManager.LoadLFM DoLoadComponentDependencyHidden NestedClassName=TZSQLProcessor failed for /home/pi/myproject/udata.pas
NOTE: Window with stalled focus found!, faking focus-out event
LAZARUS END - cleaning up ...
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END
Ont thing that might give an idea is maybe that NOTE lines. Have no idea though.

As you can see above, I am using gtk2.

Will try your source modifications (only the first modification) and see if helps.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #9 on: July 30, 2017, 09:35:07 pm »
DO NOT modify. You say you are using a Raspberry Pi?
A proper install on Raspbian should work. It never failed me.

If you want I can prepare a tar for you.

BTW: Is your Raspbian up to date?
Code: [Select]
sudo apt-get update && sudo apt-get dist-upgrade -y
1) Note you need a swap file for Lazarus to compile to a finish (about the same as the memory will do so 1024)
2) Ignore notes and warnings... they are not for you...yet... >:D


Written on a ff'ng Raspberry Pi 3B. (Laz 1.9/fpc311 from today)
[edit] RC3 does not have the problem either....I just tested.
« Last Edit: July 30, 2017, 09:57:01 pm by Thaddy »
Specialize a type, not a var.

ertank

  • Sr. Member
  • ****
  • Posts: 274
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #10 on: July 30, 2017, 09:59:51 pm »
Hi Thaddy,

I believe it is about a month or less than two since I updated my whole system.
Code: [Select]
Linux raspberrypi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
I do not know how to get installed package names with their versions. Not a hardcode Linux user I am.

If my memory serves me right, I have this problem for about 3 months (since I begin developing that Raspberry application). It is just today I have posted it in the forum. Just had enough of it probably.

I can build lazarus just fine. I have a 1000Mb swap file. I meant suggestion failed on me. Sorry for the confusion.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #11 on: July 30, 2017, 10:34:53 pm »
Linux raspberrypi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux?

That's old.

Upgrade:
sudo apt-get update && sudo apt-get dist-upgrade -y

You will be much happier (and safer)...

Anyway, if you still have the issue tomorrow I can prepare a package.
Specialize a type, not a var.

ertank

  • Sr. Member
  • ****
  • Posts: 274
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #12 on: July 30, 2017, 11:17:23 pm »
You can try this.
Open the file components\synedit\syneditpointclasses.pas
go to line 2885

Code: Pascal  [Select][+][-]
  1. procedure TSynEditScreenCaretPainterInternal.Init;
  2. begin
  3.   {$IFDEF LCLCarbon}
  4.     FForcePaintEvents := True;
  5.   {$ELSE}
  6.   {$IF DEFINED(LCLQt) OR DEFINED(LCLQt5)}
  7.     FForcePaintEvents := True;
  8.   {$ELSE}
  9.     FForcePaintEvents := False;
  10.   {$ENDIF}
  11.   {$ENDIF}
  12.  
  13.     FForcePaintEvents := True; // insert this line, always TRUE
  14.  
  15.   FSavePen := TPen.Create;
  16.   FColor := clBlack;
  17.   FOldY := -1;
  18.   FCanPaint := True;
  19.   inherited Init;
  20. end;

Save the file with the added line.
Recompile the IDE

Above is kind of an improvement. When re-starting after having a cursor not visible problem, I sometimes have a cursor.

ertank

  • Sr. Member
  • ****
  • Posts: 274
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #13 on: July 31, 2017, 11:52:45 am »
I have updated Raspberry Pi to latest last night. I read that there are very minor changes for gtk2 libraries.

I have re-compiled Lazarus with default source codes from SVN with using "make bigide" and no additional parameters. Unfortunately, same problem continues. Cursor is visible at first. After a while, it vanishes. Although, I see that after updating my operating system cursor is visible after each run of Lazarus. It simply disappears after sometime of usage.

One last thing I would like to try is to use Lazarus with sources from trunk.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 1.8.0RC3 - IDE Editor - Cursor not visible
« Reply #14 on: July 31, 2017, 02:46:26 pm »
You may try the

I don't think  it FForcePaintEvents  again.

----
You may also try to compile with
  -dSynCaretDebug
and run a logfile.
The close the IDE as soon as the caret disappears, and post the logfile here.

----
I am not sure either will do much good, but...

 

TinyPortal © 2005-2018