Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cocoa,canvas: fix bezel-cell frame for FocusView #326

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

Bogdanp
Copy link
Contributor

@Bogdanp Bogdanp commented Apr 25, 2024

Fixes #325. The r argument represents the portion of the view that is "dirty", and it seems like it may be larger than the view's frame[1]. It looks like this code was already intending to use the view's frame to draw the bezel, but accidentally used the dirty rect instead.

[1]: At least on recent versions of macOS, which may explain why this isn't a problem when using versions of Racket built on older macOS versions.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 1 file in this pull request and found no issues.

@mflatt mflatt merged commit 3a800c8 into racket:master Apr 25, 2024
3 checks passed
@mflatt
Copy link
Member

mflatt commented Apr 25, 2024

Thanks!!

@shhyou
Copy link
Contributor

shhyou commented May 7, 2024

Did this get into Racket v8.13?

@sorawee
Copy link
Contributor

sorawee commented May 7, 2024

It probably doesn't matter anyway, right? The dmg package is unaffected. It affects only build from source, but in that case you can just pull a fixed version instead.

@shhyou
Copy link
Contributor

shhyou commented May 7, 2024

In our class, we have trouble running big-bang on macOS Sonoma where the big-bang window got incorrectly painted with the content of the Interaction Window. Using the snapshot build fixes it and I am wondering whether the fix of this pull request is relevant.

@mfelleisen
Copy link
Contributor

A problem with big-bang in class would be highly relevant.

  • Is it reproducible?
  • Does it interfere with coding in class?
  • Can you upload a screenshot?

@shhyou
Copy link
Contributor

shhyou commented May 7, 2024

A problem with big-bang in class would be highly relevant.

* Is it reproducible?

On the student's machine (macOS Sonoma, x86_64, Racket CS v8.12), the big-bang window is entirely blank and sometimes it gets painted with the content of the Interaction Window.

This happens consistently at least on that particular machine. I have not checked with others to see if this happens for other people.

* Does it interfere with coding in class?

Sort of, because nothing ever shows up in the big-bang window.

* Can you upload a screenshot?

I'll try to find the student.

@rfindler
Copy link
Member

rfindler commented May 9, 2024

We're considering this as a fix that might need to go into the 8.13 release (which is halfway out the door) or if it can wait for 8.14 (in 3 months, give or take). Do folks have any opinion on this point? @jbclements

@shhyou
Copy link
Contributor

shhyou commented May 9, 2024

Actually, I realize that this is not urgent for v8.13. Assuming that v8.14 is going to be released in August, the fix can make it into Fall quarter/semester.

@jbclements
Copy link
Contributor

I'm seeing somewhat conflicting information about which processors & operating systems are affected. It appears that it's only macOS 14, Sonoma, but is it only x86_64 or does it affect ARM as well?

Also, I'm hoping someone can confirm that this bug was present in 8.12 as well?

The rather visible effect in the preference pane is distressing, to be sure.

@mflatt
Copy link
Member

mflatt commented May 9, 2024

On AArch64, I believe the bug affects only users who build Racket from source. It doesn't affect users who run a release or snapshot distribution. (It's not so much about a release/snapshot being built on an old version of the OS as being built for older versions of the OS by selecting the 11.1 SDK. I have seen this effect one other time: racket/racket@eccc500.)

I am unclear on the status for x86_64. I have seen older release distributions of the x86_64 executable run a big-bang-like program badly on an AArch64 machine via Rosetta, and I had chalked that up to a Rosetta issue, but maybe it was the same bug. In any case, that's not the same as running on an x86_64 Sonoma installation.

@rfindler
Copy link
Member

rfindler commented May 9, 2024

If we're going to test this on a variety of old macs we have lying around, is there a particular program to run that we can compare before/after the fix with?

@shhyou
Copy link
Contributor

shhyou commented May 9, 2024

Here is the code that's not working on the student's machine. With the code in the ZIP file, it should be showing a static, non-moving game. The same code with the snapshot build works.
Exercise 5 Snake.zip (see edit history)

@sorawee
Copy link
Contributor

sorawee commented May 9, 2024

@shhyou just to be clear, did the student build their Racket from source? Or ran Racket via Rosetta?

I don't think "the snapshot build works" tells anything, because the snapshot build has always been working fine (even before this PR).

@shhyou
Copy link
Contributor

shhyou commented May 9, 2024

No, the student uses v8.12 dmg and is on an x86_64 machine.

@jbclements
Copy link
Contributor

@shhyou I'm not sure how to download the code that you posted. I see the text "Exercise 5 Snake.zip (see edit history)", but I'm not sure how to interpret that, or to download the code. I'm also wondering whether it isn't sufficient to run the code that @Bogdanp provided in the bug report, to wit:

#lang racket/gui

(define frame
  (new frame%
       [label "Test"]))

(define msg
  (new message%
       [label "test"]
       [parent frame]))

(define input
  (new text-field%
       [label "test"]
       [parent frame]))

(send frame show #t)

@jbclements
Copy link
Contributor

jbclements commented May 9, 2024

Also, there seems to be some conflict between Matthew's suggestion that this does not affect snapshot or release builds (because they target the 11.1 SDK), and @shhyou 's evidence of a student that is apparently having this problem using the 8.12 release dmg. (EDIT: Okay, I see that Matthew leaves the door open for a different possible behavior on x86_64 systems.)

FWIW, I just tested the release bundle on an x86_64 mac running macOS Monterey (12.7.4), and unsurprisingly, I don't see the problem.

@jbclements
Copy link
Contributor

Okay... I just tried to upgrade my x86_64 mac to Sonoma, and Sonoma simply isn't available for my (2015) x86_64 machine. Ah well.

@shhyou
Copy link
Contributor

shhyou commented May 9, 2024

@shhyou I'm not sure how to download the code that you posted. I see the text "Exercise 5 Snake.zip (see edit history)", but I'm not sure how to interpret that, or to download the code.

I've sent it offline, just in case.

@rfindler
Copy link
Member

I'd like to help test but I'm not sure if what I have is useful. It is a late 2013 imac running high sierra (10.13). It doesn't have the problem with the snake game in 8.12, on either of the 32 or 64 bit builds. I somehow have the (possibly incorrect?) impression that it might be a useful machine to test a fixed Racket on for the release. I'm happy to do so!

@jbclements there is a little popdown menu near the word "edited" in @shhyou 's message with the snake game; if you go to the first version of the message, you'll be able to download the game. At least, that worked for me.

@rfindler
Copy link
Member

No, the student uses v8.12 dmg and is on an x86_64 machine.

I updated an x86_64 machine I have to sonoma and used the x8.12 dmg with the snake game code posted here earlier and I didn't see any problems. (I'm surprised by this ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

macOS: text field misrendering
7 participants