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

fuse_xlib_close.diff

By: sbaldovi on Jan 29th, 2012  |  syntax: Diff  |  size: 1.78 KB  |  views: 59  |  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/xlib/xui.c
  2. ===================================================================
  3. --- ui/xlib/xui.c       (revision 4651)
  4. +++ ui/xlib/xui.c       (working copy)
  5. @@ -33,6 +33,7 @@
  6.  #include "display.h"
  7.  #include "fuse.h"
  8.  #include "keyboard.h"
  9. +#include "menu.h"
  10.  #include "settings.h"
  11.  #include "ui/ui.h"
  12.  #include "ui/uidisplay.h"
  13. @@ -146,6 +147,12 @@
  14.    XSetWMProperties(display, xui_mainWindow, &windowName, &iconName,
  15.                    *argv, *argc, sizeHints, wmHints, classHint);
  16.  
  17. +  XFree( windowName.value );
  18. +  XFree( iconName.value );
  19. +  XFree( sizeHints );
  20. +  XFree( wmHints );
  21. +  XFree( classHint );
  22. +
  23.    /* Ask the server to use its backing store for this window */
  24.  
  25.    windowFlags=CWBackingStore;
  26. @@ -195,7 +202,10 @@
  27.  {
  28.    XEvent event;
  29.  
  30. -  while(XCheckMaskEvent(display,~NoEventMask,&event)) {
  31. +  XFlush( display );
  32. +  while( XEventsQueued( display, QueuedAlready ) ) {
  33. +    XNextEvent( display, &event );
  34. +
  35.      switch(event.type) {
  36.      case ConfigureNotify:
  37.        xdisplay_configure_notify(event.xconfigure.width,
  38. @@ -232,7 +242,12 @@
  39.        xkeyboard_keyrelease(&(event.xkey));
  40.        break;
  41.      case ClientMessage:
  42. -      if( event.xclient.data.l[0] == delete_window_atom ) fuse_exiting = 1;
  43. +      if( event.xclient.format == 32 &&
  44. +          event.xclient.data.l[0] == delete_window_atom ) {
  45. +        fuse_emulation_pause();
  46. +        menu_file_exit(0);
  47. +        fuse_emulation_unpause();
  48. +      }
  49.        break;
  50.      }
  51.    }
  52. Index: ui/xlib/xdisplay.c
  53. ===================================================================
  54. --- ui/xlib/xdisplay.c  (revision 4651)
  55. +++ ui/xlib/xdisplay.c  (working copy)
  56. @@ -997,6 +997,7 @@
  57.  
  58.    XStringListToTextProperty( list, 1, &text);
  59.    XSetWMName( display, xui_mainWindow, &text );
  60. +  XFree( text.value );
  61.  
  62.    return 0;
  63.  }
clone this paste RAW Paste Data