X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fx11%2Ffg_main_x11.c;h=20cb37c1113c5f5d2b9b225c79857a40037d55e7;hb=55b33225784fde2baa271c1351427afedd8068ec;hp=7af570f77bb2148f48f01cc7f7e39635a7a5386c;hpb=99d53f15a4216240088132f6af9cb194b519b1cc;p=freeglut diff --git a/src/x11/fg_main_x11.c b/src/x11/fg_main_x11.c index 7af570f..20cb37c 100644 --- a/src/x11/fg_main_x11.c +++ b/src/x11/fg_main_x11.c @@ -698,7 +698,7 @@ void fgPlatformProcessSingleEvent ( void ) if( event.xexpose.count == 0 ) { GETWINDOW( xexpose ); - window->State.Redisplay = GL_TRUE; + window->State.WorkMask |= GLUT_DISPLAY_WORK; } break; @@ -1078,36 +1078,19 @@ void fgPlatformMainLoopPreliminaryWork ( void ) } -/* Step through the work list */ -void fgPlatformProcessWork(SFG_Window *window) +/* deal with work list items */ +void fgPlatformInitWork(SFG_Window* window) { - unsigned int workMask = window->State.WorkMask; - /* Now clear it so that any callback generated by the actions below can set work again */ - window->State.WorkMask = 0; - - /* This is before the first display callback: call a few callbacks to inform user of window size, position, etc - * we know this is before the first display callback of a window as for all windows GLUT_INIT_WORK is set when - * they are opened, and work is done before displaying in the mainloop. + /* Notify windowStatus/visibility, position and size get notified on window creation with message handlers above + * XXX CHECK: do the messages happen too early like on windows, so client code cannot have registered + * a callback yet and the message is thus never received by client? + * -> this is a no-op */ - if (workMask & GLUT_INIT_WORK) - { - /* Notify windowStatus/visibility, position and size get notified on window creation with message handlers above - * XXX CHECK: do the messages happen too early like on windows, so client code cannot have registered - * a callback yet and the message is thus never received by client? - */ - - /* Call init context callback */ - INVOKE_WCB( *window, InitContext, ()); - - /* Lastly, check if we have a display callback, error out if not - * This is the right place to do it, as the redisplay will be - * next right after we exit this function, so there is no more - * opportunity for the user to register a callback for this window. - */ - if (!FETCH_WCB(*window, Display)) - fgError ( "ERROR: No display callback registered for window %d\n", window->ID ); - } + return; +} +void fgPlatformPosResZordWork(SFG_Window* window, unsigned int workMask) +{ if (workMask & GLUT_FULL_SCREEN_WORK) fgPlatformFullScreenToggle( window ); if (workMask & GLUT_POSITION_WORK) @@ -1121,28 +1104,28 @@ void fgPlatformProcessWork(SFG_Window *window) else fgPlatformPopWindow( window ); } +} - if (workMask & GLUT_VISIBILITY_WORK) +void fgPlatformVisibilityWork(SFG_Window* window) +{ + /* Visibility status of window gets updated in the window message handlers above + * XXX: is this really the case? check + */ + SFG_Window *win = window; + switch (window->State.DesiredVisibility) { - /* Visibility status of window gets updated in the window message handlers above - * XXX: is this really the case? check - */ - SFG_Window *win = window; - switch (window->State.DesiredVisibility) - { - case DesireHiddenState: - fgPlatformHideWindow( window ); - break; - case DesireIconicState: - /* Call on top-level window */ - while (win->Parent) - win = win->Parent; - fgPlatformIconifyWindow( win ); - break; - case DesireNormalState: - fgPlatformShowWindow( window ); - break; - } + case DesireHiddenState: + fgPlatformHideWindow( window ); + break; + case DesireIconicState: + /* Call on top-level window */ + while (win->Parent) + win = win->Parent; + fgPlatformIconifyWindow( win ); + break; + case DesireNormalState: + fgPlatformShowWindow( window ); + break; } }