]> git.corax.cc Git - mwm/commitdiff
monitor: Don't rearrange clients if monitor doesn't need redrawing
authorMatthias Kruk <m@m10k.eu>
Sun, 23 May 2021 21:49:56 +0000 (06:49 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 23 May 2021 21:49:56 +0000 (06:49 +0900)
The monitor_redraw() function unconditionally rearranges the visible
clients when it is called. However, if redrawing was not explicitly
requested, this is not necessary.
This commit changes the monitor_redraw() function not to rearrange
clients if a redraw is not necessary, so that only the status bar
and indicators will be redrawn.

monitor.c

index 475b75780c55ec6b6ae3fd6ac83191e837679acc..fa773e7f99a679e2db0770dbce0c9c292871b813 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -543,12 +543,9 @@ static int _redraw_statusbar(struct monitor *monitor)
 
 int monitor_redraw(struct monitor *monitor)
 {
-       monitor_arrange_clients(monitor);
-
        if(monitor->needs_redraw) {
+               monitor_arrange_clients(monitor);
                monitor_draw_clients(monitor);
-               /* monitor_draw(monitor); */
-               /* monitor_draw_bar() */
 
                monitor->needs_redraw = 0;
        }
@@ -556,8 +553,6 @@ int monitor_redraw(struct monitor *monitor)
        _redraw_statusbar(monitor);
        monitor_redraw_indicators(monitor);
 
-       XSync(mwm_get_display(monitor->mwm), False);
-
        return(0);
 }