Changeset 3728


Ignore:
Timestamp:
Aug 29, 2011 2:33:50 AM (8 years ago)
Author:
ming
Message:

Fixed #1354: stopping preview may hide parent window.

Location:
pjproject/trunk/pjsip-apps/src/vidgui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/vidgui/vidgui.cpp

    r3726 r3728  
    221221        //status = pjsua_vid_win_set_show(wid, PJ_TRUE); 
    222222        //This is handled by VidWin now 
    223         //video_prev_->show(); 
     223        //video_prev_->show_sdl(); 
    224224        showStatus("Preview started"); 
    225225 
     
    624624 
    625625}; 
     626static int main_func(int argc, char *argv[]) 
     627{ 
     628    return 0; 
     629} 
    626630 
    627631int main(int argc, char *argv[]) 
    628632{ 
     633    pj_run_app(&main_func, argc, argv, 0); 
     634     
    629635    /* At least on Linux, we have to initialize SDL video subsystem prior to 
    630636     * creating/initializing QApplication, otherwise we'll segfault miserably 
  • pjproject/trunk/pjsip-apps/src/vidgui/vidwin.cpp

    r3727 r3728  
    4747VidWin::~VidWin() 
    4848{ 
    49     show(false); 
     49    show_sdl(false); 
    5050    detach(); 
    5151} 
     
    7373 
    7474    case QEvent::Show: 
    75         show(true); 
     75        show_sdl(true); 
    7676        // revert to default size hint, make it resizable 
    7777        setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); 
     
    7979 
    8080    case QEvent::Hide: 
    81         show(false); 
     81        show_sdl(false); 
    8282        break; 
    8383 
     
    139139} 
    140140 
    141 void VidWin::show(bool visible) 
     141void VidWin::show_sdl(bool visible) 
    142142{ 
    143143    if (!hwnd.info.win.hwnd) return; 
     
    210210} 
    211211 
    212 void VidWin::show(bool visible) 
     212void VidWin::show_sdl(bool visible) 
    213213{ 
    214214    if (!hwnd.info.cocoa.window) return; 
     
    217217 
    218218    if (visible) { 
    219         if (![w isMiniaturized]) { 
    220             [w makeKeyAndOrderFront:nil]; 
    221         } 
     219        [[w contentView]setHidden:NO]; 
    222220    } else { 
    223         [w orderOut:nil]; 
     221        [[w contentView]setHidden:YES]; 
    224222    } 
    225223} 
     
    285283} 
    286284 
    287 void VidWin::show(bool visible) 
     285void VidWin::show_sdl(bool visible) 
    288286{ 
    289287    if (!hwnd.info.x11.window) return; 
  • pjproject/trunk/pjsip-apps/src/vidgui/vidwin.h

    r3726 r3728  
    4646    void set_size(); 
    4747    void get_size(); 
    48     void show(bool visible=true); 
     48    void show_sdl(bool visible=true); 
    4949}; 
    5050 
Note: See TracChangeset for help on using the changeset viewer.