View Issue Details

IDProjectCategoryView StatusLast Update
0019283LazarusLCLpublic2021-04-21 21:56
ReporterAndrey Zubarev Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version0.9.31 (SVN) 
Summary0019283: Cursor:=crNone and modal forms
Descriptiondivide issue 0018874 in the second part of the issue it has not received attention

If the main window set Cursor:=crNone and draw the cursor itself, then during the show Application.messagebox or OtherForm.showmodal cursor is not displayed on main window. In win32 it works fine, the cursor appears

TagsNo tags attached.
Fixed in Revision
WidgetsetGTK 2
Attached Files


child of 0018874 closedZeljan Rikalo Application.messagebox issue 


Juha Manninen

2011-05-06 10:24

developer   ~0048078

Could you please add a test project demonstrating the problem.

2011-05-07 07:20 (129,052 bytes)

Andrey Zubarev

2011-05-07 07:26

reporter   ~0048102

Example added. After pressing button1 the cursor is visible only over the button and over the messagebox

Juha Manninen

2011-05-07 10:24

developer   ~0048103

Last edited: 2011-05-07 10:28

Yes but Form1.Cursor is set to crNone intentionally.
You could make it visible like this:

procedure TForm1.Button1Click(Sender: TObject);
  application.MessageBox('please, click on main form','test',MB_YESNO);

I tested with both GTK2 and QT.
GTK2 has problems with z-order as mentioned in the related issue. It works with QT.

QT doesn't show cursor even on the button which should have crDefault cursor. That works with GTK2.

QT's canvas does not work. Is it a known issue?

Andrey Zubarev

2011-05-07 10:46

reporter   ~0048105

Last edited: 2011-05-07 10:57

>>You could make it visible like this:
I know it and so do. But I think it's better to do it within the LCL, to organize behavior as win. Not every piece of program (which shows the modal window) is aware of all the windows without the cursor (there may be many).

>>QT's canvas des not work. Is it a known issue?
No, I'm using only GTK2 and Windows. instead of canvas using TOpenGLControl, which so far does not support the QT((

Zeljan Rikalo

2011-12-06 18:32

developer   ~0054749

I would like to close this as "won't fix". This is how X11 operates .. so it's bit different from win. I don't have idea how to fix this inside LCL, maybe BUT maybe this can be fixed in widgetset code when calling such dialogs (promptUser,AskUser etc), but what about modal forms etc etc ?

Zeljan Rikalo

2012-01-07 11:41

developer   ~0055542

@Andrey, can you retest against r34635 ? Cursor handling is changed under gtk2 ...and now gtk2 and qt shows same behaviour with your example.

Andrey Zubarev

2012-01-07 12:20

reporter   ~0055547

No, left the old behavior. The cursor is not visible in qt and gtk2((

KDE 4.7.97 (4.8 RC2 (4.7.97)
Lazarus 0.9.31 r34635 FPC 2.7.1 x86_64-linux-gtk 2

Zeljan Rikalo

2012-01-07 15:24

developer   ~0055550

Last edited: 2012-01-07 15:25

@Andrey, no I cannot back to old behaviour because now it's correct and fixes few issues under gtk2. There's another problem with cursor under qt and gtk2 - seem that parent widget doesn't allow setting cursor for child when it's cursor is crNone (like it is now , so button cursor is crNone always).
Update: what should be correct ? Cursor visible over button but not over form ?

Andrey Zubarev

2012-01-07 21:32

reporter   ~0055564

Correctly - when the cursor is displayed during the show a modal window IMHO. In this example, before clicking the cursor on the form is not shown. after pressing the button should shown on the form.

>>no I cannot back
I'm not asking to return, only saying he did not notice the changes. Sorry for my english

Zeljan Rikalo

2012-01-07 22:00

developer   ~0055567

@Andrey but I see cursor over that modal dialog in gtk2 and qt ? There's only no cursor over button on main form (and I think there should be cursor if button.Cursor <> crNone .. but it isn't).

Andrey Zubarev

2012-01-09 09:04

reporter   ~0055607

Yes, Cursor: = crNone made ​​myself, and it seems logical that he would not see. But that kind of logic at the time of the show a modal window is nothing but difficulties of positioning does not. It turns any piece of program to show the message (or any modal window) needs to know where the cursor is turned off and turn it on.
It turns out instead:
I have to do:
 uses ....mainform,....;//big trouble that wants to avoid

Bart Broersma

2014-05-01 14:27

developer   ~0074710

Could you please retest with r43447?
It shows/restores screen cursor before/after each ShowModal.

Andrey Zubarev

2014-05-08 17:53

reporter   ~0074855

Test on Lazarus 1.3 r42923:44973M FPC 2.7.1 x86_64-linux-qt (qt&gtk2)

Cursor with ShowModal or Application.MessageBox not shown((

Andrey Zubarev

2021-04-21 21:56

reporter   ~0130503

Please resolve this as no change required

Issue History

Date Modified Username Field Change
2011-05-04 08:13 Andrey Zubarev New Issue
2011-05-04 08:13 Andrey Zubarev Widgetset => GTK 2
2011-05-06 10:24 Juha Manninen LazTarget => -
2011-05-06 10:24 Juha Manninen Note Added: 0048078
2011-05-06 10:24 Juha Manninen Status new => feedback
2011-05-07 07:20 Andrey Zubarev File Added:
2011-05-07 07:26 Andrey Zubarev Note Added: 0048102
2011-05-07 09:50 Juha Manninen Relationship added child of 0018874
2011-05-07 10:24 Juha Manninen Note Added: 0048103
2011-05-07 10:28 Juha Manninen Note Edited: 0048103
2011-05-07 10:46 Andrey Zubarev Note Added: 0048105
2011-05-07 10:47 Andrey Zubarev Note Edited: 0048105
2011-05-07 10:57 Andrey Zubarev Note Edited: 0048105
2011-12-06 18:32 Zeljan Rikalo Note Added: 0054749
2011-12-06 18:32 Zeljan Rikalo Status feedback => acknowledged
2012-01-07 11:41 Zeljan Rikalo Note Added: 0055542
2012-01-07 11:41 Zeljan Rikalo Status acknowledged => feedback
2012-01-07 12:20 Andrey Zubarev Note Added: 0055547
2012-01-07 15:24 Zeljan Rikalo Note Added: 0055550
2012-01-07 15:25 Zeljan Rikalo Note Edited: 0055550
2012-01-07 21:32 Andrey Zubarev Note Added: 0055564
2012-01-07 22:00 Zeljan Rikalo Note Added: 0055567
2012-01-09 09:04 Andrey Zubarev Note Added: 0055607
2012-02-04 11:08 Zeljan Rikalo LazTarget - => 1.2
2012-03-15 13:13 Vincent Snijders Status feedback => acknowledged
2014-01-14 15:16 Martin Friebe LazTarget 1.2 => 1.4
2014-05-01 14:27 Bart Broersma Note Added: 0074710
2014-05-01 14:27 Bart Broersma Status acknowledged => feedback
2014-05-08 17:53 Andrey Zubarev Note Added: 0074855
2014-05-08 17:53 Andrey Zubarev Status feedback => new
2015-04-27 21:59 Juha Manninen LazTarget 1.4 => -
2021-04-21 21:56 Andrey Zubarev Note Added: 0130503