summaryrefslogtreecommitdiff
path: root/src/frames.c
diff options
context:
space:
mode:
authorJayaraj Rajappan <jayaraj.rajappan@wipro.com>2002-05-24 02:55:54 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-05-24 02:55:54 +0000
commit49fe8f03990133cbbaef9033ed25cb52936886f9 (patch)
tree3b7bc6bbf99fc740e54887abedae6a062730d665 /src/frames.c
parent4e9ac83b1526b76b8ea38d672d4738928bf74ec5 (diff)
downloadmetacity-49fe8f03990133cbbaef9033ed25cb52936886f9.tar.gz
metacity-49fe8f03990133cbbaef9033ed25cb52936886f9.tar.bz2
fix for bugzilla bug #72314, filter out LeaveNotify caused by grabs when
2002-05-23 Jayaraj Rajappan <jayaraj.rajappan@wipro.com> * src/display.c (event_callback): fix for bugzilla bug #72314, filter out LeaveNotify caused by grabs when in mouse focus mode.
Diffstat (limited to 'src/frames.c')
-rw-r--r--src/frames.c60
1 files changed, 34 insertions, 26 deletions
diff --git a/src/frames.c b/src/frames.c
index 7ab3380..d699d81 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -26,6 +26,7 @@
#include "menu.h"
#include "fixedtip.h"
#include "theme.h"
+#include "prefs.h"
#define DEFAULT_INNER_BUTTON_BORDER 3
@@ -68,6 +69,7 @@ static void meta_frames_ensure_layout (MetaFrames *frames,
static MetaUIFrame* meta_frames_lookup_window (MetaFrames *frames,
Window xwindow);
+static void meta_frames_font_changed (MetaFrames *frames);
static GdkRectangle* control_rect (MetaFrameControl control,
MetaFrameGeometry *fgeom);
@@ -155,6 +157,16 @@ unsigned_long_hash (gconstpointer v)
}
static void
+font_changed_callback (MetaPreference pref,
+ void *data)
+{
+ if (pref == META_PREF_TITLEBAR_FONT)
+ {
+ meta_frames_font_changed (META_FRAMES (data));
+ }
+}
+
+static void
meta_frames_init (MetaFrames *frames)
{
GTK_WINDOW (frames)->type = GTK_WINDOW_POPUP;
@@ -168,6 +180,8 @@ meta_frames_init (MetaFrames *frames)
frames->expose_delay_count = 0;
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
+
+ meta_prefs_add_listener (font_changed_callback, frames);
}
static void
@@ -188,6 +202,8 @@ meta_frames_destroy (GtkObject *object)
frames = META_FRAMES (object);
+ meta_prefs_remove_listener (font_changed_callback, frames);
+
clear_tip (frames);
winlist = NULL;
@@ -258,13 +274,8 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data)
}
static void
-meta_frames_style_set (GtkWidget *widget,
- GtkStyle *prev_style)
+meta_frames_font_changed (MetaFrames *frames)
{
- MetaFrames *frames;
-
- frames = META_FRAMES (widget);
-
if (g_hash_table_size (frames->text_heights) > 0)
{
g_hash_table_destroy (frames->text_heights);
@@ -275,6 +286,18 @@ meta_frames_style_set (GtkWidget *widget,
g_hash_table_foreach (frames->frames,
queue_recalc_func, frames);
+}
+
+static void
+meta_frames_style_set (GtkWidget *widget,
+ GtkStyle *prev_style)
+{
+ MetaFrames *frames;
+
+ frames = META_FRAMES (widget);
+
+ meta_frames_font_changed (frames);
+
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
}
@@ -326,7 +349,8 @@ meta_frames_ensure_layout (MetaFrames *frames,
frame->layout = gtk_widget_create_pango_layout (widget, frame->title);
- font_desc = meta_gtk_widget_get_font_desc (widget, scale);
+ font_desc = meta_gtk_widget_get_font_desc (widget, scale,
+ meta_prefs_get_titlebar_font ());
size = pango_font_description_get_size (font_desc);
@@ -346,25 +370,9 @@ meta_frames_ensure_layout (MetaFrames *frames,
&size,
GINT_TO_POINTER (frame->text_height));
}
-
- if (pango_font_description_get_size (font_desc) !=
- pango_font_description_get_size (widget->style->font_desc))
- {
- PangoAttrList *attrs;
- PangoAttribute *attr;
-
- attrs = pango_attr_list_new ();
-
- attr = pango_attr_size_new (pango_font_description_get_size (font_desc));
- attr->start_index = 0;
- attr->end_index = G_MAXINT;
-
- pango_attr_list_insert (attrs, attr);
-
- pango_layout_set_attributes (frame->layout, attrs);
-
- pango_attr_list_unref (attrs);
- }
+
+ pango_layout_set_font_description (frame->layout,
+ font_desc);
pango_font_description_free (font_desc);