XtManageChild (pane_widget);
XtRealizeWidget (shell_widget);
- if (FRAME_X_EMBEDDED_P (f))
- XReparentWindow (FRAME_X_DISPLAY (f), XtWindow (shell_widget),
- f->output_data.x->parent_desc, 0, 0);
-
FRAME_X_WINDOW (f) = XtWindow (frame_widget);
initial_set_up_x_back_buffer (f);
validate_x_resource_name ();
block_input ();
FRAME_X_WINDOW (f)
= XCreateWindow (FRAME_X_DISPLAY (f),
- f->output_data.x->parent_desc,
+ FRAME_DISPLAY_INFO (f)->root_window,
f->left_pos,
f->top_pos,
FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f),
x_window (f);
#endif
+#ifndef USE_GTK
+ if (FRAME_X_EMBEDDED_P (f)
+ && !x_embed_frame (dpyinfo, f))
+ error ("The frame could not be embedded; does the embedder exist?");
+#endif
+
x_icon (f, parms);
x_make_gc (f);
f = x_top_window_to_frame (dpyinfo, event->xreparent.window);
if (f)
{
+#ifndef USE_GTK
+ if (FRAME_OUTPUT_DATA (f)->parent_desc
+ && FRAME_X_EMBEDDED_P (f))
+ {
+ /* The frame's embedder was destroyed; mark the frame as
+ no longer embedded, and map the frame. An
+ UnmapNotify event must have previously been received
+ during the start of save-set processing. */
+
+ FRAME_X_OUTPUT (f)->explicit_parent = false;
+ x_make_frame_visible (f);
+ }
+#endif
+
/* Maybe we shouldn't set this for child frames ?? */
f->output_data.x->parent_desc = event->xreparent.parent;
return value;
}
+#ifndef USE_GTK
+
+/* Set up XEmbed for F, and change its save set to handle the parent
+ being destroyed. */
+
+bool
+x_embed_frame (struct x_display_info *dpyinfo, struct frame *f)
+{
+ bool rc;
+
+ x_catch_errors (dpyinfo->display);
+ /* Catch errors; the target window might no longer exist. */
+ XReparentWindow (dpyinfo->display, FRAME_OUTER_WINDOW (f),
+ FRAME_OUTPUT_DATA (f)->parent_desc, 0, 0);
+ rc = x_had_errors_p (dpyinfo->display);
+ x_uncatch_errors_after_check ();
+
+ if (rc)
+ return false;
+
+ return true;
+}
+
+#endif
+
\f
/* Setting window manager hints. */
FOCUS_EXPLICIT = 2
};
-
/* Return the X output data for frame F. */
#define FRAME_X_OUTPUT(f) ((f)->output_data.x)
#define FRAME_OUTPUT_DATA(f) FRAME_X_OUTPUT (f)
&& defined HAVE_CLOCK_GETTIME
extern void x_sync_init_fences (struct frame *);
#endif
+extern bool x_embed_frame (struct x_display_info *, struct frame *);
extern void x_delete_terminal (struct terminal *);
extern Cursor x_create_font_cursor (struct x_display_info *, int);
/* Is the frame embedded into another application? */
-#define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0)
+#define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT (f)->explicit_parent != 0)
#define STORE_NATIVE_RECT(nr,rx,ry,rwidth,rheight) \
((nr).x = (rx), \