mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
Add debugging information for edge resistance
2006-03-16 Elijah Newren <newren gmail com> Add debugging information for edge resistance * src/edge-resistance.c (cache_edges): print out the edges that are being cached if in verbose mode, (meta_window_edge_resistance_for_move, meta_window_edge_resistance_for_resize): if edge resistance kicked in then print out a message about it * src/util.c: * src/util.h: Add META_DEBUG_EDGE_RESISTANCE to MetaDebugTopic enum list
This commit is contained in:
parent
01cd31f7f4
commit
ef47c243c5
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
||||
2006-03-16 Elijah Newren <newren gmail com>
|
||||
|
||||
Add debugging information for edge resistance
|
||||
|
||||
* src/edge-resistance.c (cache_edges): print out the edges that
|
||||
are being cached if in verbose mode,
|
||||
(meta_window_edge_resistance_for_move,
|
||||
meta_window_edge_resistance_for_resize): if edge resistance kicked
|
||||
in then print out a message about it
|
||||
|
||||
* src/util.c:
|
||||
* src/util.h:
|
||||
Add META_DEBUG_EDGE_RESISTANCE to MetaDebugTopic enum list
|
||||
|
||||
Thu Mar 16 14:55:18 2006 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* src/c-screen.c (struct WindowInfo): Maintain the size of the
|
||||
|
@ -746,6 +746,31 @@ cache_edges (MetaDisplay *display,
|
||||
int num_left, num_right, num_top, num_bottom;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* 0th: Print debugging information to the log about the edges
|
||||
*/
|
||||
#ifdef WITH_VERBOSE_MODE
|
||||
if (meta_is_verbose())
|
||||
{
|
||||
int max_edges = MAX (MAX( g_list_length (window_edges),
|
||||
g_list_length (xinerama_edges)),
|
||||
g_list_length (screen_edges));
|
||||
char big_buffer[(EDGE_LENGTH+2)*max_edges];
|
||||
|
||||
meta_rectangle_edge_list_to_string (window_edges, ", ", big_buffer);
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"Window edges for resistance : %s\n", big_buffer);
|
||||
|
||||
meta_rectangle_edge_list_to_string (xinerama_edges, ", ", big_buffer);
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"Xinerama edges for resistance: %s\n", big_buffer);
|
||||
|
||||
meta_rectangle_edge_list_to_string (screen_edges, ", ", big_buffer);
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"Screen edges for resistance : %s\n", big_buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 1st: Get the total number of each kind of edge
|
||||
*/
|
||||
@ -1163,6 +1188,12 @@ meta_window_edge_resistance_for_move (MetaWindow *window,
|
||||
(BOX_LEFT (*reference) - BOX_LEFT (old_outer));
|
||||
*new_y = old_y + smaller_y_change +
|
||||
(BOX_TOP (*reference) - BOX_TOP (old_outer));
|
||||
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"outer x & y move-to coordinate changed from %d,%d to %d,%d\n",
|
||||
proposed_outer.x, proposed_outer.y,
|
||||
old_outer.x + (*new_x - old_x),
|
||||
old_outer.y + (*new_y - old_y));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1181,7 +1212,7 @@ meta_window_edge_resistance_for_resize (MetaWindow *window,
|
||||
gboolean is_keyboard_op)
|
||||
{
|
||||
MetaRectangle old_outer, new_outer;
|
||||
int new_outer_width, new_outer_height;
|
||||
int proposed_outer_width, proposed_outer_height;
|
||||
|
||||
if (window == window->display->grab_window &&
|
||||
window->display->grab_wireframe_active)
|
||||
@ -1194,13 +1225,13 @@ meta_window_edge_resistance_for_resize (MetaWindow *window,
|
||||
{
|
||||
meta_window_get_outer_rect (window, &old_outer);
|
||||
}
|
||||
new_outer_width = old_outer.width + (*new_width - old_width);
|
||||
new_outer_height = old_outer.height + (*new_height - old_height);
|
||||
proposed_outer_width = old_outer.width + (*new_width - old_width);
|
||||
proposed_outer_height = old_outer.height + (*new_height - old_height);
|
||||
meta_rectangle_resize_with_gravity (&old_outer,
|
||||
&new_outer,
|
||||
gravity,
|
||||
new_outer_width,
|
||||
new_outer_height);
|
||||
proposed_outer_width,
|
||||
proposed_outer_height);
|
||||
|
||||
window->display->grab_last_user_action_was_snap = snap;
|
||||
if (apply_edge_resistance_to_each_side (window->display,
|
||||
@ -1213,5 +1244,10 @@ meta_window_edge_resistance_for_resize (MetaWindow *window,
|
||||
{
|
||||
*new_width = old_width + (new_outer.width - old_outer.width);
|
||||
*new_height = old_height + (new_outer.height - old_outer.height);
|
||||
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"outer width & height got changed from %d,%d to %d,%d\n",
|
||||
proposed_outer_width, proposed_outer_height,
|
||||
new_outer.width, new_outer.height);
|
||||
}
|
||||
}
|
||||
|
@ -303,6 +303,8 @@ topic_name (MetaDebugTopic topic)
|
||||
return "SHAPES";
|
||||
case META_DEBUG_COMPOSITOR:
|
||||
return "COMPOSITOR";
|
||||
case META_DEBUG_EDGE_RESISTANCE:
|
||||
return "EDGE_RESISTANCE";
|
||||
}
|
||||
|
||||
return "WM";
|
||||
|
@ -68,8 +68,8 @@ typedef enum
|
||||
META_DEBUG_GROUPS = 1 << 17,
|
||||
META_DEBUG_RESIZING = 1 << 18,
|
||||
META_DEBUG_SHAPES = 1 << 19,
|
||||
META_DEBUG_COMPOSITOR = 1 << 20
|
||||
|
||||
META_DEBUG_COMPOSITOR = 1 << 20,
|
||||
META_DEBUG_EDGE_RESISTANCE = 1 << 21
|
||||
} MetaDebugTopic;
|
||||
|
||||
void meta_topic_real (MetaDebugTopic topic,
|
||||
|
Loading…
Reference in New Issue
Block a user