diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2015-01-01 11:47:03 -0800 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2015-01-01 11:48:55 -0800 |
commit | 7e66d2a484e4b29a6782c4c4431a0b47e7df2096 (patch) | |
tree | 54ff13a709b7312dc481b23958b3e0f7e047fd0d /src/ui/frames.c | |
parent | 12135afa5e2016e6234d24dcfecdaa293576719a (diff) | |
download | mutter-7e66d2a484e4b29a6782c4c4431a0b47e7df2096.tar.gz |
frames: Punch down META_CORE_GET_FRAME_FLAGS / TYPE
These can be fetched directly off of the MetaWindow.
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r-- | src/ui/frames.c | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c index a0edac442..4f2d922e8 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -32,6 +32,9 @@ #include <meta/prefs.h> #include "ui.h" +#include "core/window-private.h" +#include "core/frame.h" + #include <cairo-xlib.h> #define DEFAULT_INNER_BUTTON_BORDER 3 @@ -437,10 +440,11 @@ meta_ui_frame_calc_geometry (MetaUIFrame *frame, meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow, META_CORE_GET_CLIENT_WIDTH, &width, META_CORE_GET_CLIENT_HEIGHT, &height, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_FRAME_TYPE, &type, META_CORE_GET_END); + flags = meta_frame_get_flags (frame->meta_window->frame); + type = meta_window_get_window_type (frame->meta_window); + meta_ui_frame_ensure_layout (frame, type); meta_prefs_get_button_layout (&button_layout); @@ -580,10 +584,8 @@ meta_ui_frame_get_borders (MetaUIFrame *frame, MetaFrameFlags flags; MetaFrameType type; - meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_FRAME_TYPE, &type, - META_CORE_GET_END); + flags = meta_frame_get_flags (frame->meta_window->frame); + type = meta_window_get_window_type (frame->meta_window); g_return_if_fail (type < META_FRAME_TYPE_LAST); @@ -808,14 +810,12 @@ meta_frame_titlebar_event (MetaUIFrame *frame, display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); + flags = meta_frame_get_flags (frame->meta_window->frame); + switch (action) { case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_SHADE: { - meta_core_get (display, frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_END); - if (flags & META_FRAME_ALLOWS_SHADE) { if (flags & META_FRAME_SHADED) @@ -832,10 +832,6 @@ meta_frame_titlebar_event (MetaUIFrame *frame, case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE: { - meta_core_get (display, frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_END); - if (flags & META_FRAME_ALLOWS_MAXIMIZE) { meta_core_toggle_maximize (display, frame->xwindow); @@ -845,10 +841,6 @@ meta_frame_titlebar_event (MetaUIFrame *frame, case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE_HORIZONTALLY: { - meta_core_get (display, frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_END); - if (flags & META_FRAME_ALLOWS_MAXIMIZE) { meta_core_toggle_maximize_horizontally (display, frame->xwindow); @@ -858,10 +850,6 @@ meta_frame_titlebar_event (MetaUIFrame *frame, case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE_VERTICALLY: { - meta_core_get (display, frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_END); - if (flags & META_FRAME_ALLOWS_MAXIMIZE) { meta_core_toggle_maximize_vertically (display, frame->xwindow); @@ -871,10 +859,6 @@ meta_frame_titlebar_event (MetaUIFrame *frame, case G_DESKTOP_TITLEBAR_ACTION_MINIMIZE: { - meta_core_get (display, frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_END); - if (flags & META_FRAME_ALLOWS_MINIMIZE) { meta_core_minimize (display, frame->xwindow); @@ -1156,11 +1140,7 @@ meta_frames_button_press_event (GtkWidget *widget, else if (control == META_FRAME_CONTROL_TITLE && event->button == 1) { - MetaFrameFlags flags; - - meta_core_get (display, frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_END); + MetaFrameFlags flags = meta_frame_get_flags (frame->meta_window->frame); if (flags & META_FRAME_ALLOWS_MOVE) { @@ -1436,11 +1416,12 @@ get_visible_frame_border_region (MetaUIFrame *frame) 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_FRAME_RECT, &frame_rect, META_CORE_GET_END); + flags = meta_frame_get_flags (frame->meta_window->frame); + type = meta_window_get_window_type (frame->meta_window); + meta_theme_get_frame_borders (meta_theme_get_default (), frame->style_info, type, frame->text_height, flags, &borders); @@ -1494,10 +1475,11 @@ meta_ui_frame_get_mask (MetaUIFrame *frame, meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, META_CORE_GET_FRAME_RECT, &frame_rect, META_CORE_GET_END); + flags = meta_frame_get_flags (frame->meta_window->frame); + meta_style_info_set_flags (frame->style_info, flags); meta_ui_frame_get_borders (frame, &borders); gtk_render_background (frame->style_info->styles[META_STYLE_ELEMENT_FRAME], cr, @@ -1612,13 +1594,14 @@ meta_ui_frame_paint (MetaUIFrame *frame, button_states[button_type] = frame->button_state; meta_core_get (display, frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_FRAME_TYPE, &type, META_CORE_GET_MINI_ICON, &mini_icon, META_CORE_GET_CLIENT_WIDTH, &w, META_CORE_GET_CLIENT_HEIGHT, &h, META_CORE_GET_END); + flags = meta_frame_get_flags (frame->meta_window->frame); + type = meta_window_get_window_type (frame->meta_window); + meta_ui_frame_ensure_layout (frame, type); meta_prefs_get_button_layout (&button_layout); @@ -1791,11 +1774,8 @@ get_control (MetaUIFrame *frame, int x, int y) if (POINT_IN_RECT (x, y, fgeom.appmenu_rect.clickable)) return META_FRAME_CONTROL_APPMENU; - meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), - frame->xwindow, - META_CORE_GET_FRAME_FLAGS, &flags, - META_CORE_GET_FRAME_TYPE, &type, - META_CORE_GET_END); + flags = meta_frame_get_flags (frame->meta_window->frame); + type = meta_window_get_window_type (frame->meta_window); has_north_resize = (type != META_FRAME_TYPE_ATTACHED); has_vert = (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) != 0; |