optimization: when moving floating windows, render/push only the floatingcon
This commit is contained in:
parent
d8bf633e56
commit
21c7a69812
|
@ -60,6 +60,14 @@ void x_window_kill(xcb_window_t window);
|
||||||
*/
|
*/
|
||||||
void x_draw_decoration(Con *con);
|
void x_draw_decoration(Con *con);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function pushes the properties of each node of the layout tree to
|
||||||
|
* X11 if they have changed (like the map state, position of the window, …).
|
||||||
|
* It recursively traverses all children of the given node.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void x_push_node(Con *con, bool skip_decoration);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pushes all changes (state of each node, see x_push_node() and the window
|
* Pushes all changes (state of each node, see x_push_node() and the window
|
||||||
* stack) to X11.
|
* stack) to X11.
|
||||||
|
|
|
@ -231,10 +231,10 @@ DRAGGING_CB(drag_window_callback) {
|
||||||
/* Reposition the client correctly while moving */
|
/* Reposition the client correctly while moving */
|
||||||
con->rect.x = old_rect->x + (new_x - event->root_x);
|
con->rect.x = old_rect->x + (new_x - event->root_x);
|
||||||
con->rect.y = old_rect->y + (new_y - event->root_y);
|
con->rect.y = old_rect->y + (new_y - event->root_y);
|
||||||
/* TODO: don’t re-render the whole tree just because we change
|
|
||||||
* coordinates of a floating window */
|
render_con(con, false);
|
||||||
tree_render();
|
x_push_node(con, true);
|
||||||
x_push_changes(croot);
|
xcb_flush(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
10
src/x.c
10
src/x.c
|
@ -442,7 +442,7 @@ copy_pixmaps:
|
||||||
* It recursively traverses all children of the given node.
|
* It recursively traverses all children of the given node.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void x_push_node(Con *con) {
|
void x_push_node(Con *con, bool skip_decoration) {
|
||||||
Con *current;
|
Con *current;
|
||||||
con_state *state;
|
con_state *state;
|
||||||
Rect rect = con->rect;
|
Rect rect = con->rect;
|
||||||
|
@ -582,9 +582,11 @@ static void x_push_node(Con *con) {
|
||||||
* in focus order to display the focused client in a stack first when
|
* in focus order to display the focused client in a stack first when
|
||||||
* switching workspaces (reduces flickering). */
|
* switching workspaces (reduces flickering). */
|
||||||
TAILQ_FOREACH(current, &(con->focus_head), focused)
|
TAILQ_FOREACH(current, &(con->focus_head), focused)
|
||||||
x_push_node(current);
|
x_push_node(current, skip_decoration);
|
||||||
|
|
||||||
if (con->type != CT_ROOT && con->type != CT_OUTPUT && con->mapped)
|
if (!skip_decoration &&
|
||||||
|
(con->type != CT_ROOT && con->type != CT_OUTPUT) &&
|
||||||
|
con->mapped)
|
||||||
x_draw_decoration(con);
|
x_draw_decoration(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,7 +689,7 @@ void x_push_changes(Con *con) {
|
||||||
DLOG("Done, EnterNotify re-enabled\n");
|
DLOG("Done, EnterNotify re-enabled\n");
|
||||||
|
|
||||||
DLOG("\n\n PUSHING CHANGES\n\n");
|
DLOG("\n\n PUSHING CHANGES\n\n");
|
||||||
x_push_node(con);
|
x_push_node(con, false);
|
||||||
|
|
||||||
xcb_window_t to_focus = focused->frame;
|
xcb_window_t to_focus = focused->frame;
|
||||||
if (focused->window != NULL)
|
if (focused->window != NULL)
|
||||||
|
|
Loading…
Reference in New Issue