frame: Put a MetaUIFrame* in our MetaFrame

This is a small start, but it lets us start to clean up this
UI split mess.
This commit is contained in:
Jasper St. Pierre 2014-12-31 21:55:36 -08:00
parent c8432cc430
commit 2413e672c8
6 changed files with 39 additions and 32 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -31,6 +31,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
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);