Skip to content

537 pointer can get stuck on "loading" (use onCleanup hooks to restore pointer)#536

Open
martinherrerias wants to merge 1 commit into
masterfrom
fix-restore-pointer-on-error
Open

537 pointer can get stuck on "loading" (use onCleanup hooks to restore pointer)#536
martinherrerias wants to merge 1 commit into
masterfrom
fix-restore-pointer-on-error

Conversation

@martinherrerias

@martinherrerias martinherrerias commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Issue, with steps to reproduce: #537

There are several places in the code that use the pattern:

set(H,'pointer', 'watch');
% do stuff
set(H, 'pointer', 'arrow');

If there's an error in the middle, the pointer restore action is never reached, and the pointer gets stuck in the watch icon. The user gets the feeling that the app is still processing a command, but it is actually waiting for a new user action.

Approach

Replaced some (see note below) of these occurrences with the pattern:

set(H,'pointer', 'watch');
restore_object = onCleanup(@() set(H, 'pointer', 'arrow'));
% do stuff

The onCleanup hook is executed upon deletion of the restore_object, regardless of whether this is due to an error, or successful execution of the rest of the code in the scope.

Note

There are other uses of set(H,'pointer',...) which I haven't touched:

  • External/NIfTI_20140122/* - mostly around view_nii, which seems unused?
  • External/imtool3D* - more complex use of the pointer, so it requires more careful analysis (also seems better managed)

Open Questions and Pre-Merge TODOs

  • Use github checklists. When solved, check the box and explain the answer.

  • Review that changed source files/lines are related to the pull request/issue
    If any files/commits were accidentally included, cherry-pick them into another branch.

  • Review that changed source files/lines were not accidentally deleted
    Fix appropriately if so.

  • Test new features or bug fix
    If not implemented/resolved adequately, solve it or inform the developer by requesting changes in your review.
    Preferably, set breakpoints in the locations that the code was changed and follow allong line by line to see if the code behaves as intended.

Manual GUI tests (general)
  • Does the qMRLab GUI open?
  • Can you change models?
  • Can you load a data folder for a model?
  • Can you view data?
  • Can you zoom in the image?
  • Can you pan out of the image?
  • Can you view the histogram of the data?
  • Can you change the color map?
  • Can you fit dataset (Fit data)?
  • Can you save/load the results?
  • Can you open the options panel?
  • Can you change option parameters?
  • Can you save/load option paramters?
  • Can you select a voxel?
  • Can you fit the data of that voxel ("View data fit")?
  • Can you simulate and fit a voxel ("Single Voxel Curve")?
  • Can you run a Sensitivity Analysis?
  • Can you simulate a Multi Voxel Distribution?
Specifications
  • Version:
  • Platform:
  • Subsystem:

There are other uses of set(H,'pointer',...) which I haven't touched:
- External/NIfTI_20140122/* - code seems unused?
- External/imtool3D* - more complex use, seems better managed
@martinherrerias martinherrerias changed the title fix: use onCleanup hooks to restore pointer fix: cursor can get stuck on "loading" (use onCleanup hooks to restore pointer) May 11, 2026
@martinherrerias martinherrerias changed the title fix: cursor can get stuck on "loading" (use onCleanup hooks to restore pointer) fix: pointer can get stuck on "loading" (use onCleanup hooks to restore pointer) May 11, 2026
@martinherrerias martinherrerias linked an issue May 11, 2026 that may be closed by this pull request
@martinherrerias martinherrerias changed the title fix: pointer can get stuck on "loading" (use onCleanup hooks to restore pointer) 537 pointer can get stuck on "loading" (use onCleanup hooks to restore pointer) May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pointer can get stuck on "loading"

1 participant