Mercurial > mplayer.hg
comparison libvo/x11_common.c @ 6095:891cff8aba60
some cleanup, gl/gl2 updated to use vo_window
author | arpi |
---|---|
date | Tue, 14 May 2002 23:44:35 +0000 |
parents | 39c2bfe5c267 |
children | 582960ab7cc7 |
comparison
equal
deleted
inserted
replaced
6094:0f4dbbe57c08 | 6095:891cff8aba60 |
---|---|
169 event->type, event->display, event->resourceid, event->serial); | 169 event->type, event->display, event->resourceid, event->serial); |
170 printf("Error code: %x, request code: %x, minor code: %x\n", | 170 printf("Error code: %x, request code: %x, minor code: %x\n", |
171 event->error_code, event->request_code, event->minor_code); | 171 event->error_code, event->request_code, event->minor_code); |
172 } | 172 } |
173 | 173 |
174 exit_player("X11 error"); | 174 abort(); |
175 //exit_player("X11 error"); | |
175 #undef MSGLEN | 176 #undef MSGLEN |
176 } | 177 } |
177 | 178 |
178 int vo_wm_string_test( char * name ) | 179 int vo_wm_string_test( char * name ) |
179 { | 180 { |
515 wmClass.res_class = "MPlayer"; | 516 wmClass.res_class = "MPlayer"; |
516 XSetClassHint(display,window,&wmClass); | 517 XSetClassHint(display,window,&wmClass); |
517 } | 518 } |
518 | 519 |
519 Window vo_window = None; | 520 Window vo_window = None; |
520 GC vo_gc; | 521 GC vo_gc = NULL; |
521 XSizeHints vo_hint; | 522 XSizeHints vo_hint; |
522 | 523 |
523 #ifdef HAVE_NEW_GUI | 524 #ifdef HAVE_NEW_GUI |
524 void vo_setwindow( Window w,GC g ) { | 525 void vo_setwindow( Window w,GC g ) { |
525 vo_window=w; vo_gc=g; | 526 vo_window=w; vo_gc=g; |
526 } | 527 } |
527 #endif | 528 #endif |
528 | 529 |
529 int vo_x11_uninit(Display *display, Window window) | 530 void vo_x11_uninit() |
530 { | 531 { |
531 vo_showcursor( display,window ); | 532 if(vo_window!=None) vo_showcursor( mDisplay,vo_window ); |
532 | 533 |
533 #ifdef HAVE_NEW_GUI | 534 #ifdef HAVE_NEW_GUI |
534 /* destroy window only if it's not controlled by GUI */ | 535 /* destroy window only if it's not controlled by GUI */ |
535 if ( !use_gui ) | 536 if ( !use_gui ) |
536 #endif | 537 #endif |
537 { | 538 { |
538 XSetBackground( mDisplay,vo_gc,0 ); | 539 if(vo_gc){ |
539 XClearWindow( mDisplay,vo_window ); | 540 XSetBackground( mDisplay,vo_gc,0 ); |
540 | 541 vo_gc=NULL; |
541 /* and -wid is set */ | 542 } |
542 if (WinID < 0) | 543 if(vo_window!=None){ |
543 { | 544 XClearWindow( mDisplay,vo_window ); |
544 XUnmapWindow( display,window ); | 545 if (WinID < 0){ |
545 XDestroyWindow(display, window); | 546 XUnmapWindow( mDisplay,vo_window ); |
546 } | 547 XDestroyWindow(mDisplay, vo_window); |
548 } | |
549 vo_window=None; | |
550 } | |
547 vo_fs=0; | 551 vo_fs=0; |
548 } | 552 } |
549 return(1); | |
550 } | 553 } |
551 | 554 |
552 int vo_mouse_timer_const = 30; | 555 int vo_mouse_timer_const = 30; |
553 static int vo_mouse_counter = 30; | 556 static int vo_mouse_counter = 30; |
554 | 557 |
560 static XComposeStatus stat; | 563 static XComposeStatus stat; |
561 | 564 |
562 // unsigned long vo_KeyTable[512]; | 565 // unsigned long vo_KeyTable[512]; |
563 | 566 |
564 if ( ( vo_mouse_autohide )&&( --vo_mouse_counter == 0 ) ) vo_hidecursor( mydisplay,vo_window ); | 567 if ( ( vo_mouse_autohide )&&( --vo_mouse_counter == 0 ) ) vo_hidecursor( mydisplay,vo_window ); |
565 | 568 |
566 while ( XPending( mydisplay ) ) | 569 while ( XPending( mydisplay ) ) |
567 { | 570 { |
568 XNextEvent( mydisplay,&Event ); | 571 XNextEvent( mydisplay,&Event ); |
569 #ifdef HAVE_NEW_GUI | 572 #ifdef HAVE_NEW_GUI |
570 if ( use_gui ) | 573 if ( use_gui ) |
571 { | 574 { |
572 guiGetEvent( 0,(char*)&Event ); | 575 guiGetEvent( 0,(char*)&Event ); |
573 if ( vo_window != Event.xany.window ) continue; | 576 if ( vo_window != Event.xany.window ) continue; |
574 } | 577 } |
575 #endif | 578 #endif |
579 // printf("\rEvent.type=%X \n",Event.type); | |
576 switch( Event.type ) | 580 switch( Event.type ) |
577 { | 581 { |
578 case Expose: | 582 case Expose: |
579 ret|=VO_EVENT_EXPOSE; | 583 ret|=VO_EVENT_EXPOSE; |
580 break; | 584 break; |