VirtualBox

儲存庫 vbox 的更動 18565


忽略:
時間撮記:
2009-3-31 下午12:24:11 (16 年 以前)
作者:
vboxsync
訊息:

crOpenGL-OSX: initial fix for compiz enabled linux guest

位置:
trunk/src/VBox
檔案:
修改 4 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h

    r17340 r18565  
    222222{
    223223    /* Event classes */
    224     kEventClassVBox        = 'vbox',
     224    kEventClassVBox         = 'vbox',
    225225    /* Event kinds */
    226     kEventVBoxShowWindow   = 'swin',
    227     kEventVBoxMoveWindow   = 'mwin',
    228     kEventVBoxResizeWindow = 'rwin',
    229     kEventVBoxUpdateDock   = 'udck'
     226    kEventVBoxShowWindow    = 'swin',
     227    kEventVBoxHideWindow    = 'hwin',
     228    kEventVBoxMoveWindow    = 'mwin',
     229    kEventVBoxResizeWindow  = 'rwin',
     230    kEventVBoxDisposeWindow = 'dwin',
     231    kEventVBoxUpdateDock    = 'udck'
    230232};
    231233OSStatus darwinOverlayWindowHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r17669 r18565  
    766766    {
    767767        { kEventClassVBox, kEventVBoxShowWindow },
     768        { kEventClassVBox, kEventVBoxHideWindow },
    768769        { kEventClassVBox, kEventVBoxMoveWindow },
    769770        { kEventClassVBox, kEventVBoxResizeWindow },
     771        { kEventClassVBox, kEventVBoxDisposeWindow },
    770772        { kEventClassVBox, kEventVBoxUpdateDock }
    771773    };
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp

    r17201 r18565  
    235235            return noErr;
    236236        }
     237        if (eventKind == kEventVBoxHideWindow)
     238        {
     239//            printf ("HideWindow requested\n");
     240            WindowPtr w;
     241            if (GetEventParameter (aInEvent, kEventParamWindowRef, typeWindowRef, NULL, sizeof (w), NULL, &w) != noErr)
     242                return noErr;
     243            HideWindow (w);
     244            return noErr;
     245        }
    237246        if (eventKind == kEventVBoxMoveWindow)
    238247        {
     
    246255            ChangeWindowGroupAttributes (GetWindowGroup (w), 0, kWindowGroupAttrMoveTogether);
    247256            QPoint p1 = view->mapToGlobal (QPoint (p.x, p.y));
     257//            printf ("Pos: %d %d\n", p1.x(), p1.y());
    248258            MoveWindow (w, p1.x(), p1.y(), true);
    249259            ChangeWindowGroupAttributes (GetWindowGroup (w), kWindowGroupAttrMoveTogether, 0);
     
    260270                return noErr;
    261271            ChangeWindowGroupAttributes (GetWindowGroup (w), 0, kWindowGroupAttrMoveTogether);
     272//            printf ("Size: %f %f\n", s.width, s.height);
    262273            SizeWindow (w, s.width, s.height, true);
    263274            ChangeWindowGroupAttributes (GetWindowGroup (w), kWindowGroupAttrMoveTogether, 0);
    264275            return noErr;
    265276        }
     277        if (eventKind == kEventVBoxDisposeWindow)
     278        {
     279//            printf ("DisposeWindow requested\n");
     280            WindowPtr w;
     281            if (GetEventParameter (aInEvent, kEventParamWindowRef, typeWindowRef, NULL, sizeof (w), NULL, &w) != noErr)
     282                return noErr;
     283            DisposeWindow (w);
     284            return noErr;
     285        }
    266286        if (eventKind == kEventVBoxUpdateDock)
    267287        {
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c

    r17022 r18565  
    2929{
    3030    /* Event classes */
    31     kEventClassVBox        = 'vbox',
     31    kEventClassVBox         = 'vbox',
    3232    /* Event kinds */
    33     kEventVBoxShowWindow   = 'swin',
    34     kEventVBoxMoveWindow   = 'mwin',
    35     kEventVBoxResizeWindow = 'rwin',
    36     kEventVBoxUpdateDock   = 'udck'
     33    kEventVBoxShowWindow    = 'swin',
     34    kEventVBoxHideWindow    = 'hwin',
     35    kEventVBoxMoveWindow    = 'mwin',
     36    kEventVBoxResizeWindow  = 'rwin',
     37    kEventVBoxDisposeWindow = 'dwin',
     38    kEventVBoxUpdateDock    = 'udck'
    3739};
    3840
     
    5052
    5153/* Debug macros */
     54#ifdef DEBUG_poetzsch
     55#define DEBUG_MSG_POETZSCH(text) \
     56    printf text
     57#endif
     58
    5259#define DEBUG_MSG_RESULT(result, text) \
    5360        crDebug(text" (%d; %s:%d)", (int)(result), __FILE__, __LINE__)
     
    268275        return render_spu.ws.aglSetCurrentContext( NULL );
    269276
     277    DEBUG_MSG_POETZSCH (("WindowAttachContext %d\n", wi->id));
     278
    270279    /* Flush old context first */
    271280    if (context->currentWindow->window != window)
     
    275284    if (wi->bufferName == -1)
    276285    {
     286        DEBUG_MSG_POETZSCH (("WindowAttachContext: create context %d\n", wi->id));
    277287        /* Use the same visual bits as those in the context structure */
    278288        AGLPixelFormat pix;
     
    357367
    358368    if(!window->nativeWindow)
    359         DisposeWindow(window->window);
     369    {
     370        EventRef evt;
     371        OSStatus status = CreateEvent(NULL, kEventClassVBox, kEventVBoxDisposeWindow, 0, kEventAttributeNone, &evt);
     372        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: CreateEvent Failed");
     373        status = SetEventParameter(evt, kEventParamWindowRef, typeWindowRef, sizeof (window->window), &window->window);
     374        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: SetEventParameter Failed");
     375        status = SendEventToEventTarget (evt, GetWindowEventTarget (HIViewGetWindow ((HIViewRef)render_spu_parent_window_id)));
     376        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: PostEventToQueue Failed");
     377    }
    360378
    361379    /* Delete the dummy context */
     
    390408    status = SetEventParameter(evt, kEventParamDimensions, typeHISize, sizeof (s), &s);
    391409    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: SetEventParameter Failed");
    392     status = PostEventToQueue(GetMainEventQueue(), evt, kEventPriorityStandard);
     410    status = SendEventToEventTarget (evt, GetWindowEventTarget (HIViewGetWindow ((HIViewRef)render_spu_parent_window_id)));
    393411    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: PostEventToQueue Failed");
    394412
     
    399417        context->context)
    400418    {
     419        DEBUG_MSG_POETZSCH (("Size %d context %x visible %d\n", window->id, context->context, IsWindowVisible (window->window)));
    401420        result = render_spu.ws.aglUpdateContext(context->context);
    402421        CHECK_AGL_RC (result, "Render SPU: UpdateContext Failed");
     422        render_spu.self.Flush();
    403423    }
    404424    /* save the new size */
     
    464484    status = SetEventParameter(evt, kEventParamOrigin, typeHIPoint, sizeof (p), &p);
    465485    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: SetEventParameter Failed");
    466     status = PostEventToQueue(GetMainEventQueue(), evt, kEventPriorityStandard);
     486    status = SendEventToEventTarget (evt, GetWindowEventTarget (HIViewGetWindow ((HIViewRef)render_spu_parent_window_id)));
    467487    CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: PostEventToQueue Failed");
    468488
     
    473493        context->context)
    474494    {
     495        DEBUG_MSG_POETZSCH (("Position %d context %x visible %d\n", window->id, context->context, IsWindowVisible (window->window)));
    475496        result = render_spu.ws.aglUpdateContext(context->context);
    476497        CHECK_AGL_RC (result, "Render SPU: UpdateContext Failed");
     498        render_spu.self.Flush();
    477499    }
    478500}
     
    500522        status = SetEventParameter(evt, kEventParamWindowRef, typeWindowRef, sizeof (window->window), &window->window);
    501523        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: SetEventParameter Failed");
    502         status = PostEventToQueue(GetMainEventQueue(), evt, kEventPriorityStandard);
     524        status = SendEventToEventTarget (evt, GetWindowEventTarget (HIViewGetWindow ((HIViewRef)render_spu_parent_window_id)));
    503525        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: PostEventToQueue Failed");
    504526    }
    505527    else
    506         HideWindow(window->window);
     528    {
     529        EventRef evt;
     530        OSStatus status = CreateEvent(NULL, kEventClassVBox, kEventVBoxHideWindow, 0, kEventAttributeNone, &evt);
     531        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: CreateEvent Failed");
     532        status = SetEventParameter(evt, kEventParamWindowRef, typeWindowRef, sizeof (window->window), &window->window);
     533        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: SetEventParameter Failed");
     534        status = SendEventToEventTarget (evt, GetWindowEventTarget (HIViewGetWindow ((HIViewRef)render_spu_parent_window_id)));
     535        CHECK_CARBON_RC_RETURN_VOID (status, "Render SPU: PostEventToQueue Failed");
     536    }
    507537
    508538    /* Update the context */
     
    512542        context->context)
    513543    {
     544        DEBUG_MSG_POETZSCH (("Showed %d context %x visible %d\n", window->id, context->context, IsWindowVisible (window->window)));
    514545        result = render_spu.ws.aglUpdateContext(context->context);
    515546        CHECK_AGL_RC (result, "Render SPU: UpdateContext Failed");
     547        render_spu.self.Flush();
    516548    }
    517549
     
    524556{
    525557    Boolean result;
     558    DEBUG_MSG_POETZSCH (("makecurrent %d: \n", window->id));
    526559
    527560    CRASSERT(render_spu.ws.aglSetCurrentContext);
    528 /*  crDebug( "renderspu_SystemMakeCurrent( %x, %i, %x )", window, nativeWindow, context );*/
     561    crDebug( "renderspu_SystemMakeCurrent( %x, %i, %x )", window, nativeWindow, context );
    529562
    530563    if(window && context)
     
    578611        crError("Render SPU: SwapBuffers got a null context from the window");
    579612
     613    DEBUG_MSG_POETZSCH (("Swapped %d context %x visible: %d\n", window->id, context->context, IsWindowVisible (window->window)));
    580614    render_spu.ws.aglSwapBuffers(context->context);
    581 
    582615
    583616    /* This method seems called very often. To prevent the dock using all free
     
    650683
    651684    if(window->window && IsValidWindowPtr(window->window))
    652         /* Destroy the old one */
    653         DisposeWindow(window->window);
     685    {
     686        EventRef evt;
     687        status = CreateEvent(NULL, kEventClassVBox, kEventVBoxDisposeWindow, 0, kEventAttributeNone, &evt);
     688        CHECK_CARBON_RC_RETURN (status, "Render SPU: CreateEvent Failed", false);
     689        status = SetEventParameter(evt, kEventParamWindowRef, typeWindowRef, sizeof (window->window), &window->window);
     690        CHECK_CARBON_RC_RETURN (status, "Render SPU: SetEventParameter Failed", false);
     691        status = SendEventToEventTarget (evt, GetWindowEventTarget (HIViewGetWindow ((HIViewRef)render_spu_parent_window_id)));
     692        CHECK_CARBON_RC_RETURN (status, "Render SPU: PostEventToQueue Failed", false);
     693    }
    654694
    655695    windowRect.left = window->x;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette