- /* handle window creation requests, destroy requests,
- and run idle callbacks
- */
-
- if( msg.message == WM_TIMER ) {
- pthread_mutex_lock (&plugin_mutex);
-again:
- for (fst = fst_first; fst; fst = fst->next) {
-
- if (fst->destroy) {
- if (fst->window) {
- fst->plugin->dispatcher( fst->plugin, effEditClose, 0, 0, NULL, 0.0 );
- CloseWindow (fst->window);
- fst->window = NULL;
- fst->destroy = FALSE;
- }
- fst_event_loop_remove_plugin (fst);
- fst->been_activated = FALSE;
- pthread_mutex_lock (&fst->lock);
- pthread_cond_signal (&fst->window_status_change);
- pthread_mutex_unlock (&fst->lock);
- goto again;
- }
-
- if (fst->window == NULL) {
- pthread_mutex_lock (&fst->lock);
- if (fst_create_editor (fst)) {
- fst_error ("cannot create editor for plugin %s", fst->handle->name);
- fst_event_loop_remove_plugin (fst);
- pthread_cond_signal (&fst->window_status_change);
- pthread_mutex_unlock (&fst->lock);
- goto again;
- }
- /* condition/unlock handled when we receive WM_ACTIVATE */
- }
+ if (window_parent) {
+ // This is requiredv for some reason. Note the parent is set above when the window
+ // is created. Without this extra call the actual plugin window will draw outside
+ // of our plugin window.
+ SetParent((HWND)fst->windows_window, (HWND)window_parent);
+ fst->xid = 0;
+#ifndef PLATFORM_WINDOWS /* linux + wine */
+ } else {
+ SetWindowPos (fst->windows_window, 0, 9999, 9999, 2, 2, 0);
+ ShowWindow (fst->windows_window, SW_SHOWNA);
+ fst->xid = (int) GetPropA (fst->windows_window, "__wine_x11_whole_window");
+#endif
+ }