Commit ff33209e authored by Thomas Thurman's avatar Thomas Thurman Committed by Thomas James Alexander Thurman

changed all tabs to spaces. Removed and replaced with meta_core_get(). New

2007-06-06  Thomas Thurman  <thomas@thurman.org.uk>

        * frames.c, core.[ch]: changed all tabs to spaces.
        * core.[ch] (meta_core_get_client_size, meta_core_window_has_frame,
        meta_core_titlebar_is_onscreen, meta_core_get_client_xwindow,
        meta_core_get_frame_flags, meta_core_get_frame_type,
        meta_core_get_mini_icon, meta_core_get_icon, meta_core_get_position,
        meta_core_get_size, meta_core_get_frame_workspace,
        meta_core_get_frame_extents, meta_core_get_screen_size): Removed
        and replaced with meta_core_get().
        * core.[ch] (meta_core_get): New function.
        * core.h (MetaCoreGetType): New enum.
        * frames.c (meta_frames_ensure_layout, meta_frames_calc_geometry,
        meta_frames_get_geometry, meta_frames_apply_shapes,
        meta_frame_titlebar_event, meta_frames_button_press_event,
        populate_cache, clip_to_screen, meta_frames_paint_to_drawable,
        meta_frames_set_window_background, get_control): Replace use of
        removed functions in ui.c with meta_core_get().

        All this should make things a little faster. Closes #377495.


