Opened 6 years ago

Last modified 6 years ago

#14767 assigned bug

Mail app briefly blocks window in some circumstances

Reported by: anevilyak Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: Applications/Mail Version: R1/Development
Keywords: Cc: humdinger
Blocked By: Blocking:
Platform: All

Description (last modified by anevilyak)

When a new mail window is opened via the mail app, certain timing circumstances can briefly cause window drawing to block for a second or so on start. This is due to the following set of circumstances:

  • Spell check is enabled.
  • When the window is started, it checks this setting and immediately posts a spell check BMessage if so.
  • After being shown, said message is processed. The first thing it does is check if the application object has already loaded the dictionaries. If not, it then initiates a 1.5 second snooze [1] (!) on the window looper to wait for that. This may or may not occur depending on how quickly the dictionary load occurs, so this behavior is somewhat non-deterministic.

There are numerous problems here:

  • The check simply looks if any dictionary whatsoever has been loaded, which doesn't necessarily guarantee that it's the one for the correct language.
  • Obviously blocking the window this way is a no-no. Multiple possible solutions present themselves there: 1) the window could instead create a message runner to resend the message with a delay, and check again then rather than blocking, or preferably 2) Something could be put in place where the app notifies windows of dictionaries coming available via an observer notice, which could then cause the spell check to be initiated. Other solutions are entirely possible of course.

Note that this problem appears to originate from the original import of the MDR code in 2004.

[1] https://git.haiku-os.org/haiku/tree/src/apps/mail/MailWindow.cpp#n1661

Change History (4)

comment:1 by anevilyak, 6 years ago

Description: modified (diff)

comment:2 by anevilyak, 6 years ago

Owner: changed from czeidler to axeld
Status: newassigned

Reassigning to Axel since he's most recently been involved in any Mail-related code.

comment:3 by anevilyak, 6 years ago

Cc: humdinger added

comment:4 by anevilyak, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.