SDL-1.2.15.diff 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. diff -ru SDL-1.2.15.org/src/video/quartz/SDL_QuartzEvents.m SDL-1.2.15/src/video/quartz/SDL_QuartzEvents.m
  2. --- SDL-1.2.15.org/src/video/quartz/SDL_QuartzEvents.m 2012-01-19 07:30:06.000000000 +0100
  3. +++ SDL-1.2.15/src/video/quartz/SDL_QuartzEvents.m 2013-10-23 07:16:42.000000000 +0200
  4. @@ -345,7 +345,9 @@
  5. the scancode/keysym.
  6. */
  7. if (SDL_TranslateUNICODE && state == SDL_PRESSED) {
  8. - [field_edit interpretKeyEvents:[NSArray arrayWithObject:event]];
  9. + if (!([event modifierFlags] & NSCommandKeyMask)) {
  10. + [field_edit interpretKeyEvents:[NSArray arrayWithObject:event]];
  11. + }
  12. chars = [ event characters ];
  13. numChars = [ chars length ];
  14. if (numChars > 0)
  15. @@ -383,7 +385,7 @@
  16. }
  17. }
  18. - if (SDL_getenv ("SDL_ENABLEAPPEVENTS"))
  19. + if (SDL_getenv ("SDL_ENABLEAPPEVENTS") && !(mode_flags & SDL_FULLSCREEN))
  20. [ NSApp sendEvent:event ];
  21. }
  22. diff -ru SDL-1.2.15.org/src/video/quartz/SDL_QuartzVideo.h SDL-1.2.15/src/video/quartz/SDL_QuartzVideo.h
  23. --- SDL-1.2.15.org/src/video/quartz/SDL_QuartzVideo.h 2012-01-19 07:30:06.000000000 +0100
  24. +++ SDL-1.2.15/src/video/quartz/SDL_QuartzVideo.h 2014-04-04 23:48:34.000000000 +0200
  25. @@ -91,7 +91,9 @@
  26. CGDirectDisplayID display; /* 0 == main display (only support single display) */
  27. const void *mode; /* current mode of the display */
  28. const void *save_mode; /* original mode of the display */
  29. +#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
  30. CGDirectPaletteRef palette; /* palette of an 8-bit display */
  31. +#endif
  32. NSOpenGLContext *gl_context; /* OpenGL rendering context */
  33. NSGraphicsContext *nsgfx_context; /* Cocoa graphics context */
  34. Uint32 width, height, bpp; /* frequently used data about the display */
  35. diff -ru SDL-1.2.15.org/src/video/quartz/SDL_QuartzWindow.h SDL-1.2.15/src/video/quartz/SDL_QuartzWindow.h
  36. --- SDL-1.2.15.org/src/video/quartz/SDL_QuartzWindow.h 2012-01-19 07:30:06.000000000 +0100
  37. +++ SDL-1.2.15/src/video/quartz/SDL_QuartzWindow.h 2013-10-23 07:16:42.000000000 +0200
  38. @@ -38,6 +38,7 @@
  39. - (void)appWillUnhide:(NSNotification*)note;
  40. - (void)appDidUnhide:(NSNotification*)note;
  41. - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag;
  42. +- (BOOL)performKeyEquivalent:(NSEvent*)event;
  43. @end
  44. /* Delegate for our NSWindow to send SDLQuit() on close */
  45. diff -ru SDL-1.2.15.org/src/video/quartz/SDL_QuartzWindow.m SDL-1.2.15/src/video/quartz/SDL_QuartzWindow.m
  46. --- SDL-1.2.15.org/src/video/quartz/SDL_QuartzWindow.m 2012-01-19 07:30:06.000000000 +0100
  47. +++ SDL-1.2.15/src/video/quartz/SDL_QuartzWindow.m 2013-10-23 07:16:42.000000000 +0200
  48. @@ -197,6 +197,14 @@
  49. return [ super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag ];
  50. }
  51. +- (BOOL)performKeyEquivalent:(NSEvent*)event
  52. +{
  53. + /* give the menu a chance to handle the key equivalent */
  54. + [[NSApp mainMenu] performKeyEquivalent:event];
  55. + /* avoid beep by pretending we handled it */
  56. + return YES;
  57. +}
  58. +
  59. @end
  60. @implementation SDL_QuartzWindowDelegate