This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

fuse_win32_message_loop.diff

By: sbaldovi on Apr 15th, 2012  |  syntax: Diff  |  size: 1.30 KB  |  views: 3  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: ui/win32/win32ui.c
  2. ===================================================================
  3. --- ui/win32/win32ui.c  (revision 4687)
  4. +++ ui/win32/win32ui.c  (working copy)
  5. @@ -67,6 +67,9 @@
  6.  /* this helps pause fuse while the main window is minimized */
  7.  static int size_paused = 0;
  8.  
  9. +/* this helps to finalize some blocking operations */
  10. +static int exit_process_messages = 0;
  11. +
  12.  /* Structure used by the radio button selection widgets (eg the
  13.     graphics filter selectors and Machine/Select) */
  14.  typedef struct win32ui_select_info {
  15. @@ -247,6 +250,12 @@
  16.           is open and inactive */
  17.        break;
  18.  
  19. +    case WM_USER_EXIT_PROCESS_MESSAGES:
  20. +      /* Odd case when message loop is overridden by a modal dialog. This
  21. +         should not be caught here, so we delay this notification */
  22. +      exit_process_messages++;
  23. +      return 0;
  24. +
  25.  #if defined USE_JOYSTICK && !defined HAVE_JSW_H
  26.  
  27.      case MM_JOY1BUTTONDOWN:
  28. @@ -1167,7 +1176,14 @@
  29.        }
  30.      }
  31.      if( process_queue_once ) return;
  32. -    
  33. +
  34. +    /* If we miss WM_USER_EXIT_PROCESS_MESSAGES, the window procedure will
  35. +       kindly notify us */
  36. +    if( exit_process_messages ) {
  37. +      exit_process_messages--;
  38. +      return;
  39. +    }
  40. +
  41.      WaitMessage();
  42.    }
  43.    /* FIXME: somewhere there should be return msg.wParam */
clone this paste RAW Paste Data