diff --git a/src/core/frame.c b/src/core/frame.c index 264e61593..41934d744 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -85,15 +85,17 @@ meta_window_ensure_frame (MetaWindow *window) else visual = NULL; - frame->xwindow = meta_ui_create_frame_window (window->screen->ui, - window->display->xdisplay, - visual, - frame->rect.x, - frame->rect.y, - frame->rect.width, - frame->rect.height, - frame->window->screen->number, - &create_serial); + frame->ui_frame = meta_ui_create_frame (window->screen->ui, + window->display->xdisplay, + visual, + frame->rect.x, + frame->rect.y, + frame->rect.width, + frame->rect.height, + frame->window->screen->number, + &create_serial); + frame->xwindow = frame->ui_frame->xwindow; + meta_stack_tracker_record_add (window->screen->stack_tracker, frame->xwindow, create_serial); diff --git a/src/core/frame.h b/src/core/frame.h index d253773fb..8d70469f0 100644 --- a/src/core/frame.h +++ b/src/core/frame.h @@ -24,6 +24,8 @@ #include "window-private.h" +#include "ui/frames.h" + struct _MetaFrame { /* window we frame */ @@ -50,6 +52,8 @@ struct _MetaFrame guint need_reapply_frame_shape : 1; guint is_flashing : 1; /* used by the visual bell flash */ guint borders_cached : 1; + + MetaUIFrame *ui_frame; }; void meta_window_ensure_frame (MetaWindow *window); diff --git a/src/ui/frames.c b/src/ui/frames.c index 1603a6f66..095bb97c6 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -512,7 +512,7 @@ meta_frames_attach_style (MetaUIFrame *frame) variant)); } -void +MetaUIFrame * meta_frames_manage_window (MetaFrames *frames, Window xwindow, GdkWindow *window) @@ -544,6 +544,8 @@ meta_frames_manage_window (MetaFrames *frames, meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow); g_hash_table_replace (frames->frames, &frame->xwindow, frame); + + return frame; } void diff --git a/src/ui/frames.h b/src/ui/frames.h index f4a240e9d..de9853b3d 100644 --- a/src/ui/frames.h +++ b/src/ui/frames.h @@ -120,9 +120,9 @@ GType meta_frames_get_type (void) G_GNUC_CONST; MetaFrames *meta_frames_new (int screen_number); -void meta_frames_manage_window (MetaFrames *frames, - Window xwindow, - GdkWindow *window); +MetaUIFrame * meta_frames_manage_window (MetaFrames *frames, + Window xwindow, + GdkWindow *window); void meta_frames_unmanage_window (MetaFrames *frames, Window xwindow); void meta_frames_set_title (MetaFrames *frames, diff --git a/src/ui/ui.c b/src/ui/ui.c index a00434f84..880d7f445 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -342,16 +342,16 @@ set_background_none (Display *xdisplay, CWBackPixmap, &attrs); } -Window -meta_ui_create_frame_window (MetaUI *ui, - Display *xdisplay, - Visual *xvisual, - gint x, - gint y, - gint width, - gint height, - gint screen_no, - gulong *create_serial) +MetaUIFrame * +meta_ui_create_frame (MetaUI *ui, + Display *xdisplay, + Visual *xvisual, + gint x, + gint y, + gint width, + gint height, + gint screen_no, + gulong *create_serial) { GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay); GdkScreen *screen = gdk_display_get_screen (display, screen_no); @@ -410,9 +410,7 @@ meta_ui_create_frame_window (MetaUI *ui, gdk_window_resize (window, width, height); set_background_none (xdisplay, GDK_WINDOW_XID (window)); - meta_frames_manage_window (ui->frames, GDK_WINDOW_XID (window), window); - - return GDK_WINDOW_XID (window); + return meta_frames_manage_window (ui->frames, GDK_WINDOW_XID (window), window); } void diff --git a/src/ui/ui.h b/src/ui/ui.h index bf0a35873..33d364abf 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -31,6 +31,7 @@ #include typedef struct _MetaUI MetaUI; +typedef struct _MetaUIFrame MetaUIFrame; typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data); @@ -58,14 +59,14 @@ void meta_ui_get_frame_mask (MetaUI *ui, guint height, cairo_t *cr); -Window meta_ui_create_frame_window (MetaUI *ui, +MetaUIFrame * meta_ui_create_frame (MetaUI *ui, Display *xdisplay, Visual *xvisual, - gint x, - gint y, - gint width, - gint height, - gint screen_no, + gint x, + gint y, + gint width, + gint height, + gint screen_no, gulong *create_serial); void meta_ui_destroy_frame_window (MetaUI *ui, Window xwindow);