mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
frames: Only realize the widget after it's been properly associated
This makes sure that we don't get into a situation from a GTK+ handler where we'll have an unassociated frame window.
This commit is contained in:
parent
8a062b39ab
commit
873da3405c
@ -113,9 +113,23 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
attrs.event_mask = EVENT_MASK;
|
||||
XChangeWindowAttributes (window->display->xdisplay,
|
||||
frame->xwindow, CWEventMask, &attrs);
|
||||
/* stick frame to the window */
|
||||
window->frame = frame;
|
||||
|
||||
meta_display_register_x_window (window->display, &frame->xwindow, window);
|
||||
|
||||
/* Now that frame->xwindow is registered with window, we can set its
|
||||
* style and background.
|
||||
*/
|
||||
meta_ui_update_frame_style (window->screen->ui, frame->xwindow);
|
||||
|
||||
meta_ui_realize_frame_window (window->screen->ui, frame->xwindow);
|
||||
|
||||
if (window->title)
|
||||
meta_ui_set_frame_title (window->screen->ui,
|
||||
window->frame->xwindow,
|
||||
window->title);
|
||||
|
||||
/* Reparent the client window; it may be destroyed,
|
||||
* thus the error trap. We'll get a destroy notify later
|
||||
* and free everything. Comment in FVWM source code says
|
||||
@ -149,18 +163,6 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
/* FIXME handle this error */
|
||||
meta_error_trap_pop (window->display);
|
||||
|
||||
/* stick frame to the window */
|
||||
window->frame = frame;
|
||||
|
||||
/* Now that frame->xwindow is registered with window, we can set its
|
||||
* style and background.
|
||||
*/
|
||||
meta_ui_update_frame_style (window->screen->ui, frame->xwindow);
|
||||
|
||||
if (window->title)
|
||||
meta_ui_set_frame_title (window->screen->ui,
|
||||
window->frame->xwindow,
|
||||
window->title);
|
||||
|
||||
/* Move keybindings to frame instead of window */
|
||||
meta_window_grab_keys (window);
|
||||
|
@ -499,7 +499,6 @@ meta_ui_create_frame_window (MetaUI *ui,
|
||||
g_object_set_data (G_OBJECT (frame), "gtk-parent-window", g_object_ref (window));
|
||||
|
||||
gdk_window_set_user_data (window, frame);
|
||||
gtk_widget_show (GTK_WIDGET (frame));
|
||||
|
||||
/* Don't set event mask here, it's in frame.c */
|
||||
frame->window = g_object_ref (window);
|
||||
@ -517,6 +516,14 @@ meta_ui_create_frame_window (MetaUI *ui,
|
||||
return frame->xwindow;
|
||||
}
|
||||
|
||||
void
|
||||
meta_ui_realize_frame_window (MetaUI *ui,
|
||||
Window xwindow)
|
||||
{
|
||||
MetaUIFrame *frame = meta_ui_lookup_window (ui, xwindow);
|
||||
gtk_widget_show (GTK_WIDGET (frame));
|
||||
}
|
||||
|
||||
void
|
||||
meta_ui_destroy_frame_window (MetaUI *ui,
|
||||
Window xwindow)
|
||||
|
@ -69,6 +69,8 @@ Window meta_ui_create_frame_window (MetaUI *ui,
|
||||
gint height,
|
||||
gint screen_no,
|
||||
gulong *create_serial);
|
||||
void meta_ui_realize_frame_window (MetaUI *ui,
|
||||
Window xwindow);
|
||||
void meta_ui_destroy_frame_window (MetaUI *ui,
|
||||
Window xwindow);
|
||||
void meta_ui_move_resize_frame (MetaUI *ui,
|
||||
|
Loading…
Reference in New Issue
Block a user