Browse Source

fixed a few x syncronization issues

naelstrof 11 years ago
parent
commit
081bb6196e
2 changed files with 6 additions and 1 deletions
  1. 3
    1
      main.cpp
  2. 3
    0
      x.cpp

+ 3
- 1
main.cpp View File

205
     }
205
     }
206
     xengine->releaseCursor();
206
     xengine->releaseCursor();
207
     xengine->releaseKeyboard();
207
     xengine->releaseKeyboard();
208
+    // Try to process any last-second requests.
209
+    xengine->tick();
208
     // Clean up global classes.
210
     // Clean up global classes.
209
     delete xengine;
211
     delete xengine;
210
     delete options;
212
     delete options;
211
     // Wait to make sure X11 cleans up our window before we end.
213
     // Wait to make sure X11 cleans up our window before we end.
212
-    usleep( 10000 );
214
+    usleep( 100000 );
213
     // If we canceled the selection, return error.
215
     // If we canceled the selection, return error.
214
     if ( state == -1 ) {
216
     if ( state == -1 ) {
215
         return 1;
217
         return 1;

+ 3
- 0
x.cpp View File

225
         return;
225
         return;
226
     }
226
     }
227
     //XFreeColors( xengine->m_display, xengine->m_colormap, m_color.pixel, 1,
227
     //XFreeColors( xengine->m_display, xengine->m_colormap, m_color.pixel, 1,
228
+    // Attempt to move window offscreen before trying to remove it.
229
+    XResizeWindow( xengine->m_display, m_window, 1, 1 );
230
+    XMoveWindow( xengine->m_display, m_window, 0, 0 );
228
     XUnmapWindow( xengine->m_display, m_window );
231
     XUnmapWindow( xengine->m_display, m_window );
229
     XDestroyWindow( xengine->m_display, m_window );
232
     XDestroyWindow( xengine->m_display, m_window );
230
 }
233
 }