summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorThomas Fitzsimmons <fitzsim@redhat.com>2004-01-10 17:16:07 +0000
committerRob Adams <readams@src.gnome.org>2004-01-10 17:16:07 +0000
commita605da04c161ecace7ed1112ac140efc52127ff6 (patch)
tree3362dba1ec903e252275e46927d2ee3dd032d0e3 /src/ui.c
parentcc7195547a74953c206d93fbfa25f6a49aaae5bb (diff)
downloadmetacity-a605da04c161ecace7ed1112ac140efc52127ff6.tar.gz
Add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS.
2004-01-09 Thomas Fitzsimmons <fitzsim@redhat.com> Add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS. * src/display.c: include xprops.h (process_request_frame_extents): new function (meta_display_open): add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS atoms (event_callback): handle frame extents message * src/display.h (struct _MetaDisplay): add atom_net_frame_extents and atom_net_request_frame_extents * src/theme.c (meta_pango_font_desc_get_text_height): make font_desc parameter const * src/ui.c: include prefs.h (meta_ui_theme_get_frame_borders): new function * src/window.c (update_net_frame_extents): new function (meta_window_move_resize_internal): update frame extents property when frame geometry changes * src/screen.c (set_supported_hint): add atom_net_frame_extents and atom_net_request_frame_extents
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/ui.c b/src/ui.c
index 76fb958a..c8486c5d 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -21,6 +21,7 @@
*/
#include <config.h>
+#include "prefs.h"
#include "ui.h"
#include "frames.h"
#include "util.h"
@@ -685,6 +686,44 @@ meta_text_property_to_utf8 (Display *xdisplay,
}
void
+meta_ui_theme_get_frame_borders (MetaUI *ui,
+ MetaFrameType type,
+ MetaFrameFlags flags,
+ int *top_height,
+ int *bottom_height,
+ int *left_width,
+ int *right_width)
+{
+ int text_height;
+ PangoContext *context;
+ const PangoFontDescription *font_desc;
+ GtkStyle *default_style;
+
+ if (meta_ui_have_a_theme ())
+ {
+ context = gtk_widget_get_pango_context (GTK_WIDGET (ui->frames));
+ font_desc = meta_prefs_get_titlebar_font ();
+
+ if (!font_desc)
+ {
+ default_style = gtk_widget_get_default_style ();
+ font_desc = default_style->font_desc;
+ }
+
+ text_height = meta_pango_font_desc_get_text_height (font_desc, context);
+
+ meta_theme_get_frame_borders (meta_theme_get_current (),
+ type, text_height, flags,
+ top_height, bottom_height,
+ left_width, right_width);
+ }
+ else
+ {
+ *top_height = *bottom_height = *left_width = *right_width = 0;
+ }
+}
+
+void
meta_ui_set_current_theme (const char *name,
gboolean force_reload)
{