The mwm_redraw() function is called to redraw the clients as well as
the status bar and other indicators. The current implementation calls
monitor_redraw() and workspace_redraw() on all monitors and workspaces,
respectively, so these functions must make sure not to redraw anything
if it isn't necessary.
This commit changes the workspace_redraw() function so it does not
redraw the workspace if it was not explicitly requested.
return(-EINVAL);
}
- first = loop_get_iter(&workspace->clients);
+ if(workspace->needs_redraw) {
+ first = loop_get_iter(&workspace->clients);
- if(first) {
- cur = first;
+ if(first) {
+ cur = first;
- do {
- struct client *client;
+ do {
+ struct client *client;
- client = (struct client*)loop_iter_get_data(cur);
- client_redraw(client);
+ client = (struct client*)loop_iter_get_data(cur);
+ client_redraw(client);
- cur = loop_iter_get_next(cur);
- } while(cur != first);
- }
+ cur = loop_iter_get_next(cur);
+ } while(cur != first);
+ }
- workspace->needs_redraw = 0;
+ workspace->needs_redraw = 0;
+ }
return(0);
}