mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
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
This commit is contained in:
parent
98791271e1
commit
ff33209e1f
21
ChangeLog
21
ChangeLog
@ -1,3 +1,24 @@
|
||||
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>
|
||||
|
||||
* NEWS: Added translators' names from 2.19.8 (sorry, folks:
|
||||
|
247
src/core.c
247
src/core.c
@ -60,69 +60,64 @@ get_window (Display *xdisplay,
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_get_client_size (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int *width,
|
||||
int *height)
|
||||
meta_core_get (Display *xdisplay,
|
||||
Window xwindow,
|
||||
...)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
va_list args;
|
||||
MetaCoreGetType request;
|
||||
|
||||
if (width)
|
||||
*width = window->rect.width;
|
||||
if (height)
|
||||
*height = window->rect.height;
|
||||
MetaDisplay *display = meta_display_for_x_display (xdisplay);
|
||||
MetaWindow *window = meta_display_lookup_x_window (display, xwindow);
|
||||
|
||||
va_start (args, xwindow);
|
||||
|
||||
request = va_arg (args, MetaCoreGetType);
|
||||
|
||||
/* Now, we special-case the first request slightly. Mostly, requests
|
||||
* for information on windows which have no frame are errors.
|
||||
* But sometimes we may want to know *whether* a window has a frame.
|
||||
* In this case, pass the key META_CORE_WINDOW_HAS_FRAME
|
||||
* 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
|
||||
* exit immediately (so the values of any other requests will be
|
||||
* undefined). Otherwise it will be set to True and meta_core_get will
|
||||
* continue happily on its way.
|
||||
*/
|
||||
|
||||
if (request != META_CORE_WINDOW_HAS_FRAME &&
|
||||
(window == NULL || window->frame == NULL)) {
|
||||
meta_bug ("No such frame window 0x%lx!\n", xwindow);
|
||||
return;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_core_window_has_frame (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
while (request != META_CORE_GET_END) {
|
||||
|
||||
gpointer answer = va_arg (args, gpointer);
|
||||
|
||||
switch (request) {
|
||||
case META_CORE_WINDOW_HAS_FRAME:
|
||||
*((gboolean*)answer) = window != NULL && window->frame != NULL;
|
||||
if (!*((gboolean*)answer)) return; /* see above */
|
||||
break;
|
||||
case META_CORE_GET_CLIENT_WIDTH:
|
||||
*((gint*)answer) = window->rect.width;
|
||||
break;
|
||||
case META_CORE_GET_CLIENT_HEIGHT:
|
||||
*((gint*)answer) = window->rect.height;
|
||||
break;
|
||||
case META_CORE_IS_TITLEBAR_ONSCREEN:
|
||||
*((gboolean*)answer) = meta_window_titlebar_is_onscreen (window);
|
||||
break;
|
||||
case META_CORE_GET_CLIENT_XWINDOW:
|
||||
*((Window*)answer) = window->xwindow;
|
||||
break;
|
||||
case META_CORE_GET_FRAME_FLAGS:
|
||||
*((MetaFrameFlags*)answer) = meta_frame_get_flags (window->frame);
|
||||
break;
|
||||
case META_CORE_GET_FRAME_TYPE:
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
return window != NULL && window->frame != NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_core_titlebar_is_onscreen (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return meta_window_titlebar_is_onscreen (window);
|
||||
}
|
||||
|
||||
Window
|
||||
meta_core_get_client_xwindow (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return window->xwindow;
|
||||
}
|
||||
|
||||
MetaFrameFlags
|
||||
meta_core_get_frame_flags (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return meta_frame_get_flags (window->frame);
|
||||
}
|
||||
|
||||
MetaFrameType
|
||||
meta_core_get_frame_type (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window;
|
||||
MetaFrameType base_type;
|
||||
|
||||
window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
base_type = META_FRAME_TYPE_LAST;
|
||||
MetaFrameType base_type = META_FRAME_TYPE_LAST;
|
||||
|
||||
switch (window->type)
|
||||
{
|
||||
@ -153,32 +148,68 @@ meta_core_get_frame_type (Display *xdisplay,
|
||||
/* No frame */
|
||||
base_type = META_FRAME_TYPE_LAST;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (base_type == META_FRAME_TYPE_LAST)
|
||||
return META_FRAME_TYPE_LAST; /* can't add border if undecorated */
|
||||
{
|
||||
/* can't add border if undecorated */
|
||||
*((MetaFrameType*)answer) = META_FRAME_TYPE_LAST;
|
||||
}
|
||||
else if (window->border_only)
|
||||
return META_FRAME_TYPE_BORDER; /* override base frame type */
|
||||
{
|
||||
/* override base frame type */
|
||||
*((MetaFrameType*)answer) = META_FRAME_TYPE_BORDER;
|
||||
}
|
||||
else
|
||||
return base_type;
|
||||
{
|
||||
*((MetaFrameType*)answer) = base_type;
|
||||
}
|
||||
|
||||
GdkPixbuf*
|
||||
meta_core_get_mini_icon (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
break;
|
||||
}
|
||||
case META_CORE_GET_MINI_ICON:
|
||||
*((GdkPixbuf**)answer) = window->mini_icon;
|
||||
break;
|
||||
case META_CORE_GET_ICON:
|
||||
*((GdkPixbuf**)answer) = window->icon;
|
||||
break;
|
||||
case META_CORE_GET_X:
|
||||
meta_window_get_position (window, (int*)answer, NULL);
|
||||
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;
|
||||
|
||||
return window->mini_icon;
|
||||
default:
|
||||
meta_warning(_("Unknown window information request: %d"), request);
|
||||
}
|
||||
|
||||
GdkPixbuf*
|
||||
meta_core_get_icon (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
request = va_arg (args, MetaCoreGetType);
|
||||
}
|
||||
|
||||
return window->icon;
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
void
|
||||
@ -275,32 +306,6 @@ meta_core_user_focus (Display *xdisplay,
|
||||
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
|
||||
meta_core_minimize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
@ -451,36 +456,6 @@ meta_core_get_active_workspace (Screen *xscreen)
|
||||
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
|
||||
meta_core_show_window_menu (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
@ -730,20 +705,6 @@ meta_core_set_screen_cursor (Display *xdisplay,
|
||||
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
|
||||
meta_core_increment_event_serial (Display *xdisplay)
|
||||
{
|
||||
|
108
src/core.h
108
src/core.h
@ -29,30 +29,68 @@
|
||||
#include <gdk/gdkx.h>
|
||||
#include "common.h"
|
||||
|
||||
void meta_core_get_client_size (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int *width,
|
||||
int *height);
|
||||
typedef enum
|
||||
{
|
||||
META_CORE_GET_END = 0,
|
||||
META_CORE_WINDOW_HAS_FRAME,
|
||||
META_CORE_GET_CLIENT_WIDTH,
|
||||
META_CORE_GET_CLIENT_HEIGHT,
|
||||
META_CORE_IS_TITLEBAR_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_X,
|
||||
META_CORE_GET_Y,
|
||||
META_CORE_GET_FRAME_WORKSPACE,
|
||||
META_CORE_GET_FRAME_X,
|
||||
META_CORE_GET_FRAME_Y,
|
||||
META_CORE_GET_FRAME_WIDTH,
|
||||
META_CORE_GET_FRAME_HEIGHT,
|
||||
META_CORE_GET_SCREEN_WIDTH,
|
||||
META_CORE_GET_SCREEN_HEIGHT,
|
||||
} MetaCoreGetType;
|
||||
|
||||
gboolean meta_core_titlebar_is_onscreen (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
gboolean meta_core_window_has_frame (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
|
||||
Window meta_core_get_client_xwindow (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
MetaFrameFlags meta_core_get_frame_flags (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
MetaFrameType meta_core_get_frame_type (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
GdkPixbuf* meta_core_get_mini_icon (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
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,
|
||||
Window frame_xwindow);
|
||||
@ -78,17 +116,6 @@ void meta_core_user_focus (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
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,
|
||||
Window frame_xwindow);
|
||||
void meta_core_toggle_maximize (Display *xdisplay,
|
||||
@ -126,14 +153,6 @@ const char* meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
Window xroot,
|
||||
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,
|
||||
Window frame_xwindow,
|
||||
int root_x,
|
||||
@ -170,11 +189,6 @@ void meta_core_set_screen_cursor (Display *xdisplay,
|
||||
Window frame_on_screen,
|
||||
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
|
||||
* really shouldn't cause focus changes, by comparing the event serial
|
||||
* of the EnterNotify and the UnmapNotify.
|
||||
|
128
src/frames.c
128
src/frames.c
@ -447,8 +447,10 @@ meta_frames_ensure_layout (MetaFrames *frames,
|
||||
|
||||
widget = GTK_WIDGET (frames);
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
type = meta_core_get_frame_type (gdk_display, frame->xwindow);
|
||||
meta_core_get (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 (),
|
||||
type, flags);
|
||||
@ -527,11 +529,12 @@ meta_frames_calc_geometry (MetaFrames *frames,
|
||||
MetaFrameType type;
|
||||
MetaButtonLayout button_layout;
|
||||
|
||||
meta_core_get_client_size (gdk_display, frame->xwindow,
|
||||
&width, &height);
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
type = meta_core_get_frame_type (gdk_display, frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_CLIENT_WIDTH, &width,
|
||||
META_CORE_GET_CLIENT_HEIGHT, &height,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_FRAME_TYPE, &type,
|
||||
META_CORE_GET_END);
|
||||
|
||||
meta_frames_ensure_layout (frames, frame);
|
||||
|
||||
@ -678,8 +681,10 @@ meta_frames_get_geometry (MetaFrames *frames,
|
||||
if (frame == NULL)
|
||||
meta_bug ("No such frame 0x%lx\n", xwindow);
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
type = meta_core_get_frame_type (gdk_display, frame->xwindow);
|
||||
meta_core_get (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);
|
||||
|
||||
@ -914,8 +919,9 @@ meta_frames_apply_shapes (MetaFrames *frames,
|
||||
&attrs);
|
||||
|
||||
/* Copy the client's shape to the temporary shape_window */
|
||||
client_window = meta_core_get_client_xwindow (gdk_display,
|
||||
frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_CLIENT_XWINDOW, &client_window,
|
||||
META_CORE_GET_END);
|
||||
|
||||
XShapeCombineShape (gdk_display, shape_window, ShapeBounding,
|
||||
fgeom.left_width,
|
||||
@ -1213,7 +1219,9 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
||||
{
|
||||
case META_ACTION_TITLEBAR_TOGGLE_SHADE:
|
||||
{
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_END);
|
||||
|
||||
if (flags & META_FRAME_ALLOWS_SHADE)
|
||||
{
|
||||
@ -1231,7 +1239,9 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
||||
|
||||
case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE:
|
||||
{
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_END);
|
||||
|
||||
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
||||
{
|
||||
@ -1242,7 +1252,9 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
||||
|
||||
case META_ACTION_TITLEBAR_MINIMIZE:
|
||||
{
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_END);
|
||||
|
||||
if (flags & META_FRAME_ALLOWS_MINIMIZE)
|
||||
{
|
||||
@ -1463,6 +1475,7 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
control == META_FRAME_CONTROL_RESIZE_W))
|
||||
{
|
||||
MetaGrabOp op;
|
||||
gboolean titlebar_is_onscreen;
|
||||
|
||||
op = META_GRAB_OP_NONE;
|
||||
|
||||
@ -1497,8 +1510,11 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!meta_core_titlebar_is_onscreen (gdk_display,
|
||||
frame->xwindow))
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_IS_TITLEBAR_ONSCREEN, &titlebar_is_onscreen,
|
||||
META_CORE_GET_END);
|
||||
|
||||
if (!titlebar_is_onscreen)
|
||||
meta_core_show_window_menu (gdk_display,
|
||||
frame->xwindow,
|
||||
event->x_root,
|
||||
@ -1522,7 +1538,9 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
{
|
||||
MetaFrameFlags flags;
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_END);
|
||||
|
||||
if (flags & META_FRAME_ALLOWS_MOVE)
|
||||
{
|
||||
@ -2010,16 +2028,20 @@ populate_cache (MetaFrames *frames,
|
||||
int width, height;
|
||||
int frame_width, frame_height, screen_width, screen_height;
|
||||
CachedPixels *pixels;
|
||||
MetaFrameType frame_type;
|
||||
MetaFrameFlags frame_flags;
|
||||
int i;
|
||||
|
||||
meta_core_get_frame_extents (gdk_display,
|
||||
frame->xwindow,
|
||||
NULL, NULL,
|
||||
&frame_width, &frame_height);
|
||||
|
||||
meta_core_get_screen_size (gdk_display,
|
||||
frame->xwindow,
|
||||
&screen_width, &screen_height);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_WIDTH, &frame_width,
|
||||
META_CORE_GET_FRAME_HEIGHT, &frame_height,
|
||||
META_CORE_GET_SCREEN_WIDTH, &screen_width,
|
||||
META_CORE_GET_SCREEN_HEIGHT, &screen_height,
|
||||
META_CORE_GET_CLIENT_WIDTH, &width,
|
||||
META_CORE_GET_CLIENT_HEIGHT, &height,
|
||||
META_CORE_GET_FRAME_TYPE, &frame_type,
|
||||
META_CORE_GET_FRAME_FLAGS, &frame_flags,
|
||||
META_CORE_GET_END);
|
||||
|
||||
/* don't cache extremely large windows */
|
||||
if (frame_width > 2 * screen_width ||
|
||||
@ -2029,13 +2051,11 @@ populate_cache (MetaFrames *frames,
|
||||
}
|
||||
|
||||
meta_theme_get_frame_borders (meta_theme_get_current (),
|
||||
meta_core_get_frame_type (gdk_display, frame->xwindow),
|
||||
frame_type,
|
||||
frame->text_height,
|
||||
meta_core_get_frame_flags (gdk_display, frame->xwindow),
|
||||
frame_flags,
|
||||
&top, &bottom, &left, &right);
|
||||
|
||||
meta_core_get_client_size (gdk_display, frame->xwindow, &width, &height);
|
||||
|
||||
pixels = get_cache (frames, frame);
|
||||
|
||||
/* Setup the rectangles for the four frame borders. First top, then
|
||||
@ -2088,14 +2108,14 @@ clip_to_screen (GdkRegion *region, MetaUIFrame *frame)
|
||||
* is crucial to handle huge client windows,
|
||||
* like "xterm -geometry 1000x1000"
|
||||
*/
|
||||
meta_core_get_frame_extents (gdk_display,
|
||||
frame->xwindow,
|
||||
&frame_area.x, &frame_area.y,
|
||||
&frame_area.width, &frame_area.height);
|
||||
|
||||
meta_core_get_screen_size (gdk_display,
|
||||
frame->xwindow,
|
||||
&screen_area.width, &screen_area.height);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_X, &frame_area.x,
|
||||
META_CORE_GET_FRAME_Y, &frame_area.y,
|
||||
META_CORE_GET_FRAME_WIDTH, &frame_area.width,
|
||||
META_CORE_GET_FRAME_HEIGHT, &frame_area.height,
|
||||
META_CORE_GET_SCREEN_WIDTH, &screen_area.height,
|
||||
META_CORE_GET_SCREEN_HEIGHT, &screen_area.height,
|
||||
META_CORE_GET_END);
|
||||
|
||||
gdk_region_offset (region, frame_area.x, frame_area.y);
|
||||
|
||||
@ -2311,13 +2331,14 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
|
||||
button_states[META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND] =
|
||||
button_states[META_BUTTON_TYPE_CLOSE];
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
type = meta_core_get_frame_type (gdk_display, frame->xwindow);
|
||||
mini_icon = meta_core_get_mini_icon (gdk_display, frame->xwindow);
|
||||
icon = meta_core_get_icon (gdk_display, frame->xwindow);
|
||||
|
||||
meta_core_get_client_size (gdk_display, frame->xwindow,
|
||||
&w, &h);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_FRAME_TYPE, &type,
|
||||
META_CORE_GET_MINI_ICON, &mini_icon,
|
||||
META_CORE_GET_ICON, &icon,
|
||||
META_CORE_GET_CLIENT_WIDTH, &w,
|
||||
META_CORE_GET_CLIENT_HEIGHT, &h,
|
||||
META_CORE_GET_END);
|
||||
|
||||
meta_frames_ensure_layout (frames, frame);
|
||||
|
||||
@ -2339,9 +2360,10 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
|
||||
type, frame->text_height, flags,
|
||||
&top, &bottom, &left, &right);
|
||||
|
||||
meta_core_get_screen_size (gdk_display,
|
||||
frame->xwindow,
|
||||
&screen_width, &screen_height);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_SCREEN_WIDTH, &screen_width,
|
||||
META_CORE_GET_SCREEN_HEIGHT, &screen_height,
|
||||
META_CORE_GET_END);
|
||||
|
||||
edges = gdk_region_copy (region);
|
||||
|
||||
@ -2432,12 +2454,14 @@ meta_frames_set_window_background (MetaFrames *frames,
|
||||
MetaFrameStyle *style;
|
||||
gboolean frame_exists;
|
||||
|
||||
frame_exists = meta_core_window_has_frame (gdk_display, frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_WINDOW_HAS_FRAME, &frame_exists,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_FRAME_TYPE, &type,
|
||||
META_CORE_GET_END);
|
||||
|
||||
if (frame_exists)
|
||||
{
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
type = meta_core_get_frame_type (gdk_display, frame->xwindow);
|
||||
style = meta_theme_get_frame_style (meta_theme_get_current (),
|
||||
type, flags);
|
||||
}
|
||||
@ -2613,7 +2637,9 @@ get_control (MetaFrames *frames,
|
||||
if (POINT_IN_RECT (x, y, fgeom.menu_rect.clickable))
|
||||
return META_FRAME_CONTROL_MENU;
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
meta_core_get (gdk_display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_END);
|
||||
|
||||
has_vert = (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) != 0;
|
||||
has_horiz = (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) != 0;
|
||||
|
Loading…
Reference in New Issue
Block a user