desktop-shell: Set 1x1 buffers for solid-color backgrounds
authorHarish Krupo <harish.krupo.kps@intel.com>
Tue, 11 Dec 2018 08:29:07 +0000 (13:59 +0530)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 25 Nov 2019 21:54:40 +0000 (21:54 +0000)
When we are going to set a solid color for the background, use
a 1x1 buffer and set the viewport to the full size. This avoids
un-necessary allocation of buffer memory.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
clients/desktop-shell.c

index efadb49cf8032905b3374abd7f0c71d34c5a4551..1d75ad1c818f49aa96e6383c9f632fe57dfbf6a2 100644 (file)
@@ -849,6 +849,12 @@ background_configure(void *data,
                return;
        }
 
+       if (!background->image) {
+               widget_set_viewport_destination(background->widget, width, height);
+               width = 1;
+               height = 1;
+       }
+
        widget_schedule_resize(background->widget, width, height);
 }