svn path=/trunk/; revision=3233
parent 98791271
2007-06-06 Thomas Thurman <thomas@thurman.org.uk>
* frames.c, core.[ch]: changed all tabs to spaces.
* core.[ch] (meta_core_get_client_size, meta_core_window_has_frame,
meta_core_titlebar_is_onscreen, meta_core_get_client_xwindow,
meta_core_get_frame_flags, meta_core_get_frame_type,
meta_core_get_mini_icon, meta_core_get_icon, meta_core_get_position,
meta_core_get_size, meta_core_get_frame_workspace,
meta_core_get_frame_extents, meta_core_get_screen_size): Removed
and replaced with meta_core_get().
* core.[ch] (meta_core_get): New function.
* core.h (MetaCoreGetType): New enum.
* frames.c (meta_frames_ensure_layout, meta_frames_calc_geometry,
meta_frames_get_geometry, meta_frames_apply_shapes,
meta_frame_titlebar_event, meta_frames_button_press_event,
populate_cache, clip_to_screen, meta_frames_paint_to_drawable,
meta_frames_set_window_background, get_control): Replace use of
removed functions in ui.c with meta_core_get().
All this should make things a little faster. Closes #377495.
2007-06-04 Thomas Thurman <thomas@thurman.org.uk> 2007-06-04 Thomas Thurman <thomas@thurman.org.uk>
* NEWS: Added translators' names from 2.19.8 (sorry, folks: * NEWS: Added translators' names from 2.19.8 (sorry, folks:
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
*/ */
static MetaWindow * static MetaWindow *
get_window (Display *xdisplay, get_window (Display *xdisplay,
Window frame_xwindow) Window frame_xwindow)
{ {
MetaDisplay *display; MetaDisplay *display;
MetaWindow *window; MetaWindow *window;
...@@ -60,125 +60,156 @@ get_window (Display *xdisplay, ...@@ -60,125 +60,156 @@ get_window (Display *xdisplay,
} }
void void
meta_core_get_client_size (Display *xdisplay, meta_core_get (Display *xdisplay,
Window frame_xwindow, Window xwindow,
int *width, ...)
int *height) {
{ va_list args;
MetaWindow *window = get_window (xdisplay, frame_xwindow); MetaCoreGetType request;
if (width) MetaDisplay *display = meta_display_for_x_display (xdisplay);
*width = window->rect.width; MetaWindow *window = meta_display_lookup_x_window (display, xwindow);
if (height)
*height = window->rect.height; va_start (args, xwindow);
}
request = va_arg (args, MetaCoreGetType);
gboolean
meta_core_window_has_frame (Display *xdisplay, /* Now, we special-case the first request slightly. Mostly, requests
Window frame_xwindow) * for information on windows which have no frame are errors.
{ * But sometimes we may want to know *whether* a window has a frame.
MetaDisplay *display; * In this case, pass the key META_CORE_WINDOW_HAS_FRAME
MetaWindow *window; * as the *first* request, with a pointer to a boolean; if the window
* has no frame, this will be set to False and meta_core_get will
display = meta_display_for_x_display (xdisplay); * exit immediately (so the values of any other requests will be
window = meta_display_lookup_x_window (display, frame_xwindow); * undefined). Otherwise it will be set to True and meta_core_get will
* continue happily on its way.
return window != NULL && window->frame != NULL; */
}
if (request != META_CORE_WINDOW_HAS_FRAME &&
gboolean (window == NULL || window->frame == NULL)) {
meta_core_titlebar_is_onscreen (Display *xdisplay, meta_bug ("No such frame window 0x%lx!\n", xwindow);
Window frame_xwindow) return;
{ }
MetaWindow *window = get_window (xdisplay, frame_xwindow);
while (request != META_CORE_GET_END) {
return meta_window_titlebar_is_onscreen (window);
} gpointer answer = va_arg (args, gpointer);
Window switch (request) {
meta_core_get_client_xwindow (Display *xdisplay, case META_CORE_WINDOW_HAS_FRAME:
Window frame_xwindow) *((gboolean*)answer) = window != NULL && window->frame != NULL;
{ if (!*((gboolean*)answer)) return; /* see above */
MetaWindow *window = get_window (xdisplay, frame_xwindow); break;
case META_CORE_GET_CLIENT_WIDTH:
return window->xwindow; *((gint*)answer) = window->rect.width;
} break;
case META_CORE_GET_CLIENT_HEIGHT:
MetaFrameFlags *((gint*)answer) = window->rect.height;
meta_core_get_frame_flags (Display *xdisplay, break;
Window frame_xwindow) case META_CORE_IS_TITLEBAR_ONSCREEN:
{ *((gboolean*)answer) = meta_window_titlebar_is_onscreen (window);
MetaWindow *window = get_window (xdisplay, frame_xwindow); break;
case META_CORE_GET_CLIENT_XWINDOW:
return meta_frame_get_flags (window->frame); *((Window*)answer) = window->xwindow;
} break;
case META_CORE_GET_FRAME_FLAGS:
MetaFrameType *((MetaFrameFlags*)answer) = meta_frame_get_flags (window->frame);
meta_core_get_frame_type (Display *xdisplay, break;
Window frame_xwindow) case META_CORE_GET_FRAME_TYPE:
{ {
MetaWindow *window; MetaFrameType base_type = META_FRAME_TYPE_LAST;
MetaFrameType base_type;
switch (window->type)
{
case META_WINDOW_NORMAL:
base_type = META_FRAME_TYPE_NORMAL;
break;
case META_WINDOW_DIALOG:
base_type = META_FRAME_TYPE_DIALOG;
break;
case META_WINDOW_MODAL_DIALOG:
base_type = META_FRAME_TYPE_MODAL_DIALOG;
break;
case META_WINDOW_MENU:
base_type = META_FRAME_TYPE_MENU;
break;
case META_WINDOW_UTILITY:
base_type = META_FRAME_TYPE_UTILITY;
break;
case META_WINDOW_DESKTOP:
case META_WINDOW_DOCK:
case META_WINDOW_TOOLBAR:
case META_WINDOW_SPLASHSCREEN:
/* No frame */
base_type = META_FRAME_TYPE_LAST;
break;
window = get_window (xdisplay, frame_xwindow); }
base_type = META_FRAME_TYPE_LAST; if (base_type == META_FRAME_TYPE_LAST)
{
switch (window->type) /* can't add border if undecorated */
{ *((MetaFrameType*)answer) = META_FRAME_TYPE_LAST;
case META_WINDOW_NORMAL: }
base_type = META_FRAME_TYPE_NORMAL; else if (window->border_only)
break; {
/* override base frame type */
case META_WINDOW_DIALOG: *((MetaFrameType*)answer) = META_FRAME_TYPE_BORDER;
base_type = META_FRAME_TYPE_DIALOG; }
break; else
{
case META_WINDOW_MODAL_DIALOG: *((MetaFrameType*)answer) = base_type;
base_type = META_FRAME_TYPE_MODAL_DIALOG; }
break;
case META_WINDOW_MENU:
base_type = META_FRAME_TYPE_MENU;
break;
case META_WINDOW_UTILITY: break;
base_type = META_FRAME_TYPE_UTILITY; }
break; case META_CORE_GET_MINI_ICON:
*((GdkPixbuf**)answer) = window->mini_icon;
case META_WINDOW_DESKTOP: break;
case META_WINDOW_DOCK: case META_CORE_GET_ICON:
case META_WINDOW_TOOLBAR: *((GdkPixbuf**)answer) = window->icon;
case META_WINDOW_SPLASHSCREEN: break;
/* No frame */ case META_CORE_GET_X:
base_type = META_FRAME_TYPE_LAST; meta_window_get_position (window, (int*)answer, NULL);
break; break;
case META_CORE_GET_Y:
meta_window_get_position (window, NULL, (int*)answer);
break;
case META_CORE_GET_FRAME_WORKSPACE:
*((gint*)answer) = meta_window_get_net_wm_desktop (window);
break;
case META_CORE_GET_FRAME_X:
*((gint*)answer) = window->frame->rect.x;
break;
case META_CORE_GET_FRAME_Y:
*((gint*)answer) = window->frame->rect.y;
break;
case META_CORE_GET_FRAME_WIDTH:
*((gint*)answer) = window->frame->rect.width;
break;
case META_CORE_GET_FRAME_HEIGHT:
*((gint*)answer) = window->frame->rect.height;
break;
case META_CORE_GET_SCREEN_WIDTH:
*((gint*)answer) = window->screen->rect.width;
break;
case META_CORE_GET_SCREEN_HEIGHT:
*((gint*)answer) = window->screen->rect.height;
break;
default:
meta_warning(_("Unknown window information request: %d"), request);
} }
if (base_type == META_FRAME_TYPE_LAST) request = va_arg (args, MetaCoreGetType);
return META_FRAME_TYPE_LAST; /* can't add border if undecorated */ }
else if (window->border_only)
return META_FRAME_TYPE_BORDER; /* override base frame type */
else
return base_type;
}
GdkPixbuf* va_end (args);
meta_core_get_mini_icon (Display *xdisplay,
Window frame_xwindow)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
return window->mini_icon;
}
GdkPixbuf*
meta_core_get_icon (Display *xdisplay,
Window frame_xwindow)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
return window->icon;
} }
void void
...@@ -275,32 +306,6 @@ meta_core_user_focus (Display *xdisplay, ...@@ -275,32 +306,6 @@ meta_core_user_focus (Display *xdisplay,
meta_window_focus (window, timestamp); meta_window_focus (window, timestamp);
} }
void
meta_core_get_position (Display *xdisplay,
Window frame_xwindow,
int *x,
int *y)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
meta_window_get_position (window, x, y);
}
void
meta_core_get_size (Display *xdisplay,
Window frame_xwindow,
int *width,
int *height)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
if (width)
*width = window->rect.width;
if (height)
*height = window->rect.height;
}
void void
meta_core_minimize (Display *xdisplay, meta_core_minimize (Display *xdisplay,
Window frame_xwindow) Window frame_xwindow)
...@@ -451,36 +456,6 @@ meta_core_get_active_workspace (Screen *xscreen) ...@@ -451,36 +456,6 @@ meta_core_get_active_workspace (Screen *xscreen)
return meta_workspace_index (screen->active_workspace); return meta_workspace_index (screen->active_workspace);
} }
int
meta_core_get_frame_workspace (Display *xdisplay,
Window frame_xwindow)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
return meta_window_get_net_wm_desktop (window);
}
void
meta_core_get_frame_extents (Display *xdisplay,
Window frame_xwindow,
int *x,
int *y,
int *width,
int *height)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
if (x)
*x = window->frame->rect.x;
if (y)
*y = window->frame->rect.y;
if (width)
*width = window->frame->rect.width;
if (height)
*height = window->frame->rect.height;
}
void void
meta_core_show_window_menu (Display *xdisplay, meta_core_show_window_menu (Display *xdisplay,
Window frame_xwindow, Window frame_xwindow,
...@@ -730,20 +705,6 @@ meta_core_set_screen_cursor (Display *xdisplay, ...@@ -730,20 +705,6 @@ meta_core_set_screen_cursor (Display *xdisplay,
meta_frame_set_screen_cursor (window->frame, cursor); meta_frame_set_screen_cursor (window->frame, cursor);
} }
void
meta_core_get_screen_size (Display *xdisplay,
Window frame_on_screen,
int *width,
int *height)
{
MetaWindow *window = get_window (xdisplay, frame_on_screen);
if (width)
*width = window->screen->rect.width;
if (height)
*height = window->screen->rect.height;
}
void void
meta_core_increment_event_serial (Display *xdisplay) meta_core_increment_event_serial (Display *xdisplay)
{ {
......
...@@ -29,30 +29,68 @@ ...@@ -29,30 +29,68 @@
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include "common.h" #include "common.h"
void meta_core_get_client_size (Display *xdisplay, typedef enum
Window frame_xwindow, {
int *width, META_CORE_GET_END = 0,
int *height); META_CORE_WINDOW_HAS_FRAME,
META_CORE_GET_CLIENT_WIDTH,
gboolean meta_core_titlebar_is_onscreen (Display *xdisplay, META_CORE_GET_CLIENT_HEIGHT,
Window frame_xwindow); META_CORE_IS_TITLEBAR_ONSCREEN,
META_CORE_GET_CLIENT_XWINDOW,
gboolean meta_core_window_has_frame (Display *xdisplay, META_CORE_GET_FRAME_FLAGS,
Window frame_xwindow); META_CORE_GET_FRAME_TYPE,
META_CORE_GET_MINI_ICON,
META_CORE_GET_ICON,
Window meta_core_get_client_xwindow (Display *xdisplay, META_CORE_GET_X,
Window frame_xwindow); META_CORE_GET_Y,
META_CORE_GET_FRAME_WORKSPACE,
MetaFrameFlags meta_core_get_frame_flags (Display *xdisplay, META_CORE_GET_FRAME_X,
Window frame_xwindow); META_CORE_GET_FRAME_Y,
MetaFrameType meta_core_get_frame_type (Display *xdisplay, META_CORE_GET_FRAME_WIDTH,
Window frame_xwindow); META_CORE_GET_FRAME_HEIGHT,
META_CORE_GET_SCREEN_WIDTH,
GdkPixbuf* meta_core_get_mini_icon (Display *xdisplay, META_CORE_GET_SCREEN_HEIGHT,
Window frame_xwindow); } MetaCoreGetType;
GdkPixbuf* meta_core_get_icon (Display *xdisplay,
Window frame_xwindow); /* General information function about the given window. Pass in a sequence of
* pairs of MetaCoreGetTypes and pointers to variables; the variables will be
* filled with the requested values. End the list with META_CORE_GET_END.
* For example:
*
* meta_core_get (my_display, my_window,
* META_CORE_GET_X, &x,
* META_CORE_GET_Y, &y,
* META_CORE_GET_END);
*
* If the window doesn't have a frame, this will raise a meta_bug. To suppress
* this behaviour, ask META_CORE_WINDOW_HAS_FRAME as the *first* question in
* the list. If the window has no frame, the answer to this question will be
* False, and anything else you asked will be undefined. Otherwise, the answer
* will be True. The answer will necessarily be True if you ask the question
* in any other position. The positions of all other questions don't matter.
*
* The reason for this function is that some parts of the program don't know
* about MetaWindows. But they *can* see core.h. So we used to have a whole
* load of functions which took a display and an X window, looked up the
* relevant MetaWindow, and returned information about it. The trouble with
* that is that looking up the MetaWindow is a nontrivial operation, and
* consolidating the calls in this way makes (for example) frame exposes
* 33% faster, according to valgrind.
*
* This function would perhaps be slightly better if the questions were
* represented by pointers, perhaps gchar*s, because then we could take
* advantage of gcc's automatic sentinel checking. On the other hand, this
* immediately suggests string comparison, and that's slow.
*
* Another possible improvement is that core.h still has a bunch of
* functions which can't be described by the formula "give a display and
* an X window, get a single value" (meta_core_user_move, for example), but
* which could theoretically be handled by this function if we relaxed the
* requirement that all questions should have exactly one argument.
*/
void meta_core_get (Display *xdisplay,
Window window,
...);
void meta_core_queue_frame_resize (Display *xdisplay, void meta_core_queue_frame_resize (Display *xdisplay,
Window frame_xwindow); Window frame_xwindow);
...@@ -78,17 +116,6 @@ void meta_core_user_focus (Display *xdisplay, ...@@ -78,17 +116,6 @@ void meta_core_user_focus (Display *xdisplay,
Window frame_xwindow, Window frame_xwindow,
guint32 timestamp); guint32 timestamp);
/* get position of client, same coord space expected by move */
void meta_core_get_position (Display *xdisplay,
Window frame_xwindow,
int *x,
int *y);
void meta_core_get_size (Display *xdisplay,
Window frame_xwindow,
int *width,
int *height);
void meta_core_minimize (Display *xdisplay, void meta_core_minimize (Display *xdisplay,
Window frame_xwindow); Window frame_xwindow);
void meta_core_toggle_maximize (Display *xdisplay, void meta_core_toggle_maximize (Display *xdisplay,
...@@ -126,14 +153,6 @@ const char* meta_core_get_workspace_name_with_index (Display *xdisplay, ...@@ -126,14 +153,6 @@ const char* meta_core_get_workspace_name_with_index (Display *xdisplay,
Window xroot, Window xroot,
int index); int index);
void meta_core_get_frame_extents (Display *xdisplay,
Window frame_xwindow,
int *x,
int *y,
int *width,
int *height);
void meta_core_show_window_menu (Display *xdisplay, void meta_core_show_window_menu (Display *xdisplay,
Window frame_xwindow, Window frame_xwindow,
int root_x, int root_x,
...@@ -170,11 +189,6 @@ void meta_core_set_screen_cursor (Display *xdisplay, ...@@ -170,11 +189,6 @@ void meta_core_set_screen_cursor (Display *xdisplay,
Window frame_on_screen, Window frame_on_screen,
MetaCursor cursor); MetaCursor cursor);
void meta_core_get_screen_size (Display *xdisplay,
Window frame_on_screen,
int *width,
int *height);
/* Used because we ignore EnterNotify when a window is unmapped that /* Used because we ignore EnterNotify when a window is unmapped that
* really shouldn't cause focus changes, by comparing the event serial * really shouldn't cause focus changes, by comparing the event serial
* of the EnterNotify and the UnmapNotify. * of the EnterNotify and the UnmapNotify.
......
...@@ -73,8 +73,8 @@ static void meta_frames_paint_to_drawable (MetaFrames *frames, ...@@ -73,8 +73,8 @@ static void meta_frames_paint_to_drawable (MetaFrames *frames,
MetaUIFrame *frame, MetaUIFrame *frame,
GdkDrawable *drawable, GdkDrawable *drawable,
GdkRegion *region, GdkRegion *region,
int x_offset, int x_offset,
int y_offset); int y_offset);
static void meta_frames_set_window_background (MetaFrames *frames, static void meta_frames_set_window_background (MetaFrames *frames,
MetaUIFrame *frame); MetaUIFrame *frame);
...@@ -102,7 +102,7 @@ static MetaFrameControl get_control (MetaFrames *frames, ...@@ -102,7 +102,7 @@ static MetaFrameControl get_control (MetaFrames *frames,
static void clear_tip (MetaFrames *frames); static void clear_tip (MetaFrames *frames);
static void invalidate_all_caches (MetaFrames *frames); static void invalidate_all_caches (MetaFrames *frames);
static void invalidate_whole_window (MetaFrames *frames, static void invalidate_whole_window (MetaFrames *frames,
MetaUIFrame *frame); MetaUIFrame *frame);
static GtkWidgetClass *parent_class = NULL; static GtkWidgetClass *parent_class = NULL;
...@@ -115,12 +115,12 @@ meta_frames_get_type (void) ...@@ -115,12 +115,12 @@ meta_frames_get_type (void)
{ {
static const GtkTypeInfo frames_info = static const GtkTypeInfo frames_info =
{ {
"MetaFrames", "MetaFrames",
sizeof (MetaFrames), sizeof (MetaFrames),
sizeof (MetaFramesClass), sizeof (MetaFramesClass),
(GtkClassInitFunc) meta_frames_class_init, (GtkClassInitFunc) meta_frames_class_init,
(GtkObjectInitFunc) meta_frames_init, (GtkObjectInitFunc) meta_frames_init,
/* reserved_1 */ NULL, /* reserved_1 */ NULL,
/* reserved_2 */ NULL, /* reserved_2 */ NULL,
(GtkClassInitFunc) NULL, (GtkClassInitFunc) NULL,
}; };
...@@ -295,7 +295,7 @@ typedef struct ...@@ -295,7 +295,7 @@ typedef struct
static CachedPixels * static CachedPixels *
get_cache (MetaFrames *frames, get_cache (MetaFrames *frames,
MetaUIFrame *frame) MetaUIFrame *frame)
{ {
CachedPixels *pixels; CachedPixels *pixels;
...@@ -312,7 +312,7 @@ get_cache (MetaFrames *frames, ...@@ -312,7 +312,7 @@ get_cache (MetaFrames *frames,
static void static void
invalidate_cache (MetaFrames *frames, invalidate_cache (MetaFrames *frames,
MetaUIFrame *frame) MetaUIFrame *frame)
{ {
CachedPixels *pixels = get_cache (frames, frame); CachedPixels *pixels = get_cache (frames, frame);
int i; int i;
...@@ -447,8 +447,10 @@ meta_frames_ensure_layout (MetaFrames *frames, ...@@ -447,8 +447,10 @@ meta_frames_ensure_layout (MetaFrames *frames,
widget = GTK_WIDGET (frames); widget = GTK_WIDGET (frames);
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow); meta_core_get (gdk_display, frame->xwindow,
type = meta_core_get_frame_type (gdk_display, frame->xwindow); META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_FRAME_TYPE, &type,
META_CORE_GET_END);
style = meta_theme_get_frame_style (meta_theme_get_current (), style = meta_theme_get_frame_style (meta_theme_get_current (),
type, flags); type, flags);
...@@ -485,7 +487,7 @@ meta_frames_ensure_layout (MetaFrames *frames, ...@@ -485,7 +487,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
pango_layout_set_auto_dir (frame->layout, FALSE); pango_layout_set_auto_dir (frame->layout, FALSE);
font_desc = meta_gtk_widget_get_font_desc (widget, scale, font_desc = meta_gtk_widget_get_font_desc (widget, scale,
meta_prefs_get_titlebar_font ()); meta_prefs_get_titlebar_font ());
size = pango_font_description_get_size (font_desc); size = pango_font_description_get_size (font_desc);
...@@ -507,7 +509,7 @@ meta_frames_ensure_layout (MetaFrames *frames, ...@@ -507,7 +509,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
} }
pango_layout_set_font_description (frame->layout, pango_layout_set_font_description (frame->layout,
font_desc); font_desc);
pango_font_description_free (font_desc); pango_font_description_free (font_desc);
...@@ -527,11 +529,12 @@ meta_frames_calc_geometry (MetaFrames *frames, ...@@ -527,11 +529,12 @@ meta_frames_calc_geometry (MetaFrames *frames,
MetaFrameType type; MetaFrameType type;
MetaButtonLayout button_layout; MetaButtonLayout button_layout;
meta_core_get_client_size (gdk_display, frame->xwindow, meta_core_get (gdk_display, frame->xwindow,
&width, &height); META_CORE_GET_CLIENT_WIDTH, &width,
META_CORE_GET_CLIENT_HEIGHT, &height,
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow); META_CORE_GET_FRAME_FLAGS, &flags,
type = meta_core_get_frame_type (gdk_display, frame->xwindow); META_CORE_GET_FRAME_TYPE, &type,
META_CORE_GET_END);
meta_frames_ensure_layout (frames, frame); meta_frames_ensure_layout (frames, frame);
...@@ -552,17 +555,17 @@ meta_frames_new (int screen_number) ...@@ -552,17 +555,17 @@ meta_frames_new (int screen_number)
GdkScreen *screen; GdkScreen *screen;
screen = gdk_display_get_screen (gdk_display_get_default (), screen = gdk_display_get_screen (gdk_display_get_default (),
screen_number); screen_number);
return g_object_new (META_TYPE_FRAMES, return g_object_new (META_TYPE_FRAMES,
"screen", screen, "screen", screen,
NULL); NULL);
} }
void void
meta_frames_manage_window (MetaFrames *frames, meta_frames_manage_window (MetaFrames *frames,
Window xwindow, Window xwindow,
GdkWindow *window) GdkWindow *window)
{ {
MetaUIFrame *frame; MetaUIFrame *frame;
...@@ -614,8 +617,8 @@ meta_frames_unmanage_window (MetaFrames *frames, ...@@ -614,8 +617,8 @@ meta_frames_unmanage_window (MetaFrames *frames,
/* restore the cursor */ /* restore the cursor */
meta_core_set_screen_cursor (gdk_display, meta_core_set_screen_cursor (gdk_display,
frame->xwindow, frame->xwindow,
META_CURSOR_DEFAULT); META_CURSOR_DEFAULT);
gdk_window_set_user_data (frame->window, NULL); gdk_window_set_user_data (frame->window, NULL);
...@@ -678,8 +681,10 @@ meta_frames_get_geometry (MetaFrames *frames, ...@@ -678,8 +681,10 @@ meta_frames_get_geometry (MetaFrames *frames,
if (frame == NULL) if (frame == NULL)
meta_bug ("No such frame 0x%lx\n", xwindow); meta_bug ("No such frame 0x%lx\n", xwindow);
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow); meta_core_get (gdk_display, frame->xwindow,
type = meta_core_get_frame_type (gdk_display, frame->xwindow); META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_FRAME_TYPE, &type,
META_CORE_GET_END);
g_return_if_fail (type < META_FRAME_TYPE_LAST); g_return_if_fail (type < META_FRAME_TYPE_LAST);
...@@ -914,8 +919,9 @@ meta_frames_apply_shapes (MetaFrames *frames, ...@@ -914,8 +919,9 @@ meta_frames_apply_shapes (MetaFrames *frames,
&attrs); &attrs);
/* Copy the client's shape to the temporary shape_window */ /* Copy the client's shape to the temporary shape_window */
client_window = meta_core_get_client_xwindow (gdk_display, meta_core_get (gdk_display, frame->xwindow,
frame->xwindow); META_CORE_GET_CLIENT_XWINDOW, &client_window,
META_CORE_GET_END);