Advertisement
Guest User

visualisation issue

a guest
Nov 12th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.59 KB | None | 0 0
  1. --- a/modules/video_output/win32/events.c
  2. +++ b/modules/video_output/win32/events.c
  3. @@ -53,6 +53,7 @@
  4.  struct event_thread_t
  5.  {
  6.      vout_display_t *vd;
  7. +    vout_display_cfg_t cfg;
  8.  
  9.      /* */
  10.      vlc_thread_t thread;
  11. @@ -313,7 +314,7 @@ static void *EventThread( void *p_this )
  12.                      i_key |= KEY_MODIFIER_ALT;
  13.                  }
  14.  
  15. -                vout_display_SendEventKey(vd, i_key);
  16. +                vout_window_ReportKeyPress(p_event->parent_window, i_key);
  17.              }
  18.              break;
  19.          }
  20. @@ -343,7 +344,7 @@ static void *EventThread( void *p_this )
  21.                  {
  22.                      i_key |= KEY_MODIFIER_ALT;
  23.                  }
  24. -                vout_display_SendEventKey(vd, i_key);
  25. +                vout_window_ReportKeyPress(p_event->parent_window, i_key);
  26.              }
  27.              break;
  28.          }
  29. @@ -458,6 +459,9 @@ bool EventThreadGetAndResetHasMoved( event_thread_t *p_event )
  30.  
  31.  event_thread_t *EventThreadCreate( vout_display_t *vd, const vout_display_cfg_t *vdcfg)
  32.  {
  33. +
  34. +    if (vdcfg->window->type != VOUT_WINDOW_TYPE_HWND)
  35. +        return NULL;
  36.       /* Create the Vout EventThread, this thread is created by us to isolate
  37.       * the Win32 PeekMessage function calls. We want to do this because
  38.       * Windows can stay blocked inside this call for a long time, and when
  39. @@ -474,6 +478,7 @@ event_thread_t *EventThreadCreate( vout_display_t *vd, const vout_display_cfg_t
  40.      vlc_mutex_init( &p_event->lock );
  41.      vlc_cond_init( &p_event->wait );
  42.  
  43. +    p_event->parent_window = vdcfg->window;
  44.      p_event->is_cursor_hidden = false;
  45.      p_event->button_pressed = 0;
  46.      p_event->psz_title = NULL;
  47. @@ -690,11 +695,7 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
  48.      #endif
  49.      {
  50.          /* If an external window was specified, we'll draw in it. */
  51. -        p_event->parent_window = vout_display_NewWindow(vd, VOUT_WINDOW_TYPE_HWND);
  52. -        if( p_event->parent_window )
  53. -            p_event->hparent = p_event->parent_window->handle.hwnd;
  54. -        else
  55. -            p_event->hparent = NULL;
  56. +        p_event->hparent = p_event->parent_window->handle.hwnd;
  57.      }
  58.      #if defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
  59.      else
  60. @@ -1012,7 +1013,7 @@ static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message,
  61.  
  62.      /* the user wants to close the window */
  63.      case WM_CLOSE:
  64. -        vout_display_SendEventClose(vd);
  65. +        vout_window_ReportClose(p_event->parent_window);
  66.          return 0;
  67.  
  68.      /* the window has been closed so shut down everything now */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement