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:
parent
c8432cc430
commit
2413e672c8
@ -85,7 +85,7 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
else
|
||||
visual = NULL;
|
||||
|
||||
frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
|
||||
frame->ui_frame = meta_ui_create_frame (window->screen->ui,
|
||||
window->display->xdisplay,
|
||||
visual,
|
||||
frame->rect.x,
|
||||
@ -94,6 +94,8 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -120,7 +120,7 @@ GType meta_frames_get_type (void) G_GNUC_CONST;
|
||||
|
||||
MetaFrames *meta_frames_new (int screen_number);
|
||||
|
||||
void meta_frames_manage_window (MetaFrames *frames,
|
||||
MetaUIFrame * meta_frames_manage_window (MetaFrames *frames,
|
||||
Window xwindow,
|
||||
GdkWindow *window);
|
||||
void meta_frames_unmanage_window (MetaFrames *frames,
|
||||
|
@ -342,8 +342,8 @@ set_background_none (Display *xdisplay,
|
||||
CWBackPixmap, &attrs);
|
||||
}
|
||||
|
||||
Window
|
||||
meta_ui_create_frame_window (MetaUI *ui,
|
||||
MetaUIFrame *
|
||||
meta_ui_create_frame (MetaUI *ui,
|
||||
Display *xdisplay,
|
||||
Visual *xvisual,
|
||||
gint x,
|
||||
@ -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
|
||||
|
@ -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,7 +59,7 @@ 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,
|
||||
|
Loading…
Reference in New Issue
Block a user