Forum > Cocoa

Screen.Cursor does not work as expected

(1/3) > >>

apeoperaio:
I encountered an issue related to Screen.Cursor on macOS Ventura (13.0.1):
Lazarus 2.2.5 (rev lazarus_2_2_4-3-g564e1e8244) FPC 3.2.0 x86_64-darwin-cocoa

Setting the cursor using Screen.Cursor does not always work.
You can reproduce the issue using the attached project.
This test project includes a single form with a custom control and a button. The OnClick events of the button and the custom control just switch Screen.Cursor between crDefault and crHourglass.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if Screen.Cursor = crHourGlass then    Screen.Cursor:= crDefault  else    Screen.Cursor:= crHourGlass; 
The previous code works on windows but not on macOS (Ventura), after the first click the cursor is set to crHourglass, but if I click again the Cursor still remains crHourglass.

I tested it on 2 different computers, both with macOS Ventura, I cannot test it on previous macOS versions.

Am I doing something wrong?

apeoperaio:
Maybe related to this closed issue?
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/20313

han:
I have the same problem with my application. It works under Big Sur but not under Ventura. I can't test it because I only have Big Sur but it was reported by users. Does the following instruction help??:

form1.cursor:=crDefault;

Han

han:
The test application works on Big Sur. Both the form and button allow to toggle between normal and wait cursor.

Han

apeoperaio:

--- Quote from: han on December 29, 2022, 09:25:44 pm ---Does the following instruction help??:

form1.cursor:=crDefault;

Han

--- End quote ---

Tested, but it does not work

Navigation

[0] Message Index

[#] Next page

Go to full version