[mutter] frames: Give Havoc and Owen a heart attack



commit 12135afa5e2016e6234d24dcfecdaa293576719a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jan 1 11:39:55 2015 -0800

    frames: Give Havoc and Owen a heart attack
    
    Break down the beautiful core/ui abstraction barrier by inserting
    a pointer to MetaWindow into a MetaUIFrame. I'm a scoundrel, I know.
    We'll use this very soon to destroy meta_core_get.

 src/core/frame.c |    1 +
 src/ui/frames.c  |    2 ++
 src/ui/frames.h  |    3 +++
 src/ui/ui.c      |    3 ++-
 src/ui/ui.h      |    2 ++
 5 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/core/frame.c b/src/core/frame.c
index bf75265..459250f 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -87,6 +87,7 @@ meta_window_ensure_frame (MetaWindow *window)
 
   frame->ui_frame = meta_ui_create_frame (window->screen->ui,
                                           window->display->xdisplay,
+                                          frame->window,
                                           visual,
                                           frame->rect.x,
                                           frame->rect.y,
diff --git a/src/ui/frames.c b/src/ui/frames.c
index e968819..a0edac4 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -512,6 +512,7 @@ meta_ui_frame_attach_style (MetaUIFrame *frame)
 
 MetaUIFrame *
 meta_frames_manage_window (MetaFrames *frames,
+                           MetaWindow *meta_window,
                            Window      xwindow,
                            GdkWindow  *window)
 {
@@ -531,6 +532,7 @@ meta_frames_manage_window (MetaFrames *frames,
   /* Don't set event mask here, it's in frame.c */
 
   frame->xwindow = xwindow;
+  frame->meta_window = meta_window;
   frame->cache_layout = NULL;
   frame->text_layout = NULL;
   frame->text_height = -1;
diff --git a/src/ui/frames.h b/src/ui/frames.h
index cafba52..7d29f36 100644
--- a/src/ui/frames.h
+++ b/src/ui/frames.h
@@ -25,6 +25,7 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 #include <meta/common.h>
+#include <meta/types.h>
 #include "theme-private.h"
 
 typedef enum
@@ -73,6 +74,7 @@ typedef struct _MetaUIFrame         MetaUIFrame;
 struct _MetaUIFrame
 {
   MetaFrames *frames;
+  MetaWindow *meta_window;
   Window xwindow;
   GdkWindow *window;
   MetaStyleInfo *style_info;
@@ -119,6 +121,7 @@ GType        meta_frames_get_type               (void) G_GNUC_CONST;
 MetaFrames *meta_frames_new (int screen_number);
 
 MetaUIFrame * meta_frames_manage_window (MetaFrames *frames,
+                                         MetaWindow *meta_window,
                                          Window      xwindow,
                                          GdkWindow  *window);
 
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 22fb087..1e2d350 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -326,6 +326,7 @@ set_background_none (Display *xdisplay,
 MetaUIFrame *
 meta_ui_create_frame (MetaUI *ui,
                       Display *xdisplay,
+                      MetaWindow *meta_window,
                       Visual *xvisual,
                       gint x,
                       gint y,
@@ -391,7 +392,7 @@ meta_ui_create_frame (MetaUI *ui,
   gdk_window_resize (window, width, height);
   set_background_none (xdisplay, GDK_WINDOW_XID (window));
 
-  return meta_frames_manage_window (ui->frames, GDK_WINDOW_XID (window), window);
+  return meta_frames_manage_window (ui->frames, meta_window, GDK_WINDOW_XID (window), window);
 }
 
 void
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 5c34410..4a4bed0 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -24,6 +24,7 @@
 
 /* Don't include gtk.h or gdk.h here */
 #include <meta/common.h>
+#include <meta/types.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <cairo.h>
@@ -52,6 +53,7 @@ void meta_ui_theme_get_frame_borders (MetaUI *ui,
 
 MetaUIFrame * meta_ui_create_frame (MetaUI *ui,
                                     Display *xdisplay,
+                                    MetaWindow *meta_window,
                                     Visual *xvisual,
                                     gint x,
                                     gint y,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]