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>
* NEWS: Added translators' names from 2.19.8 (sorry, folks:
......
......@@ -42,7 +42,7 @@
*/
static MetaWindow *
get_window (Display *xdisplay,
Window frame_xwindow)
Window frame_xwindow)
{
MetaDisplay *display;
MetaWindow *window;
......@@ -60,125 +60,156 @@ get_window (Display *xdisplay,
}
void
meta_core_get_client_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;
}
gboolean
meta_core_window_has_frame (Display *xdisplay,
Window frame_xwindow)
{
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;
meta_core_get (Display *xdisplay,
Window xwindow,
...)
{
va_list args;
MetaCoreGetType request;
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;
}
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:
{
MetaFrameType base_type = META_FRAME_TYPE_LAST;
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;
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;
if (base_type == META_FRAME_TYPE_LAST)
{
/* can't add border if undecorated */
*((MetaFrameType*)answer) = META_FRAME_TYPE_LAST;
}
else if (window->border_only)
{
/* override base frame type */
*((MetaFrameType*)answer) = META_FRAME_TYPE_BORDER;
}
else
{
*((MetaFrameType*)answer) = base_type;
}
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;
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;
default:
meta_warning(_("Unknown window information request: %d"), request);
}
if (base_type == META_FRAME_TYPE_LAST)
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;
}
request = va_arg (args, MetaCoreGetType);
}
GdkPixbuf*
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;
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)
{
......
......@@ -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);
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);
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;
/* 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.
......
......@@ -73,8 +73,8 @@ static void meta_frames_paint_to_drawable (MetaFrames *frames,
MetaUIFrame *frame,
GdkDrawable *drawable,
GdkRegion *region,
int x_offset,
int y_offset);
int x_offset,
int y_offset);
static void meta_frames_set_window_background (MetaFrames *frames,
MetaUIFrame *frame);
......@@ -102,7 +102,7 @@ static MetaFrameControl get_control (MetaFrames *frames,
static void clear_tip (MetaFrames *frames);
static void invalidate_all_caches (MetaFrames *frames);
static void invalidate_whole_window (MetaFrames *frames,
MetaUIFrame *frame);
MetaUIFrame *frame);
static GtkWidgetClass *parent_class = NULL;
......@@ -115,12 +115,12 @@ meta_frames_get_type (void)
{
static const GtkTypeInfo frames_info =
{
"MetaFrames",
sizeof (MetaFrames),
sizeof (MetaFramesClass),
(GtkClassInitFunc) meta_frames_class_init,
(GtkObjectInitFunc) meta_frames_init,
/* reserved_1 */ NULL,
"MetaFrames",
sizeof (MetaFrames),
sizeof (MetaFramesClass),
(GtkClassInitFunc) meta_frames_class_init,
(GtkObjectInitFunc) meta_frames_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......@@ -295,7 +295,7 @@ typedef struct
static CachedPixels *
get_cache (MetaFrames *frames,
MetaUIFrame *frame)
MetaUIFrame *frame)
{
CachedPixels *pixels;
......@@ -312,7 +312,7 @@ get_cache (MetaFrames *frames,
static void
invalidate_cache (MetaFrames *frames,
MetaUIFrame *frame)
MetaUIFrame *frame)
{
CachedPixels *pixels = get_cache (frames, frame);
int i;
......@@ -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);
......@@ -485,7 +487,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
pango_layout_set_auto_dir (frame->layout, FALSE);
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);
......@@ -507,7 +509,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
}
pango_layout_set_font_description (frame->layout,
font_desc);
font_desc);
pango_font_description_free (font_desc);
......@@ -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);
......@@ -552,17 +555,17 @@ meta_frames_new (int screen_number)
GdkScreen *screen;
screen = gdk_display_get_screen (gdk_display_get_default (),
screen_number);
screen_number);
return g_object_new (META_TYPE_FRAMES,
"screen", screen,
NULL);
"screen", screen,
NULL);
}
void
meta_frames_manage_window (MetaFrames *frames,
Window xwindow,
GdkWindow *window)
GdkWindow *window)
{
MetaUIFrame *frame;
......@@ -614,8 +617,8 @@ meta_frames_unmanage_window (MetaFrames *frames,
/* restore the cursor */
meta_core_set_screen_cursor (gdk_display,
frame->xwindow,
META_CURSOR_DEFAULT);
frame->xwindow,
META_CURSOR_DEFAULT);
gdk_window_set_user_data (frame->window, NULL);
......@@ -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,
......@@ -972,11 +978,11 @@ meta_frames_apply_shapes (MetaFrames *frames,
void
meta_frames_move_resize_frame (MetaFrames *frames,
Window xwindow,
int x,
int y,
int width,
int height)
Window xwindow,
int x,
int y,
int width,
int height)
{
MetaUIFrame *frame = meta_frames_lookup_window (frames, xwindow);
int old_x, old_y, old_width, old_height;
......@@ -1145,7 +1151,7 @@ show_tip_now (MetaFrames *frames)
screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
meta_fixed_tip_show (gdk_display,
screen_number,
screen_number,
rect->x + dx,
rect->y + rect->height + 2 + dy,
tiptext);
......@@ -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)
{
......@@ -1440,9 +1452,9 @@ meta_frames_button_press_event (GtkWidget *widget,
dx = event->x_root - event->x;
dy = event->y_root - event->y;
/* Align to the right end of the menu rectangle if RTL */
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
dx += rect->width;
/* Align to the right end of the menu rectangle if RTL */
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
dx += rect->width;
meta_core_show_window_menu (gdk_display,
frame->xwindow,
......@@ -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,