[MPlayer-cvslog] r35185 - in trunk/libvo: osx_objc_common.h osx_objc_common.m vo_corevideo.m
reimar
subversion at mplayerhq.hu
Thu Sep 13 22:28:30 CEST 2012
Author: reimar
Date: Thu Sep 13 22:28:30 2012
New Revision: 35185
Log:
gl OSX backend: Detect and pass on resize events
Modified:
trunk/libvo/osx_objc_common.h
trunk/libvo/osx_objc_common.m
trunk/libvo/vo_corevideo.m
Modified: trunk/libvo/osx_objc_common.h
==============================================================================
--- trunk/libvo/osx_objc_common.h Thu Sep 13 22:12:23 2012 (r35184)
+++ trunk/libvo/osx_objc_common.h Thu Sep 13 22:28:30 2012 (r35185)
@@ -49,6 +49,8 @@
//timestamps for disabling screensaver and mouse hiding
int lastMouseHide;
int lastScreensaverUpdate;
+
+ int event_flags;
@public
float winSizeMult;
}
@@ -60,6 +62,7 @@
//window & rendering
- (void) preinit;
- (void) config:(uint32_t)width:(uint32_t)height:(uint32_t)flags;
+- (void) reshape;
//vo control
- (void) fullscreen: (BOOL) animate;
@@ -81,7 +84,7 @@
- (void) otherMouseUp: (NSEvent *) theEvent;
- (void) scrollWheel: (NSEvent *) theEvent;
- (void) mouseEvent: (NSEvent *) theEvent;
-- (void) check_events;
+- (int) check_events;
- (void) update_screen_info;
@end
Modified: trunk/libvo/osx_objc_common.m
==============================================================================
--- trunk/libvo/osx_objc_common.m Thu Sep 13 22:12:23 2012 (r35184)
+++ trunk/libvo/osx_objc_common.m Thu Sep 13 22:28:30 2012 (r35185)
@@ -88,8 +88,7 @@ void vo_osx_fullscreen(void)
int vo_osx_check_events(void)
{
- [oglv check_events];
- return 0;
+ return [oglv check_events];
}
void vo_osx_update_xinerama_info(void)
@@ -211,6 +210,14 @@ void vo_osx_update_xinerama_info(void)
[window makeKeyAndOrderFront:self];
}
+- (void)reshape
+{
+ NSRect frame = [self frame];
+ vo_dwidth = frame.size.width;
+ vo_dheight = frame.size.height;
+ event_flags |= VO_EVENT_RESIZE;
+}
+
/*
Init Menu
*/
@@ -430,7 +437,7 @@ void vo_osx_update_xinerama_info(void)
/*
Check event for new event
*/
-- (void) check_events
+- (int) check_events
{
NSEvent *event;
int curTime = TickCount()/60;
@@ -454,9 +461,10 @@ void vo_osx_update_xinerama_info(void)
lastScreensaverUpdate = curTime;
}
+ event_flags = 0;
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSEventTrackingRunLoopMode dequeue:YES];
if (event == nil)
- return;
+ return event_flags;
[NSApp sendEvent:event];
// Without SDL's bootstrap code (include SDL.h in mplayer.c),
// on Leopard, we have trouble to get the play window automatically focused
@@ -468,6 +476,7 @@ void vo_osx_update_xinerama_info(void)
[window makeKeyAndOrderFront:self];
}
#endif
+ return event_flags;
}
/*
Modified: trunk/libvo/vo_corevideo.m
==============================================================================
--- trunk/libvo/vo_corevideo.m Thu Sep 13 22:12:23 2012 (r35184)
+++ trunk/libvo/vo_corevideo.m Thu Sep 13 22:28:30 2012 (r35185)
@@ -481,9 +481,7 @@ static int control(uint32_t request, voi
{
int d_width, d_height;
- NSRect frame = [self frame];
- vo_dwidth = frame.size.width;
- vo_dheight = frame.size.height;
+ [super reshape];
glViewport(0, 0, vo_dwidth, vo_dheight);
glMatrixMode(GL_PROJECTION);
More information about the MPlayer-cvslog
mailing list