Commit Graph

67 Commits

Author SHA1 Message Date
rdb c7bcec1ff5 cocoa: Exit macOS' fullscreen mode when switching fullscreen
Prevents black screen when switching to fullscreen
2024-09-16 13:39:16 +02:00
rdb 82b9a1266c cocoa: Fix error when switching to FS while macOS' FS is active 2024-09-16 13:39:16 +02:00
LD 518ee0fb8e cocoadisplay: Capture display before switching to fullscreen mode 2023-01-20 18:16:43 +01:00
rdb e696ac4046 cocoa: Fix black bar when switching to fullscreen while z-order is top 2023-01-13 22:05:06 +01:00
rdb 76386bc4c0 cocoa: Fix window sizing bug when simultaneously changing undecorated 2023-01-13 22:04:42 +01:00
rdb 8c5e2e74f5 cocoa: Fix undecorated setting ignored when switching off fullscreen 2023-01-13 22:03:33 +01:00
rdb 9cb60ccd93 cocoadisplay: Fix oversized window getting an awkward offset
We currently do the centering based on the total screen size, not the screen size that macOS actually lets us use.

See #1312
2022-12-16 16:07:58 +01:00
rdb dae26c2e4b cocoadisplay: Fix fullscreen regression on Intel macs
Partially backs out 619050bb32

Fixes #1316 (for good this time hopefully)
2022-12-08 15:20:14 +01:00
rdb 5751fc6478 cocoadisplay: Fix a whitespace error 2022-12-07 18:58:38 +01:00
LD 5fa3f3eb68 cocoadisplay: Call remove_all_windows() when the application is about to close
Part of #1321
2022-12-07 17:22:23 +01:00
rdb c85cc8f2e8 cocoadisplay: fix unprotected debug/spam prints 2022-12-07 17:20:41 +01:00
rdb 2a65f583d0 cocoadisplay: Small tweak to fullscreen fix 2022-12-07 17:16:18 +01:00
rdb 619050bb32 cocoadisplay: Fix fullscreen issues on M1 macs
The OpenGL-on-Metal drivers used on these machines don't support CGLSetFullScreenOnDisplay, so we need to disable it on those machines.  This also applies when running a x86_64 app through Rosetta 2, hence the sysctlbyname check.

Furthermore, we need to set the appropriate shielding level, which need not be `NSMainMenuWindowLevel+1`.

Fixes #1316

Co-authored-by: LD <laurent.deru@gmail.com>
2022-12-06 16:59:55 +01:00
rdb 4cf8187df7 cocoadisplay: Fix crash with threading-model on newer macOS versions
Updates the context on the main thread instead of the draw thread now. If render_frame happens to run while the context needs updating, it will skip the frame.

Fixes #1286
2022-10-29 20:51:05 +02:00
LD 12ae2973ae cocoadisplay: Disable the event suppression interval when moving the position of the mouse pointer 2022-09-01 09:07:16 +02:00
LD 69bf5fa626 cocoadisplay: Remove overzealous coordinates transform performed on mouse position 2022-09-01 09:07:16 +02:00
rdb 692221cacb cocoadisplay: Invert direction of horizontal scroll
Now behaves consistent with other applications (tested with Logitech MX Master 3 for Mac on macOS 10.13 in unnatural scrolling configuration).

Set `cocoa-invert-wheel-x true` to revert to old behaviour.
2022-01-22 15:56:53 +01:00
rdb d1c756713d display: Handle raw event for key between Shift and Z on ISO keyboards
This key is called raw-< for lack of anything better, it's usually mapped as backslash on US keyboards but that would not allow distinguishing between the backslash key near the enter key.
2022-01-04 11:05:46 +01:00
Ben Humphries 0415a08416 cocoadisplay: Round refresh rates when choosing display mode on macOS
Closes #1144

