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

DrRacket on Mac OS doesn't hide properly #161

Closed
LiberalArtist opened this issue Nov 19, 2017 · 7 comments
Closed

DrRacket on Mac OS doesn't hide properly #161

LiberalArtist opened this issue Nov 19, 2017 · 7 comments

Comments

@LiberalArtist
Copy link
Contributor

I'm encountering some strange behavior when asking DrRacket 6.11 to hide on Mac OS 10.13. I think this is DrRacket specific: other applications, including PLT Games, seem to be hiding normally.

When I click DrRacket > Hide DrRacket in the menu bar or, equivalently, press ⌘H, the DrRacket windows flicker away and immediately re-appear. The menu bar shows that the next application is active (as though the hide had worked), but the frontmost DrRacket window is still drawn on top of the other application's windows.

Also, if only DrRacket and Finder are open, pressing ⌘H three times in a row works oddly:

  1. The first ⌘H causes the strange non-hiding behavior described above.
  2. The second ⌘H hides Finder.
  3. The third ⌘H types the character h in DrRacket.

This works the same way regardless of whether I hold the key or re-press it each time. Subsequent presses of ⌘H, even with other typing in between, also type the character h until I select a different application and return to DrRacket. I think this behavior may be related to the fact that the DrRacket > Hide DrRacket menu item is disabled in that case, but, when I get other applications (e.g. Pages) into a state where hiding is disabled, pressing ⌘H plays an unhappy beep rather than typing h, which seems better. (This works the same way when more applications than just DrRacket and Finder are open, given correspondingly more ⌘H presses.)

If I right-click on the DrRacket icon in the dock and choose Hide, hiding happens as expected.

@ianclarksmith
Copy link

I just submitted a bug report from inside the application for this, should've checked GitHub first.

Files changed between 6.10.1 and 6.11:

$ git log --pretty='format:' --name-status 0f77625..4a45bed | sort -u

M	drracket-test/tests/drracket/module-lang-test.rkt
M	drracket-test/tests/drracket/syncheck-test.rkt
M	drracket-tool-lib/drracket/get-module-path.rkt
M	drracket-tool-lib/drracket/private/syncheck/traversals.rkt
M	drracket/drracket/HISTORY.txt
M	drracket/drracket/info.rkt
M	drracket/drracket/private/debug.rkt
M	drracket/drracket/private/drracket-normal.rkt
M	drracket/drracket/private/expanding-place.rkt
M	drracket/drracket/private/insert-large-letters.rkt
M	drracket/drracket/private/language.rkt
M	drracket/drracket/private/main.rkt
M	drracket/drracket/private/module-language-tools.rkt
M	drracket/drracket/private/module-language.rkt
M	drracket/drracket/private/rep.rkt
M	drracket/drracket/private/syncheck/gui.rkt
M	drracket/drracket/private/unit.rkt
M	drracket/drracket/tool-lib.rkt
M	drracket/info.rkt
M	drracket/scribblings/tools/tools.scrbl

How would one build/test this? Is it a matter of creating an executable from racket/DrRacket itself?

@LiberalArtist
Copy link
Contributor Author

I will add that subsequent experience has shown that right-clicking on DrRacket in the dock and choosing Hide does not always work. I haven't yet figured out exactly when it works and when it doesn't.

@LiberalArtist
Copy link
Contributor Author

Actually, I just realized that I don't think any of the other racket/gui programs I've tested use text%, and I've found something interesting. Given the example program for a trivial text editor from the racket/gui reference:

#lang racket/gui

(define f (new frame% [label "Simple Edit"]
                      [width 200]
                      [height 200]))
(define c (new editor-canvas% [parent f]))
(define t (new text%))
(send c set-editor t)
(send f show #t)
(define mb (new menu-bar% [parent f]))
(define m-edit (new menu% [label "Edit"] [parent mb]))
(define m-font (new menu% [label "Font"] [parent mb]))
(append-editor-operation-menu-items m-edit #f)
(append-editor-font-menu-items m-font)
(send t set-max-undo-history 100)

If I run this program in DrRacket and press ⌘H while the keyboard focus is in the "Simple Edit" window, DrRacket hides correctly! So I wonder if the problem lies somewhere in the derived classes of text%, either in DrRacket or from framework, and how they are intercepting key events.

@ianclarksmith
Copy link

Interestingly I tried running the following minimal example program from DrRacket and with mixed results.

#lang racket/gui

(define f (new frame% [label "Example"]
                      [width 200]
                      [height 200]))

(send f show #t)
  1. Focus on Example window
  2. Hide either from keyboard or menu(s)
  3. Both Example and DrRacket windows become hidden
  4. a. They both stay hidden as expected, or...
    b. Example stays hidden but DrRacket reappears in the background after about 10 seconds

@LiberalArtist
Copy link
Contributor Author

Just noting that this issue continues in version 6.12.

@jbclements
Copy link
Contributor

I can confirm that I observe the initially observed flicker and non-hide on cmd-H. I'm running version 6.12.0.3--2018-02-01(-/f) [3m], built from git head today.

@LiberalArtist
Copy link
Contributor Author

Commenting to note that the issue continues in 6.90.0.901.

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

No branches or pull requests

3 participants