after resizing main window, the touches do not work correctly

after resizing main window, the touches do not work correctly
0.0 0


I have a MacOSX app that should support resizing of the main window.
The resizing works, but after that the touches to not fit anymore. It looks like their positions and sizes don’t scale correctly to the new window size.
I am using cocos2d-x 2.2.2. This is my code in

-(void) applicationDidFinishLaunching:(NSNotification *)aNotification
  NSRect rect = NSMakeRect(0, 0, 1024, 768);
  window = [[NSWindow alloc] initWithContentRect:rect
				       styleMask: ( NSClosableWindowMask | NSTitledWindowMask | NSResizableWindowMask )
  [window setDelegate:self];
  NSOpenGLPixelFormatAttribute attributes[] = {
    NSOpenGLPFADepthSize, 24,
    NSOpenGLPFAStencilSize, 8,
  NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
  // allocate our GL view
  // (isn't there already a shared EAGLView?)
  glView = [[EAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat];

  // set window parameters
  [window becomeFirstResponder];
  [window setContentView:glView];
  [window setTitle:@"HelloCpp"];
  [window makeKeyAndOrderFront:self];
  [window setAcceptsMouseMovedEvents:YES];


- (void) windowDidResize:(NSNotification *)notification {
  NSRect viewFrame = ((NSView *)window.contentView).frame;
  glView.frame = viewFrame;
  NSView *superview = glView.superview;
  [glView removeFromSuperview];
  [superview addSubview:glView];
  // this takes care of the scaling of the main screen:
  WorkflowManager::sharedInstance()->resizeCurrentScreen(viewFrame.size.width, viewFrame.size.height);

Can someone please help?


I have the same someone told me that this isn’t supported operation.