Co-authored-by: rdb <git@rdb.name>
2021-06-01 10:56:55 +02:00
LD 209e031964 cocoadisplay: Test all the fullscreen modes to find the valid one
Closes #1039
2021-03-13 12:44:30 +01:00
LD 28f49ffd0b cocoadisplay: Use [event charactersIgnoringModifiers] when UCKeyTranslate() can not translate the input key 2020-09-01 20:29:53 +02:00
Donny Lawrence 5d6ff0ecc8 cocoadisplay: Fix handling of shift modifier
Closes #967
Fixes #959
2020-07-25 10:27:18 +02:00
rdb 2b632c8e20 cocoa: use resolved filename to load cursor image (thanks treamous) 2020-02-01 09:49:35 +01:00
rdb b573cc3587 cocoa: fix compilation issues with new NSCursor hotspot code
See #849
2020-01-22 09:47:58 +01:00
Donny Lawrence 4f4b14dd2b cocoadisplay: Use hotspot read from .cur files
Previously, the cursor's hotspot defaulted to (0,0). Fixes #845.

Closes #849
2020-01-21 14:53:19 +01:00
LD a56b85dbed cocoadisplay: Fix switch to fullscreen on macOS 10.9 using current display resolution 2020-01-07 14:09:05 +01:00
LD f68604a3f5 cocoadisplay: Fix regression introduced by 45461e667a
Closes #829
2020-01-05 23:01:49 +01:00
LD 45461e667a cocoadisplay: use same scaling factor as the current view when switching to fullscreen on MacOS 10.15+
Fixes #794
2019-12-29 22:24:56 +01:00
LD f72c72b36a MacOS: Force disable application HiDPI support on NSView, fixes #794 2019-11-29 10:07:48 +01:00
rdb 5530074945 cocoa: fix crash when typing with RIME as input method
Fixes #620
2019-04-14 22:10:32 +02:00
Donny Lawrence d51db6e39e Fix an instance where a macOS window will stick around when trying to have it destroyed.
This commit also removes an extraneous call to [_window setReleasedWhenClosed], which is already set in cocoaPandaWindow's init method.
2019-01-13 11:54:56 -05:00
Donny Lawrence f29643dd14 cocoa: Prevent a deadlock when using SIMPLE_THREADS on macOS
Closes #491
Fixes #490
2018-12-26 22:47:14 +01:00
Donny Lawrence 0fa0ad673f cocoa: use CVDisplayLink on macOS to sync video to display(s)
Closes #487
Fixes #486
2018-12-24 13:36:13 +01:00
rdb cc08bacec5 cocoa: fix compilation error 2018-11-30 17:13:35 +01:00
rdb 234fd675b1 Merge branch 'master' into input-overhaul 2018-06-23 23:24:09 +02:00
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
rdb ba2de46beb Merge branch 'master' into input-overhaul 2018-06-08 15:23:47 +02:00
rdb 57602d750f cocoadisplay: don't crash if window/buffer fails to open 2018-06-03 22:35:37 +02:00
rdb 21d8c29645 More warning fixes 2018-06-03 06:45:35 -04:00
rdb b8af5bf64f cocoa: fix compile error caused by faulty merge
[skip ci]
2018-03-29 14:44:10 +02:00
Donny Lawrence 7830aab21d cocoa: Fix unresponsive menubar, add default item for application menu.
Closes #259
2018-03-29 14:30:16 +02:00
rdb 7062da944a cocoa: fix ability to type AltGr characters and dead keys
It would seem that interpretKeyEvents/insertText would be the right way to do this, but while that does handle AltGr keys correctly, it does not handle dead keys at all.  This approach seems to do the right things.
2018-03-29 14:22:59 +02:00
rdb 94385e865f Merge remote-tracking branch 'origin/master' into input-overhaul 2018-01-28 14:31:45 +01:00
rdb fe0c182830 cocoa: fix app launching regression on macOS
The regression was introduced by ef7f856c46

Fixes #227
2018-01-17 19:46:30 +01:00
rdb 962e6e31e4 Merge branch 'master' into input-overhaul 2018-01-03 14:46:13 +01:00
rdb ef9803b25e Changes to support compiling input-overhaul branch on macOS 2017-12-22 14:59:52 +01:00
rdb ef7f856c46 cocoa: support windowless offscreen rendering on macOS
Fixes: #183
2017-12-20 14:27:08 +01:00
rdb 8b3ad7348e cocoa: fix broken mouse events in fullscreen on macOS (LP 1500026) 2017-07-10 19:53:53 +02:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb 573af61636 Merge remote-tracking branch 'eswartz/support-mouse-confinement-cocoa' into release/1.9.x
Closes: #20
2015-11-21 17:43:07 +01:00