2006-10-01 18:30:10 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
2001-06-12 00:38:24 -04:00
|
|
|
/* Metacity window frame manager widget */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
2003-11-24 13:09:47 -05:00
|
|
|
* Copyright (C) 2003 Red Hat, Inc.
|
2006-01-10 14:43:21 -05:00
|
|
|
* Copyright (C) 2005, 2006 Elijah Newren
|
2001-06-12 00:38:24 -04:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2001-12-09 17:41:12 -05:00
|
|
|
#include <config.h>
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
#include <math.h>
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
#include "boxes.h"
|
2001-06-12 00:38:24 -04:00
|
|
|
#include "frames.h"
|
2010-06-29 18:43:56 -04:00
|
|
|
#include "region.h"
|
2001-06-18 02:11:53 -04:00
|
|
|
#include "util.h"
|
|
|
|
#include "core.h"
|
2001-06-21 01:23:24 -04:00
|
|
|
#include "menu.h"
|
2001-06-30 19:17:52 -04:00
|
|
|
#include "fixedtip.h"
|
2002-01-05 23:51:53 -05:00
|
|
|
#include "theme.h"
|
2002-05-23 22:55:54 -04:00
|
|
|
#include "prefs.h"
|
2007-05-25 10:36:12 -04:00
|
|
|
#include "ui.h"
|
2001-06-21 01:23:24 -04:00
|
|
|
|
2010-09-23 11:35:41 -04:00
|
|
|
#include "gdk2-drawing-utils.h"
|
2010-05-10 18:46:36 -04:00
|
|
|
#include "gtk-compat.h"
|
2010-06-14 06:48:27 -04:00
|
|
|
#include "gdk-compat.h"
|
2010-05-10 18:46:36 -04:00
|
|
|
|
2010-09-24 07:30:40 -04:00
|
|
|
#include <cairo-xlib.h>
|
|
|
|
|
2002-05-30 20:02:54 -04:00
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
#include <X11/extensions/shape.h>
|
|
|
|
#endif
|
|
|
|
|
2001-06-21 01:23:24 -04:00
|
|
|
#define DEFAULT_INNER_BUTTON_BORDER 3
|
2001-06-12 00:38:24 -04:00
|
|
|
|
2010-09-27 13:47:54 -04:00
|
|
|
#ifdef USE_GTK3
|
|
|
|
static void meta_frames_destroy (GtkWidget *object);
|
|
|
|
#else
|
2001-06-12 00:38:24 -04:00
|
|
|
static void meta_frames_destroy (GtkObject *object);
|
2010-09-27 13:47:54 -04:00
|
|
|
#endif
|
2001-06-12 00:38:24 -04:00
|
|
|
static void meta_frames_finalize (GObject *object);
|
|
|
|
static void meta_frames_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style);
|
2010-09-21 06:31:32 -04:00
|
|
|
static void meta_frames_map (GtkWidget *widget);
|
|
|
|
static void meta_frames_unmap (GtkWidget *widget);
|
2001-07-02 21:45:43 -04:00
|
|
|
|
2006-08-07 17:04:44 -04:00
|
|
|
static void meta_frames_update_prelit_control (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame,
|
|
|
|
MetaFrameControl control);
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean meta_frames_button_press_event (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gboolean meta_frames_button_release_event (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gboolean meta_frames_motion_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event);
|
|
|
|
static gboolean meta_frames_destroy_event (GtkWidget *widget,
|
|
|
|
GdkEventAny *event);
|
2010-09-24 07:30:40 -04:00
|
|
|
#ifdef USE_GTK3
|
|
|
|
static gboolean meta_frames_draw (GtkWidget *widget,
|
|
|
|
cairo_t *cr);
|
|
|
|
#else
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean meta_frames_expose_event (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
2010-09-24 07:30:40 -04:00
|
|
|
#endif
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean meta_frames_enter_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
static gboolean meta_frames_leave_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
2001-06-12 00:38:24 -04:00
|
|
|
|
2009-01-27 20:47:18 -05:00
|
|
|
static void meta_frames_attach_style (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame);
|
|
|
|
|
2010-09-23 12:38:10 -04:00
|
|
|
static void meta_frames_paint (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame,
|
2010-09-27 07:55:28 -04:00
|
|
|
cairo_t *cr);
|
2001-06-15 00:33:21 -04:00
|
|
|
|
2004-08-27 18:09:13 -04:00
|
|
|
static void meta_frames_set_window_background (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame);
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
static void meta_frames_calc_geometry (MetaFrames *frames,
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame,
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrameGeometry *fgeom);
|
|
|
|
|
2002-02-09 12:02:38 -05:00
|
|
|
static void meta_frames_ensure_layout (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame);
|
|
|
|
|
2001-06-18 02:11:53 -04:00
|
|
|
static MetaUIFrame* meta_frames_lookup_window (MetaFrames *frames,
|
|
|
|
Window xwindow);
|
|
|
|
|
2002-10-03 22:28:57 -04:00
|
|
|
static void meta_frames_font_changed (MetaFrames *frames);
|
|
|
|
static void meta_frames_button_layout_changed (MetaFrames *frames);
|
|
|
|
|
2001-06-20 00:29:28 -04:00
|
|
|
|
|
|
|
static GdkRectangle* control_rect (MetaFrameControl control,
|
|
|
|
MetaFrameGeometry *fgeom);
|
|
|
|
static MetaFrameControl get_control (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame,
|
|
|
|
int x,
|
|
|
|
int y);
|
2001-06-30 19:17:52 -04:00
|
|
|
static void clear_tip (MetaFrames *frames);
|
2005-06-26 17:58:37 -04:00
|
|
|
static void invalidate_all_caches (MetaFrames *frames);
|
|
|
|
static void invalidate_whole_window (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaUIFrame *frame);
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2010-06-26 11:08:53 -04:00
|
|
|
G_DEFINE_TYPE (MetaFrames, meta_frames, GTK_TYPE_WINDOW);
|
2001-06-12 00:38:24 -04:00
|
|
|
|
2010-04-11 14:30:44 -04:00
|
|
|
static GObject *
|
|
|
|
meta_frames_constructor (GType gtype,
|
|
|
|
guint n_properties,
|
|
|
|
GObjectConstructParam *properties)
|
|
|
|
{
|
|
|
|
GObject *object;
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
|
2010-06-26 11:08:53 -04:00
|
|
|
gobject_class = G_OBJECT_CLASS (meta_frames_parent_class);
|
2010-04-11 14:30:44 -04:00
|
|
|
object = gobject_class->constructor (gtype, n_properties, properties);
|
|
|
|
|
|
|
|
g_object_set (object,
|
|
|
|
"type", GTK_WINDOW_POPUP,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return object;
|
|
|
|
}
|
|
|
|
|
2001-06-12 00:38:24 -04:00
|
|
|
static void
|
|
|
|
meta_frames_class_init (MetaFramesClass *class)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
|
|
|
|
gobject_class = G_OBJECT_CLASS (class);
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
|
|
|
|
2010-04-11 14:30:44 -04:00
|
|
|
gobject_class->constructor = meta_frames_constructor;
|
2001-06-12 00:38:24 -04:00
|
|
|
gobject_class->finalize = meta_frames_finalize;
|
2010-09-27 13:47:54 -04:00
|
|
|
|
|
|
|
#ifdef USE_GTK3
|
|
|
|
widget_class->destroy = meta_frames_destroy;
|
|
|
|
#else
|
|
|
|
GTK_OBJECT_CLASS (class)->destroy = meta_frames_destroy;
|
|
|
|
#endif
|
2001-06-12 00:38:24 -04:00
|
|
|
|
|
|
|
widget_class->style_set = meta_frames_style_set;
|
2001-06-15 00:33:21 -04:00
|
|
|
|
2010-09-21 06:31:32 -04:00
|
|
|
widget_class->map = meta_frames_map;
|
|
|
|
widget_class->unmap = meta_frames_unmap;
|
2001-07-02 21:45:43 -04:00
|
|
|
|
2010-09-24 07:30:40 -04:00
|
|
|
#ifdef USE_GTK3
|
|
|
|
widget_class->draw = meta_frames_draw;
|
|
|
|
#else
|
2001-06-18 02:11:53 -04:00
|
|
|
widget_class->expose_event = meta_frames_expose_event;
|
2010-09-24 07:30:40 -04:00
|
|
|
#endif
|
2002-02-07 22:34:26 -05:00
|
|
|
widget_class->destroy_event = meta_frames_destroy_event;
|
2001-06-20 00:29:28 -04:00
|
|
|
widget_class->button_press_event = meta_frames_button_press_event;
|
|
|
|
widget_class->button_release_event = meta_frames_button_release_event;
|
|
|
|
widget_class->motion_notify_event = meta_frames_motion_notify_event;
|
2002-02-07 22:34:26 -05:00
|
|
|
widget_class->enter_notify_event = meta_frames_enter_notify_event;
|
2001-07-25 23:14:45 -04:00
|
|
|
widget_class->leave_notify_event = meta_frames_leave_notify_event;
|
2001-06-15 00:33:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
unsigned_long_equal (gconstpointer v1,
|
|
|
|
gconstpointer v2)
|
|
|
|
{
|
|
|
|
return *((const gulong*) v1) == *((const gulong*) v2);
|
|
|
|
}
|
2001-06-12 00:38:24 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
static guint
|
|
|
|
unsigned_long_hash (gconstpointer v)
|
|
|
|
{
|
|
|
|
gulong val = * (const gulong *) v;
|
|
|
|
|
|
|
|
/* I'm not sure this works so well. */
|
A load of fixes of issues reported by sparse. Closes bug #152849
2004-09-17 Kjartan Maraas <kmaraas@gnome.org>
* src/bell.c: (meta_bell_flash_screen):
* src/compositor.c:
* src/effects.c: (meta_effects_draw_box_animation):
* src/fixedtip.c: (meta_fixed_tip_show):
* src/frame.c: (find_argb_visual):
* src/frames.c: (unsigned_long_hash), (meta_frames_manage_window),
(meta_frames_apply_shapes):
* src/iconcache.c: (find_largest_sizes), (find_best_size):
* src/keybindings.c: (meta_spawn_command_line_async_on_screen):
* src/main.c: (main):
* src/menu.c: (meta_window_menu_new):
* src/prefs.c: (meta_prefs_get_visual_bell),
(meta_prefs_bell_is_audible), (meta_prefs_get_visual_bell_type),
(meta_prefs_get_action_double_click_titlebar),
(meta_prefs_get_auto_raise), (meta_prefs_get_auto_raise_delay),
(meta_prefs_get_reduced_resources):
* src/screen.c: (meta_create_offscreen_window):
* src/tabpopup.c: (meta_ui_tab_popup_get_selected):
* src/theme-parser.c: (meta_theme_load):
* src/theme.c: (meta_gtk_widget_get_font_desc):
* src/tools/metacity-mag.c: (mouse_press), (begin_area_grab):
* src/util.c: (meta_unsigned_long_hash): A load of fixes of issues
reported by sparse. Closes bug #152849
2004-09-16 19:18:22 -04:00
|
|
|
#if GLIB_SIZEOF_LONG > 4
|
2001-06-15 00:33:21 -04:00
|
|
|
return (guint) (val ^ (val >> 32));
|
|
|
|
#else
|
|
|
|
return val;
|
|
|
|
#endif
|
2001-06-12 00:38:24 -04:00
|
|
|
}
|
|
|
|
|
2002-05-23 22:55:54 -04:00
|
|
|
static void
|
2002-10-03 22:28:57 -04:00
|
|
|
prefs_changed_callback (MetaPreference pref,
|
|
|
|
void *data)
|
2002-05-23 22:55:54 -04:00
|
|
|
{
|
2002-10-03 22:28:57 -04:00
|
|
|
switch (pref)
|
2002-05-23 22:55:54 -04:00
|
|
|
{
|
2002-10-03 22:28:57 -04:00
|
|
|
case META_PREF_TITLEBAR_FONT:
|
2002-05-23 22:55:54 -04:00
|
|
|
meta_frames_font_changed (META_FRAMES (data));
|
2002-10-03 22:28:57 -04:00
|
|
|
break;
|
|
|
|
case META_PREF_BUTTON_LAYOUT:
|
|
|
|
meta_frames_button_layout_changed (META_FRAMES (data));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2002-05-23 22:55:54 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-12 00:38:24 -04:00
|
|
|
static void
|
|
|
|
meta_frames_init (MetaFrames *frames)
|
|
|
|
{
|
2005-06-10 22:28:04 -04:00
|
|
|
frames->text_heights = g_hash_table_new (NULL, NULL);
|
2002-02-09 12:02:38 -05:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2001-06-30 19:17:52 -04:00
|
|
|
frames->tooltip_timeout = 0;
|
2001-08-18 21:19:54 -04:00
|
|
|
|
|
|
|
frames->expose_delay_count = 0;
|
2002-05-04 20:21:17 -04:00
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
frames->invalidate_cache_timeout_id = 0;
|
|
|
|
frames->invalidate_frames = NULL;
|
|
|
|
frames->cache = g_hash_table_new (g_direct_hash, g_direct_equal);
|
|
|
|
|
2002-05-04 20:21:17 -04:00
|
|
|
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
|
2002-05-23 22:55:54 -04:00
|
|
|
|
2002-10-03 22:28:57 -04:00
|
|
|
meta_prefs_add_listener (prefs_changed_callback, frames);
|
2001-06-12 00:38:24 -04:00
|
|
|
}
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
static void
|
|
|
|
listify_func (gpointer key, gpointer value, gpointer data)
|
|
|
|
{
|
|
|
|
GSList **listp;
|
2001-06-12 00:38:24 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
listp = data;
|
|
|
|
*listp = g_slist_prepend (*listp, value);
|
2001-06-12 00:38:24 -04:00
|
|
|
}
|
|
|
|
|
2010-09-27 13:47:54 -04:00
|
|
|
#ifdef USE_GTK3
|
|
|
|
static void
|
|
|
|
meta_frames_destroy (GtkWidget *object)
|
|
|
|
#else
|
2001-06-12 00:38:24 -04:00
|
|
|
static void
|
2001-06-17 23:24:25 -04:00
|
|
|
meta_frames_destroy (GtkObject *object)
|
2010-09-27 13:47:54 -04:00
|
|
|
#endif
|
2001-06-12 00:38:24 -04:00
|
|
|
{
|
2001-06-15 00:33:21 -04:00
|
|
|
GSList *winlist;
|
|
|
|
GSList *tmp;
|
2001-06-17 23:24:25 -04:00
|
|
|
MetaFrames *frames;
|
2001-06-15 00:33:21 -04:00
|
|
|
|
|
|
|
frames = META_FRAMES (object);
|
2002-05-23 22:55:54 -04:00
|
|
|
|
2001-06-30 19:17:52 -04:00
|
|
|
clear_tip (frames);
|
2001-06-17 23:24:25 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
winlist = NULL;
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
g_hash_table_foreach (frames->frames, listify_func, &winlist);
|
2001-06-15 00:33:21 -04:00
|
|
|
|
|
|
|
/* Unmanage all frames */
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
for (tmp = winlist; tmp != NULL; tmp = tmp->next)
|
2001-06-15 00:33:21 -04:00
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
|
|
|
|
frame = tmp->data;
|
|
|
|
|
|
|
|
meta_frames_unmanage_window (frames, frame->xwindow);
|
|
|
|
}
|
|
|
|
g_slist_free (winlist);
|
|
|
|
|
2010-09-27 13:47:54 -04:00
|
|
|
#ifdef USE_GTK3
|
|
|
|
GTK_WIDGET_CLASS (meta_frames_parent_class)->destroy (object);
|
|
|
|
#else
|
2010-06-26 11:08:53 -04:00
|
|
|
GTK_OBJECT_CLASS (meta_frames_parent_class)->destroy (object);
|
2010-09-27 13:47:54 -04:00
|
|
|
#endif
|
2001-06-17 23:24:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_frames_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (object);
|
|
|
|
|
2002-10-03 22:28:57 -04:00
|
|
|
meta_prefs_remove_listener (prefs_changed_callback, frames);
|
2002-06-01 20:24:31 -04:00
|
|
|
|
2002-02-09 12:02:38 -05:00
|
|
|
g_hash_table_destroy (frames->text_heights);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
invalidate_all_caches (frames);
|
|
|
|
if (frames->invalidate_cache_timeout_id)
|
|
|
|
g_source_remove (frames->invalidate_cache_timeout_id);
|
2002-02-09 12:02:38 -05:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
g_assert (g_hash_table_size (frames->frames) == 0);
|
|
|
|
g_hash_table_destroy (frames->frames);
|
2005-06-26 17:58:37 -04:00
|
|
|
g_hash_table_destroy (frames->cache);
|
2001-06-15 00:33:21 -04:00
|
|
|
|
2010-06-26 11:08:53 -04:00
|
|
|
G_OBJECT_CLASS (meta_frames_parent_class)->finalize (object);
|
2001-06-15 00:33:21 -04:00
|
|
|
}
|
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
typedef struct
|
|
|
|
{
|
2010-09-20 15:14:00 -04:00
|
|
|
GdkRectangle rect;
|
2010-09-23 12:56:46 -04:00
|
|
|
MetaPixmap *pixmap;
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
} CachedFramePiece;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/* Caches of the four rendered sides in a MetaFrame.
|
|
|
|
* Order: top (titlebar), left, right, bottom.
|
|
|
|
*/
|
|
|
|
CachedFramePiece piece[4];
|
2005-06-26 17:58:37 -04:00
|
|
|
} CachedPixels;
|
|
|
|
|
|
|
|
static CachedPixels *
|
|
|
|
get_cache (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaUIFrame *frame)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
|
|
|
CachedPixels *pixels;
|
|
|
|
|
|
|
|
pixels = g_hash_table_lookup (frames->cache, frame);
|
|
|
|
|
|
|
|
if (!pixels)
|
|
|
|
{
|
|
|
|
pixels = g_new0 (CachedPixels, 1);
|
|
|
|
g_hash_table_insert (frames->cache, frame, pixels);
|
|
|
|
}
|
|
|
|
|
|
|
|
return pixels;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
invalidate_cache (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaUIFrame *frame)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
|
|
|
CachedPixels *pixels = get_cache (frames, frame);
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
int i;
|
2005-06-26 17:58:37 -04:00
|
|
|
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
if (pixels->piece[i].pixmap)
|
2010-09-23 12:56:46 -04:00
|
|
|
meta_pixmap_free (pixels->piece[i].pixmap);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2005-10-03 15:22:40 -04:00
|
|
|
g_free (pixels);
|
2005-06-26 17:58:37 -04:00
|
|
|
g_hash_table_remove (frames->cache, frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
invalidate_all_caches (MetaFrames *frames)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
for (l = frames->invalidate_frames; l; l = l->next)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame = l->data;
|
|
|
|
|
|
|
|
invalidate_cache (frames, frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (frames->invalidate_frames);
|
|
|
|
frames->invalidate_frames = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
invalidate_cache_timeout (gpointer data)
|
|
|
|
{
|
|
|
|
MetaFrames *frames = data;
|
|
|
|
|
|
|
|
invalidate_all_caches (frames);
|
|
|
|
frames->invalidate_cache_timeout_id = 0;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2001-06-18 02:11:53 -04:00
|
|
|
static void
|
|
|
|
queue_recalc_func (gpointer key, gpointer value, gpointer data)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (data);
|
|
|
|
frame = value;
|
|
|
|
|
|
|
|
/* If a resize occurs it will cause a redraw, but the
|
|
|
|
* resize may not actually be needed so we always redraw
|
2004-08-27 18:09:13 -04:00
|
|
|
* in case of color change.
|
2001-06-18 02:11:53 -04:00
|
|
|
*/
|
2004-08-27 18:09:13 -04:00
|
|
|
meta_frames_set_window_background (frames, frame);
|
2004-08-26 22:17:49 -04:00
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
invalidate_whole_window (frames, frame);
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
2001-06-18 02:11:53 -04:00
|
|
|
frame->xwindow);
|
2001-06-21 02:08:35 -04:00
|
|
|
if (frame->layout)
|
|
|
|
{
|
2002-02-09 12:02:38 -05:00
|
|
|
/* save title to recreate layout */
|
|
|
|
g_free (frame->title);
|
2001-06-21 02:08:35 -04:00
|
|
|
|
2002-02-09 12:02:38 -05:00
|
|
|
frame->title = g_strdup (pango_layout_get_text (frame->layout));
|
2001-06-21 02:08:35 -04:00
|
|
|
|
|
|
|
g_object_unref (G_OBJECT (frame->layout));
|
2002-02-09 12:02:38 -05:00
|
|
|
frame->layout = NULL;
|
2001-06-21 02:08:35 -04:00
|
|
|
}
|
2001-06-18 02:11:53 -04:00
|
|
|
}
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
static void
|
2002-05-23 22:55:54 -04:00
|
|
|
meta_frames_font_changed (MetaFrames *frames)
|
2001-06-15 00:33:21 -04:00
|
|
|
{
|
2002-02-09 12:02:38 -05:00
|
|
|
if (g_hash_table_size (frames->text_heights) > 0)
|
2002-02-06 22:07:56 -05:00
|
|
|
{
|
2002-02-09 12:02:38 -05:00
|
|
|
g_hash_table_destroy (frames->text_heights);
|
2005-06-10 22:28:04 -04:00
|
|
|
frames->text_heights = g_hash_table_new (NULL, NULL);
|
2002-02-06 22:07:56 -05:00
|
|
|
}
|
|
|
|
|
2001-06-18 02:11:53 -04:00
|
|
|
/* Queue a draw/resize on all frames */
|
|
|
|
g_hash_table_foreach (frames->frames,
|
|
|
|
queue_recalc_func, frames);
|
2002-02-06 22:07:56 -05:00
|
|
|
|
2002-05-23 22:55:54 -04:00
|
|
|
}
|
|
|
|
|
2002-10-03 22:28:57 -04:00
|
|
|
static void
|
|
|
|
queue_draw_func (gpointer key, gpointer value, gpointer data)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (data);
|
|
|
|
frame = value;
|
|
|
|
|
|
|
|
/* If a resize occurs it will cause a redraw, but the
|
|
|
|
* resize may not actually be needed so we always redraw
|
2004-08-27 18:09:13 -04:00
|
|
|
* in case of color change.
|
2002-10-03 22:28:57 -04:00
|
|
|
*/
|
2004-08-27 18:09:13 -04:00
|
|
|
meta_frames_set_window_background (frames, frame);
|
2004-08-26 22:17:49 -04:00
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
invalidate_whole_window (frames, frame);
|
2002-10-03 22:28:57 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_frames_button_layout_changed (MetaFrames *frames)
|
|
|
|
{
|
|
|
|
g_hash_table_foreach (frames->frames,
|
|
|
|
queue_draw_func, frames);
|
|
|
|
}
|
|
|
|
|
2009-01-27 20:47:18 -05:00
|
|
|
static void
|
|
|
|
reattach_style_func (gpointer key, gpointer value, gpointer data)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (data);
|
|
|
|
frame = value;
|
|
|
|
|
|
|
|
meta_frames_attach_style (frames, frame);
|
|
|
|
}
|
|
|
|
|
2002-05-23 22:55:54 -04:00
|
|
|
static void
|
|
|
|
meta_frames_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style)
|
|
|
|
{
|
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (widget);
|
|
|
|
|
|
|
|
meta_frames_font_changed (frames);
|
|
|
|
|
2009-01-27 20:47:18 -05:00
|
|
|
g_hash_table_foreach (frames->frames,
|
|
|
|
reattach_style_func, frames);
|
|
|
|
|
2010-06-26 11:08:53 -04:00
|
|
|
GTK_WIDGET_CLASS (meta_frames_parent_class)->style_set (widget, prev_style);
|
2001-06-15 00:33:21 -04:00
|
|
|
}
|
|
|
|
|
2002-02-09 12:02:38 -05:00
|
|
|
static void
|
|
|
|
meta_frames_ensure_layout (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
2002-02-14 21:32:48 -05:00
|
|
|
MetaFrameFlags flags;
|
|
|
|
MetaFrameType type;
|
|
|
|
MetaFrameStyle *style;
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
widget = GTK_WIDGET (frames);
|
2010-04-11 14:30:44 -04:00
|
|
|
|
|
|
|
g_return_if_fail (gtk_widget_get_realized (widget));
|
2002-02-14 21:32:48 -05:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_FRAME_TYPE, &type,
|
|
|
|
META_CORE_GET_END);
|
2002-02-14 21:32:48 -05:00
|
|
|
|
|
|
|
style = meta_theme_get_frame_style (meta_theme_get_current (),
|
|
|
|
type, flags);
|
|
|
|
|
|
|
|
if (style != frame->cache_style)
|
|
|
|
{
|
|
|
|
if (frame->layout)
|
|
|
|
{
|
|
|
|
/* save title to recreate layout */
|
|
|
|
g_free (frame->title);
|
|
|
|
|
|
|
|
frame->title = g_strdup (pango_layout_get_text (frame->layout));
|
|
|
|
|
|
|
|
g_object_unref (G_OBJECT (frame->layout));
|
|
|
|
frame->layout = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
frame->cache_style = style;
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
if (frame->layout == NULL)
|
|
|
|
{
|
|
|
|
gpointer key, value;
|
|
|
|
PangoFontDescription *font_desc;
|
|
|
|
double scale;
|
|
|
|
int size;
|
|
|
|
|
|
|
|
scale = meta_theme_get_title_scale (meta_theme_get_current (),
|
|
|
|
type,
|
|
|
|
flags);
|
|
|
|
|
|
|
|
frame->layout = gtk_widget_create_pango_layout (widget, frame->title);
|
2007-06-03 02:26:29 -04:00
|
|
|
|
2009-08-20 15:54:11 -04:00
|
|
|
pango_layout_set_ellipsize (frame->layout, PANGO_ELLIPSIZE_END);
|
2007-06-03 02:26:29 -04:00
|
|
|
pango_layout_set_auto_dir (frame->layout, FALSE);
|
2002-02-14 21:32:48 -05:00
|
|
|
|
2002-05-23 22:55:54 -04:00
|
|
|
font_desc = meta_gtk_widget_get_font_desc (widget, scale,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
meta_prefs_get_titlebar_font ());
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
size = pango_font_description_get_size (font_desc);
|
2005-06-10 22:28:04 -04:00
|
|
|
|
2002-02-09 12:02:38 -05:00
|
|
|
if (g_hash_table_lookup_extended (frames->text_heights,
|
2005-06-10 22:28:04 -04:00
|
|
|
GINT_TO_POINTER (size),
|
2002-02-09 12:02:38 -05:00
|
|
|
&key, &value))
|
|
|
|
{
|
|
|
|
frame->text_height = GPOINTER_TO_INT (value);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
frame->text_height =
|
|
|
|
meta_pango_font_desc_get_text_height (font_desc,
|
|
|
|
gtk_widget_get_pango_context (widget));
|
|
|
|
|
2002-03-06 17:27:24 -05:00
|
|
|
g_hash_table_replace (frames->text_heights,
|
2005-06-10 22:28:04 -04:00
|
|
|
GINT_TO_POINTER (size),
|
2002-03-06 17:27:24 -05:00
|
|
|
GINT_TO_POINTER (frame->text_height));
|
2002-02-09 12:02:38 -05:00
|
|
|
}
|
2002-05-23 22:55:54 -04:00
|
|
|
|
|
|
|
pango_layout_set_font_description (frame->layout,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
font_desc);
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
pango_font_description_free (font_desc);
|
|
|
|
|
2002-02-14 21:32:48 -05:00
|
|
|
/* Save some RAM */
|
2002-02-09 12:02:38 -05:00
|
|
|
g_free (frame->title);
|
|
|
|
frame->title = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
static void
|
|
|
|
meta_frames_calc_geometry (MetaFrames *frames,
|
2002-01-18 22:50:03 -05:00
|
|
|
MetaUIFrame *frame,
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrameGeometry *fgeom)
|
|
|
|
{
|
2001-06-17 23:24:25 -04:00
|
|
|
int width, height;
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaFrameFlags flags;
|
2002-02-06 22:07:56 -05:00
|
|
|
MetaFrameType type;
|
2002-10-03 22:28:57 -04:00
|
|
|
MetaButtonLayout button_layout;
|
2001-06-15 00:33:21 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
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);
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
meta_frames_ensure_layout (frames, frame);
|
2002-10-03 22:28:57 -04:00
|
|
|
|
|
|
|
meta_prefs_get_button_layout (&button_layout);
|
2002-02-06 22:07:56 -05:00
|
|
|
|
|
|
|
meta_theme_calc_geometry (meta_theme_get_current (),
|
|
|
|
type,
|
2002-02-09 12:02:38 -05:00
|
|
|
frame->text_height,
|
2002-02-06 22:07:56 -05:00
|
|
|
flags,
|
|
|
|
width, height,
|
2002-10-03 22:28:57 -04:00
|
|
|
&button_layout,
|
2002-02-06 22:07:56 -05:00
|
|
|
fgeom);
|
2001-06-12 00:38:24 -04:00
|
|
|
}
|
|
|
|
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaFrames*
|
2002-05-08 12:24:28 -04:00
|
|
|
meta_frames_new (int screen_number)
|
2001-06-18 02:11:53 -04:00
|
|
|
{
|
2002-05-08 12:24:28 -04:00
|
|
|
GdkScreen *screen;
|
|
|
|
|
2002-06-25 03:08:18 -04:00
|
|
|
screen = gdk_display_get_screen (gdk_display_get_default (),
|
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
2007-06-06 23:31:17 -04:00
|
|
|
screen_number);
|
2002-05-08 12:24:28 -04:00
|
|
|
|
|
|
|
return g_object_new (META_TYPE_FRAMES,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
"screen", screen,
|
|
|
|
NULL);
|
2001-06-18 02:11:53 -04:00
|
|
|
}
|
|
|
|
|
2009-01-27 20:47:18 -05:00
|
|
|
/* In order to use a style with a window it has to be attached to that
|
|
|
|
* window. Actually, the colormaps just have to match, but since GTK+
|
|
|
|
* already takes care of making sure that its cheap to attach a style
|
|
|
|
* to multiple windows with the same colormap, we can just go ahead
|
|
|
|
* and attach separately for each window.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
meta_frames_attach_style (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame)
|
|
|
|
{
|
|
|
|
if (frame->style != NULL)
|
|
|
|
gtk_style_detach (frame->style);
|
|
|
|
|
|
|
|
/* Weirdly, gtk_style_attach() steals a reference count from the style passed in */
|
2010-05-10 17:40:06 -04:00
|
|
|
g_object_ref (gtk_widget_get_style (GTK_WIDGET (frames)));
|
|
|
|
frame->style = gtk_style_attach (gtk_widget_get_style (GTK_WIDGET (frames)),
|
|
|
|
frame->window);
|
2009-01-27 20:47:18 -05:00
|
|
|
}
|
|
|
|
|
2001-06-12 00:38:24 -04:00
|
|
|
void
|
|
|
|
meta_frames_manage_window (MetaFrames *frames,
|
2003-08-16 12:32:10 -04:00
|
|
|
Window xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
GdkWindow *window)
|
2001-06-12 00:38:24 -04:00
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
|
2003-08-16 12:32:10 -04:00
|
|
|
g_assert (window);
|
|
|
|
|
2001-06-18 02:11:53 -04:00
|
|
|
frame = g_new (MetaUIFrame, 1);
|
2001-06-12 00:38:24 -04:00
|
|
|
|
2003-08-16 12:32:10 -04:00
|
|
|
frame->window = window;
|
2001-06-12 00:38:24 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
gdk_window_set_user_data (frame->window, frames);
|
2004-08-26 22:17:49 -04:00
|
|
|
|
2009-01-27 20:47:18 -05:00
|
|
|
frame->style = NULL;
|
|
|
|
meta_frames_attach_style (frames, frame);
|
|
|
|
|
2001-07-03 22:10:54 -04:00
|
|
|
/* Don't set event mask here, it's in frame.c */
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frame->xwindow = xwindow;
|
2002-02-14 21:32:48 -05:00
|
|
|
frame->cache_style = NULL;
|
2001-06-15 00:33:21 -04:00
|
|
|
frame->layout = NULL;
|
2002-02-09 12:02:38 -05:00
|
|
|
frame->text_height = -1;
|
|
|
|
frame->title = NULL;
|
2001-08-18 21:19:54 -04:00
|
|
|
frame->expose_delayed = FALSE;
|
2003-01-05 02:51:02 -05:00
|
|
|
frame->shape_applied = FALSE;
|
2002-02-12 00:01:22 -05:00
|
|
|
frame->prelit_control = META_FRAME_CONTROL_NONE;
|
2007-04-23 18:44:01 -04:00
|
|
|
|
|
|
|
/* Don't set the window background yet; we need frame->xwindow to be
|
|
|
|
* registered with its MetaWindow, which happens after this function
|
|
|
|
* and meta_ui_create_frame_window() return to meta_window_ensure_frame().
|
|
|
|
*/
|
2001-06-15 00:33:21 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
|
2001-07-25 23:14:45 -04:00
|
|
|
|
2002-03-06 17:27:24 -05:00
|
|
|
g_hash_table_replace (frames->frames, &frame->xwindow, frame);
|
2001-06-15 00:33:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_frames_unmanage_window (MetaFrames *frames,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
|
2001-06-30 19:17:52 -04:00
|
|
|
clear_tip (frames);
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frame = g_hash_table_lookup (frames->frames, &xwindow);
|
|
|
|
|
|
|
|
if (frame)
|
2002-05-07 10:42:47 -04:00
|
|
|
{
|
2005-06-26 17:58:37 -04:00
|
|
|
/* invalidating all caches ensures the frame
|
|
|
|
* is not actually referenced anymore
|
|
|
|
*/
|
|
|
|
invalidate_all_caches (frames);
|
|
|
|
|
2002-05-07 10:42:47 -04:00
|
|
|
/* restore the cursor */
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
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
2007-06-06 23:31:17 -04:00
|
|
|
frame->xwindow,
|
|
|
|
META_CURSOR_DEFAULT);
|
2002-05-07 10:42:47 -04:00
|
|
|
|
2001-06-20 23:40:14 -04:00
|
|
|
gdk_window_set_user_data (frame->window, NULL);
|
2001-06-30 19:17:52 -04:00
|
|
|
|
|
|
|
if (frames->last_motion_frame == frame)
|
|
|
|
frames->last_motion_frame = NULL;
|
2001-06-20 23:40:14 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
g_hash_table_remove (frames->frames, &frame->xwindow);
|
2001-06-20 23:40:14 -04:00
|
|
|
|
2009-01-27 20:47:18 -05:00
|
|
|
gtk_style_detach (frame->style);
|
|
|
|
|
2003-08-16 12:32:10 -04:00
|
|
|
gdk_window_destroy (frame->window);
|
2001-06-15 00:33:21 -04:00
|
|
|
|
|
|
|
if (frame->layout)
|
|
|
|
g_object_unref (G_OBJECT (frame->layout));
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
if (frame->title)
|
|
|
|
g_free (frame->title);
|
2001-06-15 00:33:21 -04:00
|
|
|
|
|
|
|
g_free (frame);
|
|
|
|
}
|
|
|
|
else
|
2001-06-18 02:11:53 -04:00
|
|
|
meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
|
2001-06-15 00:33:21 -04:00
|
|
|
}
|
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
static void
|
2010-09-21 06:31:32 -04:00
|
|
|
meta_frames_map (GtkWidget *widget)
|
2001-07-02 21:45:43 -04:00
|
|
|
{
|
2010-09-21 06:31:32 -04:00
|
|
|
/* We override the parent map function to a no-op because we don't
|
|
|
|
* want to actually show the GDK window. But GTK needs to think that
|
|
|
|
* the widget is mapped or it won't deliver the events we care about.
|
|
|
|
*/
|
|
|
|
gtk_widget_set_mapped (widget, TRUE);
|
2001-07-02 21:45:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-09-21 06:31:32 -04:00
|
|
|
meta_frames_unmap (GtkWidget *widget)
|
2001-07-02 21:45:43 -04:00
|
|
|
{
|
2010-09-21 06:31:32 -04:00
|
|
|
gtk_widget_set_mapped (widget, FALSE);
|
2001-07-02 21:45:43 -04:00
|
|
|
}
|
|
|
|
|
2001-06-18 02:11:53 -04:00
|
|
|
static MetaUIFrame*
|
2001-06-15 00:33:21 -04:00
|
|
|
meta_frames_lookup_window (MetaFrames *frames,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
|
|
|
|
frame = g_hash_table_lookup (frames->frames, &xwindow);
|
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2001-06-17 23:24:25 -04:00
|
|
|
void
|
|
|
|
meta_frames_get_geometry (MetaFrames *frames,
|
|
|
|
Window xwindow,
|
|
|
|
int *top_height, int *bottom_height,
|
|
|
|
int *left_width, int *right_width)
|
|
|
|
{
|
2002-02-06 22:07:56 -05:00
|
|
|
MetaFrameFlags flags;
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2002-02-06 22:07:56 -05:00
|
|
|
MetaFrameType type;
|
|
|
|
|
2001-06-17 23:24:25 -04:00
|
|
|
frame = meta_frames_lookup_window (frames, xwindow);
|
|
|
|
|
|
|
|
if (frame == NULL)
|
|
|
|
meta_bug ("No such frame 0x%lx\n", xwindow);
|
2002-01-18 22:50:03 -05:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_FRAME_TYPE, &type,
|
|
|
|
META_CORE_GET_END);
|
2001-06-17 23:24:25 -04:00
|
|
|
|
2002-02-06 22:07:56 -05:00
|
|
|
g_return_if_fail (type < META_FRAME_TYPE_LAST);
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
meta_frames_ensure_layout (frames, frame);
|
2002-02-06 22:07:56 -05:00
|
|
|
|
2002-01-18 22:50:03 -05:00
|
|
|
/* We can't get the full geometry, because that depends on
|
|
|
|
* the client window size and probably we're being called
|
|
|
|
* by the core move/resize code to decide on the client
|
|
|
|
* window size
|
|
|
|
*/
|
2002-02-06 22:07:56 -05:00
|
|
|
meta_theme_get_frame_borders (meta_theme_get_current (),
|
|
|
|
type,
|
2002-02-09 12:02:38 -05:00
|
|
|
frame->text_height,
|
2002-02-06 22:07:56 -05:00
|
|
|
flags,
|
|
|
|
top_height, bottom_height,
|
|
|
|
left_width, right_width);
|
2001-06-17 23:24:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_frames_reset_bg (MetaFrames *frames,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-17 23:24:25 -04:00
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, xwindow);
|
2004-08-27 18:09:13 -04:00
|
|
|
|
|
|
|
meta_frames_set_window_background (frames, frame);
|
2001-06-17 23:24:25 -04:00
|
|
|
}
|
|
|
|
|
2002-01-27 00:27:11 -05:00
|
|
|
static void
|
|
|
|
set_background_none (Display *xdisplay,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
|
|
|
XSetWindowAttributes attrs;
|
|
|
|
|
|
|
|
attrs.background_pixmap = None;
|
|
|
|
XChangeWindowAttributes (xdisplay, xwindow,
|
|
|
|
CWBackPixmap, &attrs);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_frames_unflicker_bg (MetaFrames *frames,
|
|
|
|
Window xwindow,
|
|
|
|
int target_width,
|
|
|
|
int target_height)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, xwindow);
|
|
|
|
g_return_if_fail (frame != NULL);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
set_background_none (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
|
2002-01-27 00:27:11 -05:00
|
|
|
}
|
|
|
|
|
2002-05-30 20:02:54 -04:00
|
|
|
void
|
|
|
|
meta_frames_apply_shapes (MetaFrames *frames,
|
|
|
|
Window xwindow,
|
|
|
|
int new_window_width,
|
2003-01-05 02:51:02 -05:00
|
|
|
int new_window_height,
|
|
|
|
gboolean window_has_shape)
|
2002-05-30 20:02:54 -04:00
|
|
|
{
|
|
|
|
#ifdef HAVE_SHAPE
|
|
|
|
/* Apply shapes as if window had new_window_width, new_window_height */
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
MetaFrameGeometry fgeom;
|
|
|
|
XRectangle xrect;
|
|
|
|
Region corners_xregion;
|
|
|
|
Region window_xregion;
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display;
|
2002-05-30 20:02:54 -04:00
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, xwindow);
|
|
|
|
g_return_if_fail (frame != NULL);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
|
|
|
2002-05-30 20:02:54 -04:00
|
|
|
meta_frames_calc_geometry (frames, frame, &fgeom);
|
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
if (!(fgeom.top_left_corner_rounded_radius != 0 ||
|
|
|
|
fgeom.top_right_corner_rounded_radius != 0 ||
|
|
|
|
fgeom.bottom_left_corner_rounded_radius != 0 ||
|
|
|
|
fgeom.bottom_right_corner_rounded_radius != 0 ||
|
2003-01-05 02:51:02 -05:00
|
|
|
window_has_shape))
|
2002-05-30 20:02:54 -04:00
|
|
|
{
|
2003-01-05 02:51:02 -05:00
|
|
|
if (frame->shape_applied)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_SHAPES,
|
|
|
|
"Unsetting shape mask on frame 0x%lx\n",
|
|
|
|
frame->xwindow);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XShapeCombineMask (display, frame->xwindow,
|
2003-01-05 02:51:02 -05:00
|
|
|
ShapeBounding, 0, 0, None, ShapeSet);
|
|
|
|
frame->shape_applied = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_SHAPES,
|
|
|
|
"Frame 0x%lx still doesn't need a shape mask\n",
|
|
|
|
frame->xwindow);
|
|
|
|
}
|
2002-05-30 20:02:54 -04:00
|
|
|
|
|
|
|
return; /* nothing to do */
|
|
|
|
}
|
|
|
|
|
|
|
|
corners_xregion = XCreateRegion ();
|
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
if (fgeom.top_left_corner_rounded_radius != 0)
|
2002-05-30 20:02:54 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int corner = fgeom.top_left_corner_rounded_radius;
|
|
|
|
const float radius = sqrt(corner) + corner;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
int i;
|
2002-05-30 20:02:54 -04:00
|
|
|
|
2007-03-20 22:22:10 -04:00
|
|
|
for (i=0; i<corner; i++)
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
xrect.x = 0;
|
|
|
|
xrect.y = i;
|
|
|
|
xrect.width = width;
|
|
|
|
xrect.height = 1;
|
|
|
|
|
|
|
|
XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
|
|
}
|
2002-05-30 20:02:54 -04:00
|
|
|
}
|
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
if (fgeom.top_right_corner_rounded_radius != 0)
|
2002-05-30 20:02:54 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int corner = fgeom.top_right_corner_rounded_radius;
|
|
|
|
const float radius = sqrt(corner) + corner;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
int i;
|
2002-05-30 20:02:54 -04:00
|
|
|
|
2007-03-20 22:22:10 -04:00
|
|
|
for (i=0; i<corner; i++)
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
xrect.x = new_window_width - width;
|
|
|
|
xrect.y = i;
|
|
|
|
xrect.width = width;
|
|
|
|
xrect.height = 1;
|
|
|
|
|
|
|
|
XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
|
|
}
|
2002-05-30 20:02:54 -04:00
|
|
|
}
|
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
if (fgeom.bottom_left_corner_rounded_radius != 0)
|
2002-05-30 20:02:54 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int corner = fgeom.bottom_left_corner_rounded_radius;
|
|
|
|
const float radius = sqrt(corner) + corner;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
int i;
|
|
|
|
|
2007-03-20 22:22:10 -04:00
|
|
|
for (i=0; i<corner; i++)
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
xrect.x = 0;
|
2007-03-20 22:22:10 -04:00
|
|
|
xrect.y = new_window_height - i - 1;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
xrect.width = width;
|
|
|
|
xrect.height = 1;
|
|
|
|
|
|
|
|
XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
|
|
}
|
2002-05-30 20:02:54 -04:00
|
|
|
}
|
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
if (fgeom.bottom_right_corner_rounded_radius != 0)
|
2002-05-30 20:02:54 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int corner = fgeom.bottom_right_corner_rounded_radius;
|
|
|
|
const float radius = sqrt(corner) + corner;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
int i;
|
|
|
|
|
2007-03-20 22:22:10 -04:00
|
|
|
for (i=0; i<corner; i++)
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
{
|
2007-03-20 22:22:10 -04:00
|
|
|
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
xrect.x = new_window_width - width;
|
2007-03-20 22:22:10 -04:00
|
|
|
xrect.y = new_window_height - i - 1;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
xrect.width = width;
|
|
|
|
xrect.height = 1;
|
|
|
|
|
|
|
|
XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
|
|
|
|
}
|
2002-05-30 20:02:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
window_xregion = XCreateRegion ();
|
|
|
|
|
|
|
|
xrect.x = 0;
|
|
|
|
xrect.y = 0;
|
|
|
|
xrect.width = new_window_width;
|
|
|
|
xrect.height = new_window_height;
|
|
|
|
|
|
|
|
XUnionRectWithRegion (&xrect, window_xregion, window_xregion);
|
|
|
|
|
|
|
|
XSubtractRegion (window_xregion, corners_xregion, window_xregion);
|
|
|
|
|
2003-01-05 02:51:02 -05:00
|
|
|
XDestroyRegion (corners_xregion);
|
|
|
|
|
|
|
|
if (window_has_shape)
|
|
|
|
{
|
|
|
|
/* The client window is oclock or something and has a shape
|
|
|
|
* mask. To avoid a round trip to get its shape region, we
|
|
|
|
* create a fake window that's never mapped, build up our shape
|
|
|
|
* on that, then combine. Wasting the window is assumed cheaper
|
|
|
|
* than a round trip, but who really knows for sure.
|
|
|
|
*/
|
|
|
|
XSetWindowAttributes attrs;
|
|
|
|
Window shape_window;
|
|
|
|
Window client_window;
|
|
|
|
Region client_xregion;
|
|
|
|
GdkScreen *screen;
|
|
|
|
int screen_number;
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_SHAPES,
|
|
|
|
"Frame 0x%lx needs to incorporate client shape\n",
|
|
|
|
frame->xwindow);
|
2003-01-05 14:15:58 -05:00
|
|
|
|
2003-01-05 02:51:02 -05:00
|
|
|
screen = gtk_widget_get_screen (GTK_WIDGET (frames));
|
|
|
|
screen_number = gdk_x11_screen_get_screen_number (screen);
|
|
|
|
|
|
|
|
attrs.override_redirect = True;
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
shape_window = XCreateWindow (display,
|
|
|
|
RootWindow (display, screen_number),
|
2003-01-05 02:51:02 -05:00
|
|
|
-5000, -5000,
|
|
|
|
new_window_width,
|
|
|
|
new_window_height,
|
|
|
|
0,
|
|
|
|
CopyFromParent,
|
|
|
|
CopyFromParent,
|
A load of fixes of issues reported by sparse. Closes bug #152849
2004-09-17 Kjartan Maraas <kmaraas@gnome.org>
* src/bell.c: (meta_bell_flash_screen):
* src/compositor.c:
* src/effects.c: (meta_effects_draw_box_animation):
* src/fixedtip.c: (meta_fixed_tip_show):
* src/frame.c: (find_argb_visual):
* src/frames.c: (unsigned_long_hash), (meta_frames_manage_window),
(meta_frames_apply_shapes):
* src/iconcache.c: (find_largest_sizes), (find_best_size):
* src/keybindings.c: (meta_spawn_command_line_async_on_screen):
* src/main.c: (main):
* src/menu.c: (meta_window_menu_new):
* src/prefs.c: (meta_prefs_get_visual_bell),
(meta_prefs_bell_is_audible), (meta_prefs_get_visual_bell_type),
(meta_prefs_get_action_double_click_titlebar),
(meta_prefs_get_auto_raise), (meta_prefs_get_auto_raise_delay),
(meta_prefs_get_reduced_resources):
* src/screen.c: (meta_create_offscreen_window):
* src/tabpopup.c: (meta_ui_tab_popup_get_selected):
* src/theme-parser.c: (meta_theme_load):
* src/theme.c: (meta_gtk_widget_get_font_desc):
* src/tools/metacity-mag.c: (mouse_press), (begin_area_grab):
* src/util.c: (meta_unsigned_long_hash): A load of fixes of issues
reported by sparse. Closes bug #152849
2004-09-16 19:18:22 -04:00
|
|
|
(Visual *)CopyFromParent,
|
2003-01-05 02:51:02 -05:00
|
|
|
CWOverrideRedirect,
|
|
|
|
&attrs);
|
|
|
|
|
|
|
|
/* Copy the client's shape to the temporary shape_window */
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_CLIENT_XWINDOW, &client_window,
|
|
|
|
META_CORE_GET_END);
|
2003-01-05 02:51:02 -05:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XShapeCombineShape (display, shape_window, ShapeBounding,
|
2003-01-05 02:51:02 -05:00
|
|
|
fgeom.left_width,
|
|
|
|
fgeom.top_height,
|
|
|
|
client_window,
|
|
|
|
ShapeBounding,
|
|
|
|
ShapeSet);
|
|
|
|
|
|
|
|
/* Punch the client area out of the normal frame shape,
|
|
|
|
* then union it with the shape_window's existing shape
|
|
|
|
*/
|
|
|
|
client_xregion = XCreateRegion ();
|
|
|
|
|
|
|
|
xrect.x = fgeom.left_width;
|
|
|
|
xrect.y = fgeom.top_height;
|
|
|
|
xrect.width = new_window_width - fgeom.right_width - xrect.x;
|
|
|
|
xrect.height = new_window_height - fgeom.bottom_height - xrect.y;
|
|
|
|
|
|
|
|
XUnionRectWithRegion (&xrect, client_xregion, client_xregion);
|
|
|
|
|
|
|
|
XSubtractRegion (window_xregion, client_xregion, window_xregion);
|
|
|
|
|
|
|
|
XDestroyRegion (client_xregion);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XShapeCombineRegion (display, shape_window,
|
2003-01-05 02:51:02 -05:00
|
|
|
ShapeBounding, 0, 0, window_xregion, ShapeUnion);
|
|
|
|
|
|
|
|
/* Now copy shape_window shape to the real frame */
|
2010-09-10 03:17:55 -04:00
|
|
|
XShapeCombineShape (display, frame->xwindow, ShapeBounding,
|
2003-01-05 02:51:02 -05:00
|
|
|
0, 0,
|
|
|
|
shape_window,
|
|
|
|
ShapeBounding,
|
|
|
|
ShapeSet);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XDestroyWindow (display, shape_window);
|
2003-01-05 02:51:02 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* No shape on the client, so just do simple stuff */
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_SHAPES,
|
|
|
|
"Frame 0x%lx has shaped corners\n",
|
|
|
|
frame->xwindow);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XShapeCombineRegion (display, frame->xwindow,
|
2003-01-05 02:51:02 -05:00
|
|
|
ShapeBounding, 0, 0, window_xregion, ShapeSet);
|
|
|
|
}
|
|
|
|
|
|
|
|
frame->shape_applied = TRUE;
|
2002-05-30 20:02:54 -04:00
|
|
|
|
|
|
|
XDestroyRegion (window_xregion);
|
2003-01-11 13:09:12 -05:00
|
|
|
#endif /* HAVE_SHAPE */
|
2002-05-30 20:02:54 -04:00
|
|
|
}
|
|
|
|
|
2003-08-16 12:32:10 -04:00
|
|
|
void
|
|
|
|
meta_frames_move_resize_frame (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
Window xwindow,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height)
|
2003-08-16 12:32:10 -04:00
|
|
|
{
|
|
|
|
MetaUIFrame *frame = meta_frames_lookup_window (frames, xwindow);
|
2010-09-20 14:19:57 -04:00
|
|
|
int old_width, old_height;
|
2003-08-16 12:32:10 -04:00
|
|
|
|
2010-09-24 07:30:40 -04:00
|
|
|
old_width = gdk_window_get_width (frame->window);
|
|
|
|
old_height = gdk_window_get_height (frame->window);
|
2003-08-16 12:32:10 -04:00
|
|
|
|
|
|
|
gdk_window_move_resize (frame->window, x, y, width, height);
|
|
|
|
|
|
|
|
if (old_width != width || old_height != height)
|
2005-06-26 17:58:37 -04:00
|
|
|
invalidate_whole_window (frames, frame);
|
2003-08-16 12:32:10 -04:00
|
|
|
}
|
|
|
|
|
2001-06-17 23:24:25 -04:00
|
|
|
void
|
|
|
|
meta_frames_queue_draw (MetaFrames *frames,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-17 23:24:25 -04:00
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, xwindow);
|
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
invalidate_whole_window (frames, frame);
|
2001-06-17 23:24:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_frames_set_title (MetaFrames *frames,
|
|
|
|
Window xwindow,
|
|
|
|
const char *title)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-17 23:24:25 -04:00
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, xwindow);
|
2002-02-09 12:02:38 -05:00
|
|
|
|
2002-05-09 18:34:00 -04:00
|
|
|
g_assert (frame);
|
|
|
|
|
2002-02-09 12:02:38 -05:00
|
|
|
g_free (frame->title);
|
|
|
|
frame->title = g_strdup (title);
|
2001-06-17 23:24:25 -04:00
|
|
|
|
2002-02-09 12:02:38 -05:00
|
|
|
if (frame->layout)
|
|
|
|
{
|
|
|
|
g_object_unref (frame->layout);
|
|
|
|
frame->layout = NULL;
|
|
|
|
}
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
invalidate_whole_window (frames, frame);
|
2001-06-17 23:24:25 -04:00
|
|
|
}
|
|
|
|
|
2002-05-09 18:34:00 -04:00
|
|
|
void
|
|
|
|
meta_frames_repaint_frame (MetaFrames *frames,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, xwindow);
|
|
|
|
|
|
|
|
g_assert (frame);
|
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
/* repaint everything, so the other frame don't
|
|
|
|
* lag behind if they are exposed
|
|
|
|
*/
|
|
|
|
gdk_window_process_all_updates ();
|
2002-05-09 18:34:00 -04:00
|
|
|
}
|
2001-06-30 19:17:52 -04:00
|
|
|
|
|
|
|
static void
|
|
|
|
show_tip_now (MetaFrames *frames)
|
|
|
|
{
|
|
|
|
const char *tiptext;
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
int x, y, root_x, root_y;
|
|
|
|
Window root, child;
|
|
|
|
guint mask;
|
|
|
|
MetaFrameControl control;
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display;
|
2001-06-30 19:17:52 -04:00
|
|
|
|
|
|
|
frame = frames->last_motion_frame;
|
|
|
|
if (frame == NULL)
|
|
|
|
return;
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
|
|
|
|
|
|
XQueryPointer (display,
|
2001-06-30 19:17:52 -04:00
|
|
|
frame->xwindow,
|
|
|
|
&root, &child,
|
|
|
|
&root_x, &root_y,
|
|
|
|
&x, &y,
|
|
|
|
&mask);
|
|
|
|
|
|
|
|
control = get_control (frames, frame, x, y);
|
|
|
|
|
|
|
|
tiptext = NULL;
|
|
|
|
switch (control)
|
|
|
|
{
|
|
|
|
case META_FRAME_CONTROL_TITLE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_DELETE:
|
|
|
|
tiptext = _("Close Window");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MENU:
|
|
|
|
tiptext = _("Window Menu");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MINIMIZE:
|
|
|
|
tiptext = _("Minimize Window");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MAXIMIZE:
|
|
|
|
tiptext = _("Maximize Window");
|
|
|
|
break;
|
2001-09-10 23:54:54 -04:00
|
|
|
case META_FRAME_CONTROL_UNMAXIMIZE:
|
2008-12-25 11:53:33 -05:00
|
|
|
tiptext = _("Restore Window");
|
2001-09-10 23:54:54 -04:00
|
|
|
break;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_FRAME_CONTROL_SHADE:
|
|
|
|
tiptext = _("Roll Up Window");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSHADE:
|
|
|
|
tiptext = _("Unroll Window");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_ABOVE:
|
|
|
|
tiptext = _("Keep Window On Top");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNABOVE:
|
|
|
|
tiptext = _("Remove Window From Top");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_STICK:
|
|
|
|
tiptext = _("Always On Visible Workspace");
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSTICK:
|
|
|
|
tiptext = _("Put Window On Only One Workspace");
|
|
|
|
break;
|
2001-06-30 19:17:52 -04:00
|
|
|
case META_FRAME_CONTROL_RESIZE_SE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_S:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_SW:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_N:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NW:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_W:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_E:
|
|
|
|
break;
|
2001-10-14 00:11:42 -04:00
|
|
|
case META_FRAME_CONTROL_NONE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_CLIENT_AREA:
|
2001-06-30 19:17:52 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tiptext)
|
|
|
|
{
|
|
|
|
MetaFrameGeometry fgeom;
|
|
|
|
GdkRectangle *rect;
|
|
|
|
int dx, dy;
|
2002-05-08 12:24:28 -04:00
|
|
|
int screen_number;
|
2001-06-30 19:17:52 -04:00
|
|
|
|
|
|
|
meta_frames_calc_geometry (frames, frame, &fgeom);
|
|
|
|
|
|
|
|
rect = control_rect (control, &fgeom);
|
|
|
|
|
|
|
|
/* get conversion delta for root-to-frame coords */
|
|
|
|
dx = root_x - x;
|
|
|
|
dy = root_y - y;
|
2007-05-25 10:36:12 -04:00
|
|
|
|
|
|
|
/* Align the tooltip to the button right end if RTL */
|
|
|
|
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
|
|
|
|
dx += rect->width;
|
|
|
|
|
2002-05-08 12:24:28 -04:00
|
|
|
screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
|
2003-04-21 19:37:42 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_fixed_tip_show (display,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
screen_number,
|
2001-06-30 19:17:52 -04:00
|
|
|
rect->x + dx,
|
|
|
|
rect->y + rect->height + 2 + dy,
|
|
|
|
tiptext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
tip_timeout_func (gpointer data)
|
|
|
|
{
|
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = data;
|
|
|
|
|
|
|
|
show_tip_now (frames);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TIP_DELAY 450
|
|
|
|
static void
|
|
|
|
queue_tip (MetaFrames *frames)
|
|
|
|
{
|
|
|
|
clear_tip (frames);
|
|
|
|
|
|
|
|
frames->tooltip_timeout = g_timeout_add (TIP_DELAY,
|
|
|
|
tip_timeout_func,
|
|
|
|
frames);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clear_tip (MetaFrames *frames)
|
|
|
|
{
|
|
|
|
if (frames->tooltip_timeout)
|
|
|
|
{
|
|
|
|
g_source_remove (frames->tooltip_timeout);
|
|
|
|
frames->tooltip_timeout = 0;
|
|
|
|
}
|
|
|
|
meta_fixed_tip_hide ();
|
|
|
|
}
|
|
|
|
|
2001-06-20 23:40:14 -04:00
|
|
|
static void
|
|
|
|
redraw_control (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame,
|
|
|
|
MetaFrameControl control)
|
|
|
|
{
|
|
|
|
MetaFrameGeometry fgeom;
|
|
|
|
GdkRectangle *rect;
|
|
|
|
|
|
|
|
meta_frames_calc_geometry (frames, frame, &fgeom);
|
|
|
|
|
|
|
|
rect = control_rect (control, &fgeom);
|
|
|
|
|
|
|
|
gdk_window_invalidate_rect (frame->window, rect, FALSE);
|
2005-06-26 17:58:37 -04:00
|
|
|
invalidate_cache (frames, frame);
|
2001-06-20 23:40:14 -04:00
|
|
|
}
|
|
|
|
|
2007-02-17 16:15:59 -05:00
|
|
|
static gboolean
|
|
|
|
meta_frame_titlebar_event (MetaUIFrame *frame,
|
|
|
|
GdkEventButton *event,
|
|
|
|
int action)
|
|
|
|
{
|
|
|
|
MetaFrameFlags flags;
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display;
|
|
|
|
|
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
2007-02-17 16:15:59 -05:00
|
|
|
|
|
|
|
switch (action)
|
|
|
|
{
|
2007-02-17 16:34:00 -05:00
|
|
|
case META_ACTION_TITLEBAR_TOGGLE_SHADE:
|
2007-02-17 16:15:59 -05:00
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_END);
|
2007-02-17 16:15:59 -05:00
|
|
|
|
|
|
|
if (flags & META_FRAME_ALLOWS_SHADE)
|
|
|
|
{
|
|
|
|
if (flags & META_FRAME_SHADED)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_unshade (display,
|
2007-02-17 16:15:59 -05:00
|
|
|
frame->xwindow,
|
|
|
|
event->time);
|
|
|
|
else
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_shade (display,
|
2007-02-17 16:15:59 -05:00
|
|
|
frame->xwindow,
|
|
|
|
event->time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2007-02-17 16:34:00 -05:00
|
|
|
case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE:
|
2007-02-17 16:15:59 -05:00
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_END);
|
2007-02-17 16:15:59 -05:00
|
|
|
|
|
|
|
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_toggle_maximize (display, frame->xwindow);
|
2007-02-17 16:15:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-03-02 20:58:54 -05:00
|
|
|
case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_HORIZONTALLY:
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
2008-03-02 20:58:54 -05:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_END);
|
|
|
|
|
|
|
|
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_toggle_maximize_horizontally (display, frame->xwindow);
|
2008-03-02 20:58:54 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE_VERTICALLY:
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
2008-03-02 20:58:54 -05:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_END);
|
|
|
|
|
|
|
|
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_toggle_maximize_vertically (display, frame->xwindow);
|
2008-03-02 20:58:54 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2007-02-17 16:34:00 -05:00
|
|
|
case META_ACTION_TITLEBAR_MINIMIZE:
|
2007-02-17 16:15:59 -05:00
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_END);
|
2007-02-17 16:15:59 -05:00
|
|
|
|
|
|
|
if (flags & META_FRAME_ALLOWS_MINIMIZE)
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_minimize (display, frame->xwindow);
|
2007-02-17 16:15:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2007-02-17 16:34:00 -05:00
|
|
|
case META_ACTION_TITLEBAR_NONE:
|
2007-02-17 16:15:59 -05:00
|
|
|
/* Yaay, a sane user that doesn't use that other weird crap! */
|
|
|
|
break;
|
2007-02-17 16:34:00 -05:00
|
|
|
|
|
|
|
case META_ACTION_TITLEBAR_LOWER:
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_user_lower_and_unfocus (display,
|
2007-02-17 16:34:00 -05:00
|
|
|
frame->xwindow,
|
|
|
|
event->time);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case META_ACTION_TITLEBAR_MENU:
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_show_window_menu (display,
|
2007-02-17 16:34:00 -05:00
|
|
|
frame->xwindow,
|
|
|
|
event->x_root,
|
|
|
|
event->y_root,
|
|
|
|
event->button,
|
|
|
|
event->time);
|
|
|
|
break;
|
2007-02-17 16:15:59 -05:00
|
|
|
|
2007-02-17 16:34:00 -05:00
|
|
|
case META_ACTION_TITLEBAR_LAST:
|
2007-02-17 16:15:59 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
meta_frame_double_click_event (MetaUIFrame *frame,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
int action = meta_prefs_get_action_double_click_titlebar ();
|
|
|
|
|
|
|
|
return meta_frame_titlebar_event (frame, event, action);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
meta_frame_middle_click_event (MetaUIFrame *frame,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
2007-03-09 20:15:14 -05:00
|
|
|
int action = meta_prefs_get_action_middle_click_titlebar();
|
|
|
|
|
|
|
|
return meta_frame_titlebar_event (frame, event, action);
|
2007-02-17 16:15:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
meta_frame_right_click_event(MetaUIFrame *frame,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
2007-03-09 20:15:14 -05:00
|
|
|
int action = meta_prefs_get_action_right_click_titlebar();
|
|
|
|
|
|
|
|
return meta_frame_titlebar_event (frame, event, action);
|
2007-02-17 16:15:59 -05:00
|
|
|
}
|
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean
|
2001-06-15 00:33:21 -04:00
|
|
|
meta_frames_button_press_event (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrames *frames;
|
2001-06-20 00:29:28 -04:00
|
|
|
MetaFrameControl control;
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display;
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frames = META_FRAMES (widget);
|
2010-09-10 03:17:55 -04:00
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
2001-07-25 23:14:45 -04:00
|
|
|
|
|
|
|
/* Remember that the display may have already done something with this event.
|
|
|
|
* If so there's probably a GrabOp in effect.
|
|
|
|
*/
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
2001-06-30 19:17:52 -04:00
|
|
|
|
|
|
|
clear_tip (frames);
|
2001-06-20 00:29:28 -04:00
|
|
|
|
|
|
|
control = get_control (frames, frame, event->x, event->y);
|
2001-06-20 23:40:14 -04:00
|
|
|
|
Add a raise on click option, basically only because all the major distros
2006-01-10 Elijah Newren <newren@gmail.com>
Add a raise on click option, basically only because all the major
distros are patching it in anyway. See #326156.
* src/metacity.schemas.in: add the new gconf key and explanation
* src/prefs.[ch] (#define KEY_RAISE_ON_CLICK, static gboolean
raise_on_click, update_raise_on_click, meta_prefs_init,
change_notify, meta_prefs_get_raise_on_click,
meta_preference_to_string):
Add all the normal preference handling stuff for this new
raise-on-click option.
* src/core.c (meta_core_show_window_menu):
* src/display.c (event_callback, meta_display_begin_grab_op):
* src/window.c (window_activate, meta_window_configure_request, ):
Only raise the window if in raise_on_click mode.
* src/display.c (meta_display_begin_grab_op,
meta_display_end_grab_op, meta_display_check_threshold_reached):
* src/display.h (struct MetaDisplay):
* src/window.c (meta_window_handle_mouse_grab_op_event):
if not in raise-on-click mode only raise on button release if the
click didn't start a move or resize operation; needs a few extra
MetaDisplay fields to handle this
* src/core.c (meta_core_user_lower_and_unfocus):
no need to do the MRU shuffling if not maintaining the stacking
order == MRU order invariant
* src/frames.c (meta_frames_button_press_event):
* src/window.c (meta_window_begin_grab_op):
remove an unneeded window raising that is already handled elsewhere
2006-01-10 14:35:03 -05:00
|
|
|
/* focus on click, even if click was on client area */
|
2002-06-09 00:14:40 -04:00
|
|
|
if (event->button == 1 &&
|
|
|
|
!(control == META_FRAME_CONTROL_MINIMIZE ||
|
2007-07-22 21:48:17 -04:00
|
|
|
control == META_FRAME_CONTROL_DELETE ||
|
|
|
|
control == META_FRAME_CONTROL_MAXIMIZE))
|
2001-10-14 23:39:41 -04:00
|
|
|
{
|
2002-01-03 18:28:19 -05:00
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
2002-01-05 22:15:49 -05:00
|
|
|
"Focusing window with frame 0x%lx due to button 1 press\n",
|
2002-01-03 18:28:19 -05:00
|
|
|
frame->xwindow);
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_user_focus (display,
|
2001-10-14 23:39:41 -04:00
|
|
|
frame->xwindow,
|
|
|
|
event->time);
|
|
|
|
}
|
2002-08-04 16:20:53 -04:00
|
|
|
|
|
|
|
/* don't do the rest of this if on client area */
|
|
|
|
if (control == META_FRAME_CONTROL_CLIENT_AREA)
|
|
|
|
return FALSE; /* not on the frame, just passed through from client */
|
2001-10-14 00:11:42 -04:00
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
/* We want to shade even if we have a GrabOp, since we'll have a move grab
|
|
|
|
* if we double click the titlebar.
|
|
|
|
*/
|
2001-06-21 02:08:35 -04:00
|
|
|
if (control == META_FRAME_CONTROL_TITLE &&
|
|
|
|
event->button == 1 &&
|
|
|
|
event->type == GDK_2BUTTON_PRESS)
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
2007-02-17 16:15:59 -05:00
|
|
|
return meta_frame_double_click_event (frame, event);
|
2001-06-21 02:08:35 -04:00
|
|
|
}
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
if (meta_core_get_grab_op (display) !=
|
2001-07-25 23:14:45 -04:00
|
|
|
META_GRAB_OP_NONE)
|
|
|
|
return FALSE; /* already up to something */
|
2001-06-20 23:40:14 -04:00
|
|
|
|
|
|
|
if (event->button == 1 &&
|
|
|
|
(control == META_FRAME_CONTROL_MAXIMIZE ||
|
2001-09-10 23:54:54 -04:00
|
|
|
control == META_FRAME_CONTROL_UNMAXIMIZE ||
|
2001-06-20 23:40:14 -04:00
|
|
|
control == META_FRAME_CONTROL_MINIMIZE ||
|
|
|
|
control == META_FRAME_CONTROL_DELETE ||
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
control == META_FRAME_CONTROL_SHADE ||
|
|
|
|
control == META_FRAME_CONTROL_UNSHADE ||
|
|
|
|
control == META_FRAME_CONTROL_ABOVE ||
|
|
|
|
control == META_FRAME_CONTROL_UNABOVE ||
|
|
|
|
control == META_FRAME_CONTROL_STICK ||
|
|
|
|
control == META_FRAME_CONTROL_UNSTICK ||
|
2001-06-20 23:40:14 -04:00
|
|
|
control == META_FRAME_CONTROL_MENU))
|
|
|
|
{
|
2001-07-25 23:14:45 -04:00
|
|
|
MetaGrabOp op = META_GRAB_OP_NONE;
|
2001-06-20 23:40:14 -04:00
|
|
|
|
|
|
|
switch (control)
|
|
|
|
{
|
|
|
|
case META_FRAME_CONTROL_MINIMIZE:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_CLICKING_MINIMIZE;
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MAXIMIZE:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_CLICKING_MAXIMIZE;
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
2001-09-10 23:54:54 -04:00
|
|
|
case META_FRAME_CONTROL_UNMAXIMIZE:
|
|
|
|
op = META_GRAB_OP_CLICKING_UNMAXIMIZE;
|
|
|
|
break;
|
2001-06-20 23:40:14 -04:00
|
|
|
case META_FRAME_CONTROL_DELETE:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_CLICKING_DELETE;
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MENU:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_CLICKING_MENU;
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_FRAME_CONTROL_SHADE:
|
|
|
|
op = META_GRAB_OP_CLICKING_SHADE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSHADE:
|
|
|
|
op = META_GRAB_OP_CLICKING_UNSHADE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_ABOVE:
|
|
|
|
op = META_GRAB_OP_CLICKING_ABOVE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNABOVE:
|
|
|
|
op = META_GRAB_OP_CLICKING_UNABOVE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_STICK:
|
|
|
|
op = META_GRAB_OP_CLICKING_STICK;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSTICK:
|
|
|
|
op = META_GRAB_OP_CLICKING_UNSTICK;
|
|
|
|
break;
|
2001-06-20 23:40:14 -04:00
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_begin_grab_op (display,
|
2001-07-25 23:14:45 -04:00
|
|
|
frame->xwindow,
|
|
|
|
op,
|
|
|
|
TRUE,
|
2006-10-12 20:28:34 -04:00
|
|
|
TRUE,
|
2001-07-25 23:14:45 -04:00
|
|
|
event->button,
|
|
|
|
0,
|
|
|
|
event->time,
|
|
|
|
event->x_root,
|
|
|
|
event->y_root);
|
2001-07-03 22:10:54 -04:00
|
|
|
|
2006-08-07 17:04:44 -04:00
|
|
|
frame->prelit_control = control;
|
2001-06-20 23:40:14 -04:00
|
|
|
redraw_control (frames, frame, control);
|
2001-06-21 01:23:24 -04:00
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
if (op == META_GRAB_OP_CLICKING_MENU)
|
2001-06-21 01:23:24 -04:00
|
|
|
{
|
2001-06-30 19:17:52 -04:00
|
|
|
MetaFrameGeometry fgeom;
|
|
|
|
GdkRectangle *rect;
|
|
|
|
int dx, dy;
|
|
|
|
|
|
|
|
meta_frames_calc_geometry (frames, frame, &fgeom);
|
|
|
|
|
|
|
|
rect = control_rect (META_FRAME_CONTROL_MENU, &fgeom);
|
|
|
|
|
|
|
|
/* get delta to convert to root coords */
|
|
|
|
dx = event->x_root - event->x;
|
|
|
|
dy = event->y_root - event->y;
|
|
|
|
|
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
2007-06-06 23:31:17 -04:00
|
|
|
/* Align to the right end of the menu rectangle if RTL */
|
|
|
|
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
|
|
|
|
dx += rect->width;
|
2007-05-25 10:36:12 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_show_window_menu (display,
|
2001-06-23 01:49:35 -04:00
|
|
|
frame->xwindow,
|
2001-06-30 19:17:52 -04:00
|
|
|
rect->x + dx,
|
|
|
|
rect->y + rect->height + dy,
|
2001-06-23 01:49:35 -04:00
|
|
|
event->button,
|
|
|
|
event->time);
|
2001-06-21 01:23:24 -04:00
|
|
|
}
|
2001-06-20 23:40:14 -04:00
|
|
|
}
|
2001-06-30 19:17:52 -04:00
|
|
|
else if (event->button == 1 &&
|
|
|
|
(control == META_FRAME_CONTROL_RESIZE_SE ||
|
|
|
|
control == META_FRAME_CONTROL_RESIZE_S ||
|
|
|
|
control == META_FRAME_CONTROL_RESIZE_SW ||
|
|
|
|
control == META_FRAME_CONTROL_RESIZE_NE ||
|
|
|
|
control == META_FRAME_CONTROL_RESIZE_N ||
|
|
|
|
control == META_FRAME_CONTROL_RESIZE_NW ||
|
|
|
|
control == META_FRAME_CONTROL_RESIZE_E ||
|
|
|
|
control == META_FRAME_CONTROL_RESIZE_W))
|
2001-06-20 23:40:14 -04:00
|
|
|
{
|
2001-07-25 23:14:45 -04:00
|
|
|
MetaGrabOp op;
|
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
2007-06-06 23:31:17 -04:00
|
|
|
gboolean titlebar_is_onscreen;
|
2001-07-02 21:45:43 -04:00
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_NONE;
|
2001-07-02 21:45:43 -04:00
|
|
|
|
|
|
|
switch (control)
|
|
|
|
{
|
|
|
|
case META_FRAME_CONTROL_RESIZE_SE:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_SE;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_S:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_S;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_SW:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_SW;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NE:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_NE;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_N:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_N;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NW:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_NW;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_E:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_E;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_W:
|
2001-07-25 23:14:45 -04:00
|
|
|
op = META_GRAB_OP_RESIZING_W;
|
2001-07-02 21:45:43 -04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
2001-06-23 14:30:27 -04:00
|
|
|
}
|
2001-07-25 23:14:45 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_IS_TITLEBAR_ONSCREEN, &titlebar_is_onscreen,
|
|
|
|
META_CORE_GET_END);
|
|
|
|
|
|
|
|
if (!titlebar_is_onscreen)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_show_window_menu (display,
|
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
|
|
|
frame->xwindow,
|
|
|
|
event->x_root,
|
|
|
|
event->y_root,
|
|
|
|
event->button,
|
|
|
|
event->time);
|
|
|
|
else
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_begin_grab_op (display,
|
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
|
|
|
frame->xwindow,
|
|
|
|
op,
|
|
|
|
TRUE,
|
2006-10-12 20:28:34 -04:00
|
|
|
TRUE,
|
Merge of all the changes on the constraints_experiments branch. This is
2005-11-18 Elijah Newren <newren@gmail.com>
Merge of all the changes on the constraints_experiments branch.
This is just a summary, to get the full ChangeLog of those
changes (approx. 2000 lines):
cvs -q -z3 update -Pd -r constraints_experiments
cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog
Bugs fixed:
unfiled - constraints.c is overly complicated[1]
unfiled - constraints.c is not robust when all constraints
cannot simultaneously be met (constraints need to be
prioritized)
unfiled - keep-titlebar-onscreen constraint is decoration
unaware (since get_outermost_onscreen_positions()
forgets to include decorations)
unfiled - keyboard snap-moving and snap-resizing snap to hidden
edges
109553 - gravity w/ simultaneous move & resize doesn't work
113601 - maximize vertical and horizontal should toggle and be
constrained
122196 - windows show up under vertical panels
122670 - jerky/random resizing of window via keyboard[2]
124582 - keyboard and mouse snap-resizing and snap-moving
erroneously moves the window multidimensionally
136307 - don't allow apps to resize themselves off the screen
(*cough* filechooser *cough*)
142016, 143784 - windows should not span multiple xineramas
unless placed there by the user
143145 - clamp new windows to screensize and force them
onscreen, if they'll fit
144126 - Handle pathological strut lists sanely[3]
149867 - fixed aspect ratio windows are difficult to resize[4]
152898 - make screen edges consistent; allow easy slamming of
windows into the left, right, and bottom edges of the
screen too.
154706 - bouncing weirdness at screen edge with keyboard moving
or resizing
156699 - avoid struts when placing windows, if possible (nasty
a11y blocker)
302456 - dragging offscreen too restrictive
304857 - wireframe moving off the top of the screen is misleading
308521 - make uni-directional resizing easier with
alt-middle-drag and prevent the occasional super
annoying resize-the-wrong-side(s) behavior
312007 - snap-resize moves windows with a minimum size
constraint
312104 - resizing the top of a window can cause the bottom to
grow
319351 - don't instantly snap on mouse-move-snapping, remove
braindeadedness of having order of releasing shift and
releasing button press matter so much
[1] fixed in my opinion, anyway.
[2] Actually, it's not totally fixed--it's just annoying
instead of almost completely unusable. Matthias had a
suggestion that may fix the remainder of the problems (see
http://tinyurl.com/bwzuu).
[3] This bug was originally about not-quite-so-pathological
cases but was left open for the worse cases. The code from
the branch handles the remainder of the cases mentioned in
this bug.
[4] Actually, although it's far better there's still some minor
issues left: a slight drift that's only noticeable after
lots of resizing, and potential problems with partially
onscreen constraints due to not clearing any
fixed_directions flags (aspect ratio windows get resized in
both directions and thus aren't fixed in one of them)
New feature:
81704 - edge resistance for user move and resize operations;
in particular 3 different kinds of resistance are
implemented:
Pixel-Distance: window movement is resisted when it
aligns with an edge unless the movement is greater than
a threshold number of pixels
Timeout: window movement past an edge is prevented until
a certain amount of time has elapsed during the
operation since the first request to move it past that
edge
Keyboard-Buildup: when moving or resizing with the
keyboard, once a window is aligned with a certain edge
it cannot move past until the correct direction has
been pressed enough times (e.g. 2 or 3 times)
Major changes:
- constraints.c has been rewritten; very few lines of code from
the old version remain. There is a comment near the top of
the function explaining the basics of how the new framework
works. A more detailed explanation can be found in
doc/how-constraints-works.txt
- edge-resistance.[ch] are new files implementing edge-resistance.
- boxes.[ch] are new files containing low-level error-prone
functions used heavily in constraints.c and edge-resistance.c,
among various places throughout the code. testboxes.c
contains a thorough testsuite for the boxes.[ch] functions
compiled into a program, testboxes.
- meta_window_move_resize_internal() *must* be told the gravity
of the associated operation (if it's just a move operation,
the gravity will be ignored, but for resize and move+resize
the correct value is needed)
- the craziness of different values that
meta_window_move_resize_internal() accepts has been documented
in a large comment at the beginning of the function. It may
be possible to clean this up some, but until then things will
remain as they were before--caller beware.
- screen and xinerama usable areas (i.e. places not covered by
e.g. panels) are cached in the workspace now, as are the
screen and xinerama edges. These get updated with the
workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 09:58:50 -05:00
|
|
|
event->button,
|
|
|
|
0,
|
|
|
|
event->time,
|
|
|
|
event->x_root,
|
|
|
|
event->y_root);
|
2001-06-20 23:40:14 -04:00
|
|
|
}
|
2002-12-01 20:34:27 -05:00
|
|
|
else if (control == META_FRAME_CONTROL_TITLE &&
|
2001-07-25 23:58:24 -04:00
|
|
|
event->button == 1)
|
2001-06-20 00:29:28 -04:00
|
|
|
{
|
2001-06-23 14:30:27 -04:00
|
|
|
MetaFrameFlags flags;
|
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
2007-06-06 23:31:17 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_END);
|
|
|
|
|
2001-06-23 14:30:27 -04:00
|
|
|
if (flags & META_FRAME_ALLOWS_MOVE)
|
2001-07-25 23:14:45 -04:00
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_begin_grab_op (display,
|
2001-07-25 23:14:45 -04:00
|
|
|
frame->xwindow,
|
|
|
|
META_GRAB_OP_MOVING,
|
|
|
|
TRUE,
|
2006-10-12 20:28:34 -04:00
|
|
|
TRUE,
|
2001-07-25 23:14:45 -04:00
|
|
|
event->button,
|
|
|
|
0,
|
|
|
|
event->time,
|
|
|
|
event->x_root,
|
|
|
|
event->y_root);
|
2001-06-23 14:30:27 -04:00
|
|
|
}
|
2001-06-20 00:29:28 -04:00
|
|
|
}
|
2002-10-11 14:42:40 -04:00
|
|
|
else if (event->button == 2)
|
|
|
|
{
|
2007-02-17 16:15:59 -05:00
|
|
|
return meta_frame_middle_click_event (frame, event);
|
2002-10-11 14:42:40 -04:00
|
|
|
}
|
2001-07-03 22:10:54 -04:00
|
|
|
else if (event->button == 3)
|
|
|
|
{
|
2007-02-17 16:15:59 -05:00
|
|
|
return meta_frame_right_click_event (frame, event);
|
2001-07-03 22:10:54 -04:00
|
|
|
}
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-06-21 01:23:24 -04:00
|
|
|
void
|
|
|
|
meta_frames_notify_menu_hide (MetaFrames *frames)
|
|
|
|
{
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
|
|
if (meta_core_get_grab_op (display) ==
|
2001-07-25 23:14:45 -04:00
|
|
|
META_GRAB_OP_CLICKING_MENU)
|
2001-06-21 01:23:24 -04:00
|
|
|
{
|
2001-07-25 23:14:45 -04:00
|
|
|
Window grab_frame;
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
grab_frame = meta_core_get_grab_frame (display);
|
2001-07-25 23:14:45 -04:00
|
|
|
|
|
|
|
if (grab_frame != None)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, grab_frame);
|
|
|
|
|
|
|
|
if (frame)
|
|
|
|
{
|
|
|
|
redraw_control (frames, frame,
|
|
|
|
META_FRAME_CONTROL_MENU);
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, CurrentTime);
|
2001-07-25 23:14:45 -04:00
|
|
|
}
|
|
|
|
}
|
2001-06-21 01:23:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean
|
2001-06-15 00:33:21 -04:00
|
|
|
meta_frames_button_release_event (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrames *frames;
|
2001-07-25 23:14:45 -04:00
|
|
|
MetaGrabOp op;
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display;
|
2001-07-25 23:14:45 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frames = META_FRAMES (widget);
|
2010-09-10 03:17:55 -04:00
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
2001-06-30 19:17:52 -04:00
|
|
|
clear_tip (frames);
|
2001-07-25 23:14:45 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
op = meta_core_get_grab_op (display);
|
2001-07-25 23:14:45 -04:00
|
|
|
|
|
|
|
if (op == META_GRAB_OP_NONE)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* We only handle the releases we handled the presses for (things
|
|
|
|
* involving frame controls). Window ops that don't require a
|
|
|
|
* frame are handled in the Xlib part of the code, display.c/window.c
|
|
|
|
*/
|
2010-09-10 03:17:55 -04:00
|
|
|
if (frame->xwindow == meta_core_get_grab_frame (display) &&
|
|
|
|
((int) event->button) == meta_core_get_grab_button (display))
|
2001-06-20 00:29:28 -04:00
|
|
|
{
|
2006-08-07 17:04:44 -04:00
|
|
|
MetaFrameControl control;
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2006-08-07 17:04:44 -04:00
|
|
|
control = get_control (frames, frame, event->x, event->y);
|
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
switch (op)
|
2001-06-20 00:29:28 -04:00
|
|
|
{
|
2001-07-25 23:14:45 -04:00
|
|
|
case META_GRAB_OP_CLICKING_MINIMIZE:
|
2006-08-07 17:04:44 -04:00
|
|
|
if (control == META_FRAME_CONTROL_MINIMIZE)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_minimize (display, frame->xwindow);
|
2006-08-07 17:04:44 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
case META_GRAB_OP_CLICKING_MAXIMIZE:
|
2006-08-07 17:04:44 -04:00
|
|
|
if (control == META_FRAME_CONTROL_MAXIMIZE)
|
2007-07-22 21:48:17 -04:00
|
|
|
{
|
|
|
|
/* Focus the window on the maximize */
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_user_focus (display,
|
2007-07-22 21:48:17 -04:00
|
|
|
frame->xwindow,
|
|
|
|
event->time);
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_maximize (display, frame->xwindow);
|
2007-07-22 21:48:17 -04:00
|
|
|
}
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
|
|
|
|
2001-09-10 23:54:54 -04:00
|
|
|
case META_GRAB_OP_CLICKING_UNMAXIMIZE:
|
2006-08-07 17:04:44 -04:00
|
|
|
if (control == META_FRAME_CONTROL_UNMAXIMIZE)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_unmaximize (display, frame->xwindow);
|
2006-08-07 17:04:44 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
2001-09-10 23:54:54 -04:00
|
|
|
break;
|
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
case META_GRAB_OP_CLICKING_DELETE:
|
2006-08-07 17:04:44 -04:00
|
|
|
if (control == META_FRAME_CONTROL_DELETE)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_delete (display, frame->xwindow, event->time);
|
2006-08-07 17:04:44 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
case META_GRAB_OP_CLICKING_MENU:
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
2001-07-25 23:14:45 -04:00
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_GRAB_OP_CLICKING_SHADE:
|
|
|
|
if (control == META_FRAME_CONTROL_SHADE)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_shade (display, frame->xwindow, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case META_GRAB_OP_CLICKING_UNSHADE:
|
|
|
|
if (control == META_FRAME_CONTROL_UNSHADE)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_unshade (display, frame->xwindow, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case META_GRAB_OP_CLICKING_ABOVE:
|
|
|
|
if (control == META_FRAME_CONTROL_ABOVE)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_make_above (display, frame->xwindow);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case META_GRAB_OP_CLICKING_UNABOVE:
|
|
|
|
if (control == META_FRAME_CONTROL_UNABOVE)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_unmake_above (display, frame->xwindow);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case META_GRAB_OP_CLICKING_STICK:
|
|
|
|
if (control == META_FRAME_CONTROL_STICK)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_stick (display, frame->xwindow);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case META_GRAB_OP_CLICKING_UNSTICK:
|
|
|
|
if (control == META_FRAME_CONTROL_UNSTICK)
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_unstick (display, frame->xwindow);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_end_grab_op (display, event->time);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
break;
|
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
default:
|
2001-06-20 00:29:28 -04:00
|
|
|
break;
|
|
|
|
}
|
2001-07-25 23:14:45 -04:00
|
|
|
|
2006-08-07 17:04:44 -04:00
|
|
|
/* Update the prelit control regardless of what button the mouse
|
|
|
|
* was released over; needed so that the new button can become
|
|
|
|
* prelit so to let the user know that it can now be pressed.
|
|
|
|
* :)
|
|
|
|
*/
|
|
|
|
meta_frames_update_prelit_control (frames, frame, control);
|
2001-06-20 00:29:28 -04:00
|
|
|
}
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-02-12 00:01:22 -05:00
|
|
|
static void
|
|
|
|
meta_frames_update_prelit_control (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaUIFrame *frame,
|
|
|
|
MetaFrameControl control)
|
2002-02-12 00:01:22 -05:00
|
|
|
{
|
|
|
|
MetaFrameControl old_control;
|
2002-08-20 16:18:18 -04:00
|
|
|
MetaCursor cursor;
|
2002-02-12 00:01:22 -05:00
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
2006-01-20 17:03:56 -05:00
|
|
|
meta_verbose ("Updating prelit control from %u to %u\n",
|
2002-08-20 16:18:18 -04:00
|
|
|
frame->prelit_control, control);
|
|
|
|
|
|
|
|
cursor = META_CURSOR_DEFAULT;
|
|
|
|
|
|
|
|
switch (control)
|
|
|
|
{
|
|
|
|
case META_FRAME_CONTROL_CLIENT_AREA:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_NONE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_TITLE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_DELETE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MENU:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MINIMIZE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MAXIMIZE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNMAXIMIZE:
|
|
|
|
break;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_FRAME_CONTROL_SHADE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSHADE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_ABOVE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNABOVE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_STICK:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSTICK:
|
|
|
|
break;
|
2002-08-20 16:18:18 -04:00
|
|
|
case META_FRAME_CONTROL_RESIZE_SE:
|
|
|
|
cursor = META_CURSOR_SE_RESIZE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_S:
|
|
|
|
cursor = META_CURSOR_SOUTH_RESIZE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_SW:
|
|
|
|
cursor = META_CURSOR_SW_RESIZE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_N:
|
|
|
|
cursor = META_CURSOR_NORTH_RESIZE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NE:
|
|
|
|
cursor = META_CURSOR_NE_RESIZE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NW:
|
|
|
|
cursor = META_CURSOR_NW_RESIZE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_W:
|
|
|
|
cursor = META_CURSOR_WEST_RESIZE;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_E:
|
|
|
|
cursor = META_CURSOR_EAST_RESIZE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set/unset the prelight cursor */
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
2002-08-20 16:18:18 -04:00
|
|
|
frame->xwindow,
|
2002-09-03 22:21:26 -04:00
|
|
|
cursor);
|
|
|
|
|
|
|
|
switch (control)
|
|
|
|
{
|
|
|
|
case META_FRAME_CONTROL_MENU:
|
|
|
|
case META_FRAME_CONTROL_MINIMIZE:
|
|
|
|
case META_FRAME_CONTROL_MAXIMIZE:
|
|
|
|
case META_FRAME_CONTROL_DELETE:
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_FRAME_CONTROL_SHADE:
|
|
|
|
case META_FRAME_CONTROL_UNSHADE:
|
|
|
|
case META_FRAME_CONTROL_ABOVE:
|
|
|
|
case META_FRAME_CONTROL_UNABOVE:
|
|
|
|
case META_FRAME_CONTROL_STICK:
|
|
|
|
case META_FRAME_CONTROL_UNSTICK:
|
2002-09-03 22:21:26 -04:00
|
|
|
case META_FRAME_CONTROL_UNMAXIMIZE:
|
|
|
|
/* leave control set */
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* Only prelight buttons */
|
|
|
|
control = META_FRAME_CONTROL_NONE;
|
|
|
|
break;
|
|
|
|
}
|
2002-02-12 00:01:22 -05:00
|
|
|
|
|
|
|
if (control == frame->prelit_control)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Save the old control so we can unprelight it */
|
|
|
|
old_control = frame->prelit_control;
|
|
|
|
|
|
|
|
frame->prelit_control = control;
|
|
|
|
|
|
|
|
redraw_control (frames, frame, old_control);
|
|
|
|
redraw_control (frames, frame, control);
|
|
|
|
}
|
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean
|
2001-06-15 00:33:21 -04:00
|
|
|
meta_frames_motion_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrames *frames;
|
2003-05-16 19:09:49 -04:00
|
|
|
MetaGrabOp grab_op;
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display;
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frames = META_FRAMES (widget);
|
2010-09-10 03:17:55 -04:00
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
2001-06-30 19:17:52 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
2001-06-30 19:17:52 -04:00
|
|
|
clear_tip (frames);
|
|
|
|
|
|
|
|
frames->last_motion_frame = frame;
|
2003-05-16 19:09:49 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
grab_op = meta_core_get_grab_op (display);
|
2001-06-30 19:17:52 -04:00
|
|
|
|
2003-05-16 19:09:49 -04:00
|
|
|
switch (grab_op)
|
2001-06-20 00:29:28 -04:00
|
|
|
{
|
2001-07-25 23:14:45 -04:00
|
|
|
case META_GRAB_OP_CLICKING_MENU:
|
|
|
|
case META_GRAB_OP_CLICKING_DELETE:
|
|
|
|
case META_GRAB_OP_CLICKING_MINIMIZE:
|
|
|
|
case META_GRAB_OP_CLICKING_MAXIMIZE:
|
2001-09-10 23:54:54 -04:00
|
|
|
case META_GRAB_OP_CLICKING_UNMAXIMIZE:
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_GRAB_OP_CLICKING_SHADE:
|
|
|
|
case META_GRAB_OP_CLICKING_UNSHADE:
|
|
|
|
case META_GRAB_OP_CLICKING_ABOVE:
|
|
|
|
case META_GRAB_OP_CLICKING_UNABOVE:
|
|
|
|
case META_GRAB_OP_CLICKING_STICK:
|
|
|
|
case META_GRAB_OP_CLICKING_UNSTICK:
|
2003-05-16 19:09:49 -04:00
|
|
|
{
|
|
|
|
MetaFrameControl control;
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
gdk_window_get_pointer (frame->window, &x, &y, NULL);
|
|
|
|
|
|
|
|
/* Control is set to none unless it matches
|
|
|
|
* the current grab
|
|
|
|
*/
|
|
|
|
control = get_control (frames, frame, x, y);
|
|
|
|
if (! ((control == META_FRAME_CONTROL_MENU &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_MENU) ||
|
|
|
|
(control == META_FRAME_CONTROL_DELETE &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_DELETE) ||
|
|
|
|
(control == META_FRAME_CONTROL_MINIMIZE &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_MINIMIZE) ||
|
2007-01-13 08:27:20 -05:00
|
|
|
((control == META_FRAME_CONTROL_MAXIMIZE ||
|
|
|
|
control == META_FRAME_CONTROL_UNMAXIMIZE) &&
|
2003-05-16 19:09:49 -04:00
|
|
|
(grab_op == META_GRAB_OP_CLICKING_MAXIMIZE ||
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
grab_op == META_GRAB_OP_CLICKING_UNMAXIMIZE)) ||
|
|
|
|
(control == META_FRAME_CONTROL_SHADE &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_SHADE) ||
|
|
|
|
(control == META_FRAME_CONTROL_UNSHADE &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_UNSHADE) ||
|
|
|
|
(control == META_FRAME_CONTROL_ABOVE &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_ABOVE) ||
|
|
|
|
(control == META_FRAME_CONTROL_UNABOVE &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_UNABOVE) ||
|
|
|
|
(control == META_FRAME_CONTROL_STICK &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_STICK) ||
|
|
|
|
(control == META_FRAME_CONTROL_UNSTICK &&
|
|
|
|
grab_op == META_GRAB_OP_CLICKING_UNSTICK)))
|
|
|
|
control = META_FRAME_CONTROL_NONE;
|
2003-05-16 19:09:49 -04:00
|
|
|
|
|
|
|
/* Update prelit control and cursor */
|
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
2007-06-06 23:31:17 -04:00
|
|
|
meta_frames_update_prelit_control (frames, frame, control);
|
2003-05-16 19:09:49 -04:00
|
|
|
|
|
|
|
/* No tooltip while in the process of clicking */
|
|
|
|
}
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
2001-07-25 23:14:45 -04:00
|
|
|
case META_GRAB_OP_NONE:
|
2001-07-02 21:45:43 -04:00
|
|
|
{
|
|
|
|
MetaFrameControl control;
|
|
|
|
int x, y;
|
2001-07-25 23:14:45 -04:00
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
gdk_window_get_pointer (frame->window, &x, &y, NULL);
|
|
|
|
|
|
|
|
control = get_control (frames, frame, x, y);
|
2002-02-12 00:01:22 -05:00
|
|
|
|
2002-08-20 16:18:18 -04:00
|
|
|
/* Update prelit control and cursor */
|
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
2007-06-06 23:31:17 -04:00
|
|
|
meta_frames_update_prelit_control (frames, frame, control);
|
2001-07-02 21:45:43 -04:00
|
|
|
|
|
|
|
queue_tip (frames);
|
|
|
|
}
|
2001-06-20 23:40:14 -04:00
|
|
|
break;
|
2001-07-25 23:14:45 -04:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2001-06-20 00:29:28 -04:00
|
|
|
}
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean
|
2001-06-15 00:33:21 -04:00
|
|
|
meta_frames_destroy_event (GtkWidget *widget,
|
|
|
|
GdkEventAny *event)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (widget);
|
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2010-08-16 13:20:44 -04:00
|
|
|
#if !GTK_CHECK_VERSION(2,21,6)
|
|
|
|
/* Copied from GDK */
|
2010-08-19 03:28:46 -04:00
|
|
|
static cairo_surface_t *
|
|
|
|
_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
|
|
|
|
|
|
|
|
return GDK_DRAWABLE_GET_CLASS (drawable)->ref_cairo_surface (drawable);
|
|
|
|
}
|
|
|
|
|
2010-08-16 13:20:44 -04:00
|
|
|
static cairo_pattern_t *
|
|
|
|
gdk_window_get_background_pattern (GdkWindow *window)
|
|
|
|
{
|
|
|
|
GdkWindowObject *private = (GdkWindowObject *) window;
|
|
|
|
cairo_pattern_t *pattern;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
|
|
if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG)
|
|
|
|
pattern = NULL;
|
|
|
|
else if (private->bg_pixmap != GDK_NO_BG &&
|
|
|
|
private->bg_pixmap != NULL)
|
|
|
|
{
|
|
|
|
static cairo_user_data_key_t key;
|
|
|
|
cairo_surface_t *surface;
|
|
|
|
|
|
|
|
surface = _gdk_drawable_ref_cairo_surface (private->bg_pixmap);
|
|
|
|
pattern = cairo_pattern_create_for_surface (surface);
|
|
|
|
cairo_surface_destroy (surface);
|
|
|
|
|
|
|
|
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
|
|
|
|
cairo_pattern_set_user_data (pattern,
|
|
|
|
&key,
|
|
|
|
g_object_ref (private->bg_pixmap),
|
|
|
|
g_object_unref);
|
|
|
|
}
|
|
|
|
else
|
2010-08-19 03:28:46 -04:00
|
|
|
{
|
|
|
|
pattern =
|
2010-08-16 13:20:44 -04:00
|
|
|
cairo_pattern_create_rgb (private->bg_color.red / 65535.,
|
|
|
|
private->bg_color.green / 65535.,
|
|
|
|
private->bg_color.blue / 65535.);
|
|
|
|
}
|
|
|
|
|
|
|
|
return pattern;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-07-19 11:55:00 -04:00
|
|
|
static void
|
|
|
|
setup_bg_cr (cairo_t *cr, GdkWindow *window, int x_offset, int y_offset)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
2010-06-14 06:46:22 -04:00
|
|
|
GdkWindow *parent = gdk_window_get_parent (window);
|
2010-08-16 13:20:44 -04:00
|
|
|
cairo_pattern_t *bg_pattern;
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-08-16 13:20:44 -04:00
|
|
|
bg_pattern = gdk_window_get_background_pattern (window);
|
|
|
|
if (bg_pattern == NULL && parent)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
2010-06-14 06:46:22 -04:00
|
|
|
gint window_x, window_y;
|
|
|
|
|
|
|
|
gdk_window_get_position (window, &window_x, &window_y);
|
2010-07-19 11:55:00 -04:00
|
|
|
setup_bg_cr (cr, parent, x_offset + window_x, y_offset + window_y);
|
2005-06-26 17:58:37 -04:00
|
|
|
}
|
2010-08-16 13:20:44 -04:00
|
|
|
else if (bg_pattern)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
2010-08-16 13:20:44 -04:00
|
|
|
cairo_translate (cr, - x_offset, - y_offset);
|
|
|
|
cairo_set_source (cr, bg_pattern);
|
|
|
|
cairo_translate (cr, x_offset, y_offset);
|
2005-06-26 17:58:37 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
/* Returns a pixmap with a piece of the windows frame painted on it.
|
|
|
|
*/
|
|
|
|
|
2010-09-23 12:56:46 -04:00
|
|
|
static MetaPixmap *
|
2005-06-26 17:58:37 -04:00
|
|
|
generate_pixmap (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaUIFrame *frame,
|
2010-09-20 15:14:00 -04:00
|
|
|
GdkRectangle *rect)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
2010-09-23 12:56:46 -04:00
|
|
|
MetaPixmap *result;
|
2010-09-23 12:38:10 -04:00
|
|
|
cairo_t *cr;
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-09-20 14:44:23 -04:00
|
|
|
/* do not create a pixmap for nonexisting areas */
|
2010-09-20 15:14:00 -04:00
|
|
|
if (rect->width <= 0 || rect->height <= 0)
|
2010-09-20 14:44:23 -04:00
|
|
|
return NULL;
|
|
|
|
|
2010-09-23 12:56:46 -04:00
|
|
|
result = meta_pixmap_new (frame->window,
|
|
|
|
rect->width, rect->height);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-09-23 12:56:46 -04:00
|
|
|
cr = meta_pixmap_cairo_create (result);
|
2010-09-27 07:55:28 -04:00
|
|
|
cairo_translate (cr, -rect->x, -rect->y);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-09-27 07:55:28 -04:00
|
|
|
setup_bg_cr (cr, frame->window, 0, 0);
|
2010-09-23 12:49:00 -04:00
|
|
|
cairo_paint (cr);
|
|
|
|
|
2010-09-27 07:55:28 -04:00
|
|
|
meta_frames_paint (frames, frame, cr);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-09-23 12:38:10 -04:00
|
|
|
cairo_destroy (cr);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
static void
|
|
|
|
populate_cache (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaUIFrame *frame)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
|
|
|
int top, bottom, left, right;
|
|
|
|
int width, height;
|
|
|
|
int frame_width, frame_height, screen_width, screen_height;
|
|
|
|
CachedPixels *pixels;
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaFrameType frame_type;
|
|
|
|
MetaFrameFlags frame_flags;
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
int i;
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
|
|
|
frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
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);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
/* don't cache extremely large windows */
|
|
|
|
if (frame_width > 2 * screen_width ||
|
|
|
|
frame_height > 2 * screen_height)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
meta_theme_get_frame_borders (meta_theme_get_current (),
|
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
2007-06-06 23:31:17 -04:00
|
|
|
frame_type,
|
|
|
|
frame->text_height,
|
|
|
|
frame_flags,
|
2005-06-26 17:58:37 -04:00
|
|
|
&top, &bottom, &left, &right);
|
|
|
|
|
|
|
|
pixels = get_cache (frames, frame);
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
|
|
|
|
/* Setup the rectangles for the four frame borders. First top, then
|
|
|
|
left, right and bottom. */
|
|
|
|
pixels->piece[0].rect.x = 0;
|
|
|
|
pixels->piece[0].rect.y = 0;
|
|
|
|
pixels->piece[0].rect.width = left + width + right;
|
|
|
|
pixels->piece[0].rect.height = top;
|
|
|
|
|
|
|
|
pixels->piece[1].rect.x = 0;
|
|
|
|
pixels->piece[1].rect.y = top;
|
|
|
|
pixels->piece[1].rect.width = left;
|
|
|
|
pixels->piece[1].rect.height = height;
|
|
|
|
|
|
|
|
pixels->piece[2].rect.x = left + width;
|
|
|
|
pixels->piece[2].rect.y = top;
|
|
|
|
pixels->piece[2].rect.width = right;
|
|
|
|
pixels->piece[2].rect.height = height;
|
|
|
|
|
|
|
|
pixels->piece[3].rect.x = 0;
|
|
|
|
pixels->piece[3].rect.y = top + height;
|
|
|
|
pixels->piece[3].rect.width = left + width + right;
|
|
|
|
pixels->piece[3].rect.height = bottom;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
CachedFramePiece *piece = &pixels->piece[i];
|
2010-09-20 14:44:23 -04:00
|
|
|
/* generate_pixmap() returns NULL for 0 width/height pieces, but
|
|
|
|
* does so cheaply so we don't need to cache the NULL return */
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
if (!piece->pixmap)
|
2010-09-20 15:14:00 -04:00
|
|
|
piece->pixmap = generate_pixmap (frames, frame, &piece->rect);
|
2005-06-26 17:58:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (frames->invalidate_cache_timeout_id)
|
|
|
|
g_source_remove (frames->invalidate_cache_timeout_id);
|
|
|
|
|
|
|
|
frames->invalidate_cache_timeout_id = g_timeout_add (1000, invalidate_cache_timeout, frames);
|
|
|
|
|
|
|
|
if (!g_list_find (frames->invalidate_frames, frame))
|
|
|
|
frames->invalidate_frames =
|
|
|
|
g_list_prepend (frames->invalidate_frames, frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-06-29 18:43:56 -04:00
|
|
|
clip_to_screen (MetaRegion *region, MetaUIFrame *frame)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
|
|
|
GdkRectangle frame_area;
|
|
|
|
GdkRectangle screen_area = { 0, 0, 0, 0 };
|
2010-06-29 18:43:56 -04:00
|
|
|
MetaRegion *tmp_region;
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
/* Chop off stuff outside the screen; this optimization
|
|
|
|
* is crucial to handle huge client windows,
|
|
|
|
* like "xterm -geometry 1000x1000"
|
|
|
|
*/
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
|
|
|
frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
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,
|
2010-09-16 11:16:12 -04:00
|
|
|
META_CORE_GET_SCREEN_WIDTH, &screen_area.width,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_SCREEN_HEIGHT, &screen_area.height,
|
|
|
|
META_CORE_GET_END);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-06-29 18:43:56 -04:00
|
|
|
meta_region_translate (region, frame_area.x, frame_area.y);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-06-29 18:43:56 -04:00
|
|
|
tmp_region = meta_region_new_from_rectangle (&frame_area);
|
|
|
|
meta_region_intersect (region, tmp_region);
|
|
|
|
meta_region_destroy (tmp_region);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2010-09-16 11:16:12 -04:00
|
|
|
tmp_region = meta_region_new_from_rectangle (&screen_area);
|
|
|
|
meta_region_intersect (region, tmp_region);
|
|
|
|
meta_region_destroy (tmp_region);
|
|
|
|
|
2010-06-29 18:43:56 -04:00
|
|
|
meta_region_translate (region, - frame_area.x, - frame_area.y);
|
2005-06-26 17:58:37 -04:00
|
|
|
}
|
|
|
|
|
2010-09-17 05:11:37 -04:00
|
|
|
static void
|
|
|
|
subtract_client_area (MetaRegion *region, MetaUIFrame *frame)
|
|
|
|
{
|
|
|
|
GdkRectangle area;
|
|
|
|
MetaFrameFlags flags;
|
|
|
|
MetaFrameType type;
|
|
|
|
MetaRegion *tmp_region;
|
|
|
|
Display *display;
|
|
|
|
|
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
|
|
|
|
|
|
meta_core_get (display, frame->xwindow,
|
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_FRAME_TYPE, &type,
|
|
|
|
META_CORE_GET_CLIENT_WIDTH, &area.width,
|
|
|
|
META_CORE_GET_CLIENT_HEIGHT, &area.height,
|
|
|
|
META_CORE_GET_END);
|
|
|
|
meta_theme_get_frame_borders (meta_theme_get_current (),
|
|
|
|
type, frame->text_height, flags,
|
2010-09-27 07:54:39 -04:00
|
|
|
&area.y, NULL, &area.x, NULL);
|
2010-09-17 05:11:37 -04:00
|
|
|
|
|
|
|
tmp_region = meta_region_new_from_rectangle (&area);
|
|
|
|
meta_region_subtract (region, tmp_region);
|
|
|
|
meta_region_destroy (tmp_region);
|
|
|
|
}
|
|
|
|
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
static void
|
|
|
|
cached_pixels_draw (CachedPixels *pixels,
|
2010-09-24 06:53:04 -04:00
|
|
|
cairo_t *cr,
|
2010-06-29 18:43:56 -04:00
|
|
|
MetaRegion *region)
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
{
|
2010-09-20 15:14:49 -04:00
|
|
|
MetaRegion *region_piece;
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
|
|
|
CachedFramePiece *piece;
|
|
|
|
piece = &pixels->piece[i];
|
|
|
|
|
|
|
|
if (piece->pixmap)
|
|
|
|
{
|
2010-09-23 12:56:46 -04:00
|
|
|
meta_cairo_set_source_pixmap (cr, piece->pixmap,
|
|
|
|
piece->rect.x, piece->rect.y);
|
2010-07-19 11:55:00 -04:00
|
|
|
cairo_paint (cr);
|
2010-09-20 15:14:49 -04:00
|
|
|
|
|
|
|
region_piece = meta_region_new_from_rectangle (&piece->rect);
|
|
|
|
meta_region_subtract (region, region_piece);
|
|
|
|
meta_region_destroy (region_piece);
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-24 07:30:40 -04:00
|
|
|
#ifdef USE_GTK3
|
|
|
|
static gboolean
|
|
|
|
meta_frames_draw (GtkWidget *widget,
|
|
|
|
cairo_t *cr)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
MetaFrames *frames;
|
|
|
|
CachedPixels *pixels;
|
|
|
|
MetaRegion *region;
|
|
|
|
GdkRectangle *areas, clip;
|
|
|
|
int i, n_areas;
|
|
|
|
cairo_surface_t *target;
|
|
|
|
|
|
|
|
frames = META_FRAMES (widget);
|
|
|
|
target = cairo_get_target (cr);
|
|
|
|
gdk_cairo_get_clip_rectangle (cr, &clip);
|
|
|
|
|
|
|
|
g_assert (cairo_surface_get_type (target) == CAIRO_SURFACE_TYPE_XLIB);
|
|
|
|
frame = meta_frames_lookup_window (frames, cairo_xlib_surface_get_drawable (target));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (frames->expose_delay_count > 0)
|
|
|
|
{
|
|
|
|
/* Redraw this entire frame later */
|
|
|
|
frame->expose_delayed = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
populate_cache (frames, frame);
|
|
|
|
|
|
|
|
region = meta_region_new_from_rectangle (&clip);
|
|
|
|
|
|
|
|
pixels = get_cache (frames, frame);
|
|
|
|
|
|
|
|
cached_pixels_draw (pixels, cr, region);
|
|
|
|
|
|
|
|
clip_to_screen (region, frame);
|
|
|
|
subtract_client_area (region, frame);
|
|
|
|
|
|
|
|
meta_region_get_rectangles (region, &areas, &n_areas);
|
|
|
|
|
|
|
|
for (i = 0; i < n_areas; i++)
|
|
|
|
{
|
|
|
|
cairo_save (cr);
|
|
|
|
|
|
|
|
gdk_cairo_rectangle (cr, &areas[i]);
|
|
|
|
cairo_clip (cr);
|
|
|
|
|
|
|
|
cairo_push_group (cr);
|
|
|
|
|
2010-09-27 07:55:28 -04:00
|
|
|
meta_frames_paint (frames, frame, cr);
|
2010-09-24 07:30:40 -04:00
|
|
|
|
|
|
|
cairo_pop_group_to_source (cr);
|
|
|
|
cairo_paint (cr);
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (areas);
|
|
|
|
|
|
|
|
meta_region_destroy (region);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
#else /* !USE_GTK3 */
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean
|
2002-01-27 00:27:11 -05:00
|
|
|
meta_frames_expose_event (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
2001-06-15 00:33:21 -04:00
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrames *frames;
|
2005-06-26 17:58:37 -04:00
|
|
|
CachedPixels *pixels;
|
2010-09-17 05:16:45 -04:00
|
|
|
MetaRegion *region, *area_region;
|
|
|
|
GdkRectangle *areas;
|
|
|
|
int i, n_areas;
|
2010-09-23 12:38:10 -04:00
|
|
|
cairo_t *cr;
|
2002-01-27 00:27:11 -05:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frames = META_FRAMES (widget);
|
2003-08-16 12:32:10 -04:00
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
2001-08-18 21:19:54 -04:00
|
|
|
if (frames->expose_delay_count > 0)
|
|
|
|
{
|
|
|
|
/* Redraw this entire frame later */
|
|
|
|
frame->expose_delayed = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2002-01-27 00:27:11 -05:00
|
|
|
|
2005-06-26 17:58:37 -04:00
|
|
|
populate_cache (frames, frame);
|
|
|
|
|
2010-06-29 18:43:56 -04:00
|
|
|
region = meta_region_copy (event->region);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
pixels = get_cache (frames, frame);
|
|
|
|
|
2010-09-24 06:53:04 -04:00
|
|
|
cr = gdk_cairo_create (event->window);
|
|
|
|
cached_pixels_draw (pixels, cr, region);
|
|
|
|
cairo_destroy (cr);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
clip_to_screen (region, frame);
|
2010-09-17 05:11:37 -04:00
|
|
|
subtract_client_area (region, frame);
|
|
|
|
|
2010-09-17 05:16:45 -04:00
|
|
|
meta_region_get_rectangles (region, &areas, &n_areas);
|
|
|
|
|
|
|
|
for (i = 0; i < n_areas; i++)
|
|
|
|
{
|
|
|
|
area_region = meta_region_new_from_rectangle (&areas[i]);
|
|
|
|
|
|
|
|
gdk_window_begin_paint_region (event->window, area_region);
|
2010-09-23 12:38:10 -04:00
|
|
|
cr = gdk_cairo_create (event->window);
|
|
|
|
/* no need to clip, begin_paint_region ensures the pixmap
|
|
|
|
* is only as big as the rect we use. */
|
2010-09-17 05:16:45 -04:00
|
|
|
|
2010-09-27 07:55:28 -04:00
|
|
|
meta_frames_paint (frames, frame, cr);
|
2010-09-17 05:16:45 -04:00
|
|
|
|
2010-09-23 12:38:10 -04:00
|
|
|
cairo_destroy (cr);
|
2010-09-17 05:16:45 -04:00
|
|
|
gdk_window_end_paint (event->window);
|
|
|
|
|
|
|
|
meta_region_destroy (area_region);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (areas);
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
|
2010-06-29 18:43:56 -04:00
|
|
|
meta_region_destroy (region);
|
2005-06-26 17:58:37 -04:00
|
|
|
|
2002-01-27 00:27:11 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
2010-09-24 07:30:40 -04:00
|
|
|
#endif /* !USE_GTK3 */
|
2002-01-27 00:27:11 -05:00
|
|
|
|
|
|
|
static void
|
2010-09-23 12:38:10 -04:00
|
|
|
meta_frames_paint (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame,
|
2010-09-27 07:55:28 -04:00
|
|
|
cairo_t *cr)
|
2002-01-27 00:27:11 -05:00
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
MetaFrameFlags flags;
|
2002-02-06 22:07:56 -05:00
|
|
|
MetaFrameType type;
|
|
|
|
GdkPixbuf *mini_icon;
|
|
|
|
GdkPixbuf *icon;
|
|
|
|
int w, h;
|
|
|
|
MetaButtonState button_states[META_BUTTON_TYPE_LAST];
|
|
|
|
Window grab_frame;
|
|
|
|
int i;
|
2002-10-03 22:28:57 -04:00
|
|
|
MetaButtonLayout button_layout;
|
2003-05-16 19:09:49 -04:00
|
|
|
MetaGrabOp grab_op;
|
2010-09-10 03:17:55 -04:00
|
|
|
Display *display;
|
2001-06-18 02:11:53 -04:00
|
|
|
|
2002-02-06 22:07:56 -05:00
|
|
|
widget = GTK_WIDGET (frames);
|
2010-09-10 03:17:55 -04:00
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
2001-06-18 02:11:53 -04:00
|
|
|
|
Replace while loops iterating over sequences with for loops. Also, replace
2006-04-19 Björn Lindqvist <bjourne@gmail.com>
* src/frames.c (struct CachedPixels, meta_frames_destroy,
invalidate_cache, generate_pixmap, populate_cache,
cached_pixels_draw, meta_frames_expose_event,
meta_frames_paint_to_drawable):
Replace while loops iterating over sequences with for loops. Also,
replace the attributes in the CachedPixels struct with a list of
four CachedFramePiece:s, this allows iteration over the four
pixmaps instead of treating each one separately. Fixes #338359.
2006-04-19 11:22:07 -04:00
|
|
|
for (i = 0; i < META_BUTTON_TYPE_LAST; i++)
|
|
|
|
button_states[i] = META_BUTTON_STATE_NORMAL;
|
2002-02-12 00:01:22 -05:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
grab_frame = meta_core_get_grab_frame (display);
|
|
|
|
grab_op = meta_core_get_grab_op (display);
|
2003-05-16 19:09:49 -04:00
|
|
|
if (grab_frame != frame->xwindow)
|
|
|
|
grab_op = META_GRAB_OP_NONE;
|
|
|
|
|
2002-02-12 00:01:22 -05:00
|
|
|
/* Set prelight state */
|
|
|
|
switch (frame->prelit_control)
|
|
|
|
{
|
|
|
|
case META_FRAME_CONTROL_MENU:
|
2003-05-16 19:09:49 -04:00
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_MENU)
|
|
|
|
button_states[META_BUTTON_TYPE_MENU] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_MENU] = META_BUTTON_STATE_PRELIGHT;
|
2002-02-12 00:01:22 -05:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MINIMIZE:
|
2003-05-16 19:09:49 -04:00
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_MINIMIZE)
|
|
|
|
button_states[META_BUTTON_TYPE_MINIMIZE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_MINIMIZE] = META_BUTTON_STATE_PRELIGHT;
|
2002-02-12 00:01:22 -05:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MAXIMIZE:
|
2003-05-16 19:09:49 -04:00
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_MAXIMIZE)
|
|
|
|
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRELIGHT;
|
|
|
|
break;
|
2002-09-03 22:21:26 -04:00
|
|
|
case META_FRAME_CONTROL_UNMAXIMIZE:
|
2003-05-16 19:09:49 -04:00
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_UNMAXIMIZE)
|
|
|
|
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_MAXIMIZE] = META_BUTTON_STATE_PRELIGHT;
|
2002-02-12 00:01:22 -05:00
|
|
|
break;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_FRAME_CONTROL_SHADE:
|
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_SHADE)
|
|
|
|
button_states[META_BUTTON_TYPE_SHADE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_SHADE] = META_BUTTON_STATE_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSHADE:
|
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_UNSHADE)
|
|
|
|
button_states[META_BUTTON_TYPE_UNSHADE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_UNSHADE] = META_BUTTON_STATE_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_ABOVE:
|
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_ABOVE)
|
|
|
|
button_states[META_BUTTON_TYPE_ABOVE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_ABOVE] = META_BUTTON_STATE_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNABOVE:
|
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_UNABOVE)
|
|
|
|
button_states[META_BUTTON_TYPE_UNABOVE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_UNABOVE] = META_BUTTON_STATE_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_STICK:
|
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_STICK)
|
|
|
|
button_states[META_BUTTON_TYPE_STICK] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_STICK] = META_BUTTON_STATE_PRELIGHT;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSTICK:
|
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_UNSTICK)
|
|
|
|
button_states[META_BUTTON_TYPE_UNSTICK] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_UNSTICK] = META_BUTTON_STATE_PRELIGHT;
|
|
|
|
break;
|
2002-02-12 00:01:22 -05:00
|
|
|
case META_FRAME_CONTROL_DELETE:
|
2003-05-16 19:09:49 -04:00
|
|
|
if (grab_op == META_GRAB_OP_CLICKING_DELETE)
|
|
|
|
button_states[META_BUTTON_TYPE_CLOSE] = META_BUTTON_STATE_PRESSED;
|
|
|
|
else
|
|
|
|
button_states[META_BUTTON_TYPE_CLOSE] = META_BUTTON_STATE_PRELIGHT;
|
2002-02-12 00:01:22 -05:00
|
|
|
break;
|
|
|
|
default:
|
2002-08-04 16:20:53 -04:00
|
|
|
break;
|
2002-02-12 00:01:22 -05:00
|
|
|
}
|
2002-08-04 16:45:05 -04:00
|
|
|
|
|
|
|
/* Map button function states to button position states */
|
|
|
|
button_states[META_BUTTON_TYPE_LEFT_LEFT_BACKGROUND] =
|
|
|
|
button_states[META_BUTTON_TYPE_MENU];
|
|
|
|
button_states[META_BUTTON_TYPE_LEFT_MIDDLE_BACKGROUND] =
|
|
|
|
META_BUTTON_STATE_NORMAL;
|
|
|
|
button_states[META_BUTTON_TYPE_LEFT_RIGHT_BACKGROUND] =
|
|
|
|
META_BUTTON_STATE_NORMAL;
|
|
|
|
button_states[META_BUTTON_TYPE_RIGHT_LEFT_BACKGROUND] =
|
|
|
|
button_states[META_BUTTON_TYPE_MINIMIZE];
|
|
|
|
button_states[META_BUTTON_TYPE_RIGHT_MIDDLE_BACKGROUND] =
|
|
|
|
button_states[META_BUTTON_TYPE_MAXIMIZE];
|
|
|
|
button_states[META_BUTTON_TYPE_RIGHT_RIGHT_BACKGROUND] =
|
|
|
|
button_states[META_BUTTON_TYPE_CLOSE];
|
2001-06-18 02:11:53 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (display, frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
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);
|
2002-02-09 12:02:38 -05:00
|
|
|
|
|
|
|
meta_frames_ensure_layout (frames, frame);
|
2002-05-04 20:21:17 -04:00
|
|
|
|
2007-04-11 23:48:50 -04:00
|
|
|
meta_prefs_get_button_layout (&button_layout);
|
2002-05-04 20:21:17 -04:00
|
|
|
|
2010-09-17 05:16:45 -04:00
|
|
|
meta_theme_draw_frame_with_style (meta_theme_get_current (),
|
|
|
|
frame->style,
|
|
|
|
widget,
|
2010-09-23 11:35:41 -04:00
|
|
|
cr,
|
2010-09-17 05:16:45 -04:00
|
|
|
type,
|
|
|
|
flags,
|
|
|
|
w, h,
|
|
|
|
frame->layout,
|
|
|
|
frame->text_height,
|
|
|
|
&button_layout,
|
|
|
|
button_states,
|
|
|
|
mini_icon, icon);
|
2001-06-15 00:33:21 -04:00
|
|
|
}
|
|
|
|
|
2004-08-27 18:09:13 -04:00
|
|
|
static void
|
|
|
|
meta_frames_set_window_background (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame)
|
|
|
|
{
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
MetaFrameFlags flags;
|
|
|
|
MetaFrameType type;
|
2009-02-09 09:48:08 -05:00
|
|
|
MetaFrameStyle *style = NULL;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
gboolean frame_exists;
|
2004-08-27 18:09:13 -04:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_WINDOW_HAS_FRAME, &frame_exists,
|
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_FRAME_TYPE, &type,
|
|
|
|
META_CORE_GET_END);
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
|
|
|
|
if (frame_exists)
|
|
|
|
{
|
|
|
|
style = meta_theme_get_frame_style (meta_theme_get_current (),
|
|
|
|
type, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (frame_exists && style->window_background_color != NULL)
|
|
|
|
{
|
|
|
|
GdkColor color;
|
|
|
|
GdkVisual *visual;
|
|
|
|
|
|
|
|
meta_color_spec_render (style->window_background_color,
|
|
|
|
GTK_WIDGET (frames),
|
|
|
|
&color);
|
|
|
|
|
|
|
|
/* Set A in ARGB to window_background_alpha, if we have ARGB */
|
|
|
|
|
|
|
|
visual = gtk_widget_get_visual (GTK_WIDGET (frames));
|
2010-06-14 06:46:22 -04:00
|
|
|
if (gdk_visual_get_depth (visual) == 32) /* we have ARGB */
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
{
|
|
|
|
color.pixel = (color.pixel & 0xffffff) &
|
|
|
|
style->window_background_alpha << 24;
|
|
|
|
}
|
|
|
|
|
|
|
|
gdk_window_set_background (frame->window, &color);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-01-27 20:47:18 -05:00
|
|
|
gtk_style_set_background (frame->style,
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
frame->window, GTK_STATE_NORMAL);
|
|
|
|
}
|
|
|
|
}
|
2004-08-27 18:09:13 -04:00
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean
|
2001-06-15 00:33:21 -04:00
|
|
|
meta_frames_enter_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrames *frames;
|
2002-02-12 00:01:22 -05:00
|
|
|
MetaFrameControl control;
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
frames = META_FRAMES (widget);
|
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
2002-02-12 00:01:22 -05:00
|
|
|
control = get_control (frames, frame, event->x, event->y);
|
|
|
|
meta_frames_update_prelit_control (frames, frame, control);
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-07-02 21:45:43 -04:00
|
|
|
static gboolean
|
2001-06-15 00:33:21 -04:00
|
|
|
meta_frames_leave_notify_event (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
2001-06-18 02:11:53 -04:00
|
|
|
MetaUIFrame *frame;
|
2001-06-15 00:33:21 -04:00
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (widget);
|
|
|
|
|
|
|
|
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
|
|
|
|
if (frame == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
2002-02-12 00:01:22 -05:00
|
|
|
meta_frames_update_prelit_control (frames, frame, META_FRAME_CONTROL_NONE);
|
|
|
|
|
2001-07-25 23:14:45 -04:00
|
|
|
clear_tip (frames);
|
|
|
|
|
2001-06-15 00:33:21 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-06-20 00:29:28 -04:00
|
|
|
static GdkRectangle*
|
|
|
|
control_rect (MetaFrameControl control,
|
|
|
|
MetaFrameGeometry *fgeom)
|
|
|
|
{
|
|
|
|
GdkRectangle *rect;
|
|
|
|
|
|
|
|
rect = NULL;
|
|
|
|
switch (control)
|
|
|
|
{
|
|
|
|
case META_FRAME_CONTROL_TITLE:
|
|
|
|
rect = &fgeom->title_rect;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_DELETE:
|
2006-08-07 14:01:21 -04:00
|
|
|
rect = &fgeom->close_rect.visible;
|
2001-06-20 00:29:28 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MENU:
|
2006-08-07 14:01:21 -04:00
|
|
|
rect = &fgeom->menu_rect.visible;
|
2001-06-20 00:29:28 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MINIMIZE:
|
2006-08-07 14:01:21 -04:00
|
|
|
rect = &fgeom->min_rect.visible;
|
2001-06-20 00:29:28 -04:00
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_MAXIMIZE:
|
2001-09-10 23:54:54 -04:00
|
|
|
case META_FRAME_CONTROL_UNMAXIMIZE:
|
2006-08-07 14:01:21 -04:00
|
|
|
rect = &fgeom->max_rect.visible;
|
2001-06-20 00:29:28 -04:00
|
|
|
break;
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
case META_FRAME_CONTROL_SHADE:
|
|
|
|
rect = &fgeom->shade_rect.visible;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSHADE:
|
|
|
|
rect = &fgeom->unshade_rect.visible;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_ABOVE:
|
|
|
|
rect = &fgeom->above_rect.visible;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNABOVE:
|
|
|
|
rect = &fgeom->unabove_rect.visible;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_STICK:
|
|
|
|
rect = &fgeom->stick_rect.visible;
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_UNSTICK:
|
|
|
|
rect = &fgeom->unstick_rect.visible;
|
|
|
|
break;
|
2001-06-20 00:29:28 -04:00
|
|
|
case META_FRAME_CONTROL_RESIZE_SE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_S:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_SW:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_N:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NE:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_NW:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_W:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_RESIZE_E:
|
|
|
|
break;
|
|
|
|
case META_FRAME_CONTROL_NONE:
|
|
|
|
break;
|
2001-10-14 00:11:42 -04:00
|
|
|
case META_FRAME_CONTROL_CLIENT_AREA:
|
|
|
|
break;
|
2001-06-20 00:29:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return rect;
|
|
|
|
}
|
|
|
|
|
2001-06-30 19:17:52 -04:00
|
|
|
#define RESIZE_EXTENDS 15
|
2002-07-23 22:21:24 -04:00
|
|
|
#define TOP_RESIZE_HEIGHT 2
|
2001-06-20 00:29:28 -04:00
|
|
|
static MetaFrameControl
|
|
|
|
get_control (MetaFrames *frames,
|
|
|
|
MetaUIFrame *frame,
|
|
|
|
int x, int y)
|
|
|
|
{
|
|
|
|
MetaFrameGeometry fgeom;
|
2001-07-02 21:45:43 -04:00
|
|
|
MetaFrameFlags flags;
|
|
|
|
gboolean has_vert, has_horiz;
|
|
|
|
GdkRectangle client;
|
2001-06-20 00:29:28 -04:00
|
|
|
|
|
|
|
meta_frames_calc_geometry (frames, frame, &fgeom);
|
2001-07-02 21:45:43 -04:00
|
|
|
|
|
|
|
client.x = fgeom.left_width;
|
|
|
|
client.y = fgeom.top_height;
|
|
|
|
client.width = fgeom.width - fgeom.left_width - fgeom.right_width;
|
2002-12-01 20:34:27 -05:00
|
|
|
client.height = fgeom.height - fgeom.top_height - fgeom.bottom_height;
|
2001-07-02 21:45:43 -04:00
|
|
|
|
|
|
|
if (POINT_IN_RECT (x, y, client))
|
2001-10-14 00:11:42 -04:00
|
|
|
return META_FRAME_CONTROL_CLIENT_AREA;
|
2001-06-20 00:29:28 -04:00
|
|
|
|
2006-08-07 14:01:21 -04:00
|
|
|
if (POINT_IN_RECT (x, y, fgeom.close_rect.clickable))
|
2001-06-20 00:29:28 -04:00
|
|
|
return META_FRAME_CONTROL_DELETE;
|
|
|
|
|
2006-08-07 14:01:21 -04:00
|
|
|
if (POINT_IN_RECT (x, y, fgeom.min_rect.clickable))
|
2001-06-20 00:29:28 -04:00
|
|
|
return META_FRAME_CONTROL_MINIMIZE;
|
|
|
|
|
2006-08-07 14:01:21 -04:00
|
|
|
if (POINT_IN_RECT (x, y, fgeom.menu_rect.clickable))
|
2001-06-20 00:29:28 -04:00
|
|
|
return META_FRAME_CONTROL_MENU;
|
2002-12-01 20:34:27 -05:00
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
|
|
|
frame->xwindow,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
META_CORE_GET_FRAME_FLAGS, &flags,
|
|
|
|
META_CORE_GET_END);
|
2002-12-01 20:34:27 -05:00
|
|
|
|
|
|
|
has_vert = (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) != 0;
|
|
|
|
has_horiz = (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) != 0;
|
2001-06-20 00:29:28 -04:00
|
|
|
|
|
|
|
if (POINT_IN_RECT (x, y, fgeom.title_rect))
|
2002-08-20 16:18:18 -04:00
|
|
|
{
|
2002-12-01 20:34:27 -05:00
|
|
|
if (has_vert && y <= TOP_RESIZE_HEIGHT)
|
2002-08-20 16:18:18 -04:00
|
|
|
return META_FRAME_CONTROL_RESIZE_N;
|
|
|
|
else
|
|
|
|
return META_FRAME_CONTROL_TITLE;
|
|
|
|
}
|
2001-07-02 21:45:43 -04:00
|
|
|
|
2006-08-07 14:01:21 -04:00
|
|
|
if (POINT_IN_RECT (x, y, fgeom.max_rect.clickable))
|
2001-09-10 23:54:54 -04:00
|
|
|
{
|
|
|
|
if (flags & META_FRAME_MAXIMIZED)
|
|
|
|
return META_FRAME_CONTROL_UNMAXIMIZE;
|
|
|
|
else
|
|
|
|
return META_FRAME_CONTROL_MAXIMIZE;
|
|
|
|
}
|
2002-01-27 03:21:53 -05:00
|
|
|
|
Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
2006-10-07 12:56:47 -04:00
|
|
|
if (POINT_IN_RECT (x, y, fgeom.shade_rect.clickable))
|
|
|
|
{
|
|
|
|
return META_FRAME_CONTROL_SHADE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (POINT_IN_RECT (x, y, fgeom.unshade_rect.clickable))
|
|
|
|
{
|
|
|
|
return META_FRAME_CONTROL_UNSHADE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (POINT_IN_RECT (x, y, fgeom.above_rect.clickable))
|
|
|
|
{
|
|
|
|
return META_FRAME_CONTROL_ABOVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (POINT_IN_RECT (x, y, fgeom.unabove_rect.clickable))
|
|
|
|
{
|
|
|
|
return META_FRAME_CONTROL_UNABOVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (POINT_IN_RECT (x, y, fgeom.stick_rect.clickable))
|
|
|
|
{
|
|
|
|
return META_FRAME_CONTROL_STICK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (POINT_IN_RECT (x, y, fgeom.unstick_rect.clickable))
|
|
|
|
{
|
|
|
|
return META_FRAME_CONTROL_UNSTICK;
|
|
|
|
}
|
|
|
|
|
2002-12-01 20:34:27 -05:00
|
|
|
/* South resize always has priority over north resize,
|
|
|
|
* in case of overlap.
|
|
|
|
*/
|
2002-01-27 03:21:53 -05:00
|
|
|
|
2002-12-01 20:34:27 -05:00
|
|
|
if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
|
|
|
x >= (fgeom.width - fgeom.right_width - RESIZE_EXTENDS))
|
|
|
|
{
|
|
|
|
if (has_vert && has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_SE;
|
|
|
|
else if (has_vert)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_S;
|
|
|
|
else if (has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_E;
|
2001-07-02 21:45:43 -04:00
|
|
|
}
|
2002-12-01 20:34:27 -05:00
|
|
|
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
|
|
|
x <= (fgeom.left_width + RESIZE_EXTENDS))
|
|
|
|
{
|
|
|
|
if (has_vert && has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_SW;
|
|
|
|
else if (has_vert)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_S;
|
|
|
|
else if (has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_W;
|
|
|
|
}
|
|
|
|
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
|
|
|
x < RESIZE_EXTENDS)
|
|
|
|
{
|
|
|
|
if (has_vert && has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_NW;
|
|
|
|
else if (has_vert)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_N;
|
|
|
|
else if (has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_W;
|
|
|
|
}
|
|
|
|
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
|
|
|
x >= (fgeom.width - RESIZE_EXTENDS))
|
|
|
|
{
|
|
|
|
if (has_vert && has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_NE;
|
|
|
|
else if (has_vert)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_N;
|
|
|
|
else if (has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_E;
|
|
|
|
}
|
|
|
|
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS))
|
|
|
|
{
|
|
|
|
if (has_vert)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_S;
|
|
|
|
}
|
|
|
|
else if (y <= TOP_RESIZE_HEIGHT)
|
|
|
|
{
|
|
|
|
if (has_vert)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_N;
|
|
|
|
else if (has_horiz)
|
|
|
|
return META_FRAME_CONTROL_TITLE;
|
|
|
|
}
|
|
|
|
else if (x <= fgeom.left_width)
|
|
|
|
{
|
|
|
|
if (has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_W;
|
|
|
|
}
|
|
|
|
else if (x >= (fgeom.width - fgeom.right_width))
|
|
|
|
{
|
|
|
|
if (has_horiz)
|
|
|
|
return META_FRAME_CONTROL_RESIZE_E;
|
|
|
|
}
|
|
|
|
|
2006-05-19 09:15:29 -04:00
|
|
|
if (y >= fgeom.top_height)
|
2002-12-01 20:34:27 -05:00
|
|
|
return META_FRAME_CONTROL_NONE;
|
|
|
|
else
|
|
|
|
return META_FRAME_CONTROL_TITLE;
|
2001-06-20 00:29:28 -04:00
|
|
|
}
|
2001-08-18 21:19:54 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
meta_frames_push_delay_exposes (MetaFrames *frames)
|
|
|
|
{
|
2003-10-12 02:25:38 -04:00
|
|
|
if (frames->expose_delay_count == 0)
|
|
|
|
{
|
|
|
|
/* Make sure we've repainted things */
|
|
|
|
gdk_window_process_all_updates ();
|
2010-09-10 03:17:55 -04:00
|
|
|
XFlush (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
2003-10-12 02:25:38 -04:00
|
|
|
}
|
|
|
|
|
2001-08-18 21:19:54 -04:00
|
|
|
frames->expose_delay_count += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
queue_pending_exposes_func (gpointer key, gpointer value, gpointer data)
|
|
|
|
{
|
|
|
|
MetaUIFrame *frame;
|
|
|
|
MetaFrames *frames;
|
|
|
|
|
|
|
|
frames = META_FRAMES (data);
|
|
|
|
frame = value;
|
|
|
|
|
|
|
|
if (frame->expose_delayed)
|
|
|
|
{
|
2005-06-26 17:58:37 -04:00
|
|
|
invalidate_whole_window (frames, frame);
|
2001-08-18 21:19:54 -04:00
|
|
|
frame->expose_delayed = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_frames_pop_delay_exposes (MetaFrames *frames)
|
|
|
|
{
|
|
|
|
g_return_if_fail (frames->expose_delay_count > 0);
|
|
|
|
|
|
|
|
frames->expose_delay_count -= 1;
|
|
|
|
|
|
|
|
if (frames->expose_delay_count == 0)
|
|
|
|
{
|
|
|
|
g_hash_table_foreach (frames->frames,
|
|
|
|
queue_pending_exposes_func,
|
|
|
|
frames);
|
|
|
|
}
|
|
|
|
}
|
2005-06-26 17:58:37 -04:00
|
|
|
|
|
|
|
static void
|
|
|
|
invalidate_whole_window (MetaFrames *frames,
|
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
2007-06-06 23:31:17 -04:00
|
|
|
MetaUIFrame *frame)
|
2005-06-26 17:58:37 -04:00
|
|
|
{
|
|
|
|
gdk_window_invalidate_rect (frame->window, NULL, FALSE);
|
|
|
|
invalidate_cache (frames, frame);
|
|
|
|
}
|