mirror of
https://github.com/brl/mutter.git
synced 2025-08-04 15:45:54 +00:00
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
This commit is contained in:

committed by
Rob Adams

parent
cc7195547a
commit
a605da04c1
39
src/ui.c
39
src/ui.c
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "prefs.h"
|
||||
#include "ui.h"
|
||||
#include "frames.h"
|
||||
#include "util.h"
|
||||
@@ -684,6 +685,44 @@ meta_text_property_to_utf8 (Display *xdisplay,
|
||||
return retval;
|
||||
}
|
||||
|
||||
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)
|
||||
|
Reference in New Issue
Block a user