summaryrefslogtreecommitdiff
path: root/src/monmon.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2026-05-29 11:23:54 +0200
committerJoel Klinghed <the_jk@opera.com>2026-05-29 11:23:54 +0200
commit7efff8c560aa0c4a834201da48f53e709519c14b (patch)
treef5f64a35eae4d9f4bcfee1f421b70d869b55b970 /src/monmon.hh
parenta6ac90c83edbade279cccfdb6d8ca02d8e5a60b8 (diff)
Improve redraw
Diffstat (limited to 'src/monmon.hh')
-rw-r--r--src/monmon.hh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/monmon.hh b/src/monmon.hh
index 0699f57..c02cae6 100644
--- a/src/monmon.hh
+++ b/src/monmon.hh
@@ -3,6 +3,7 @@
#include <memory>
#include <mutex>
+#include <vector>
#include "animator.hh"
#include "cairo.hh"
@@ -63,13 +64,24 @@ protected:
virtual void internal_quit() {
}
+ virtual void mark_all_dirty() {
+ }
+
virtual void draw_content(cairo_t* cairo, PangoLayout* layout,
- uint16_t w, uint16_t h) = 0;
+ uint16_t w, uint16_t h,
+ std::vector<xcb_rectangle_t>& dirty) = 0;
static void rounded_path(cairo_t* cr, double x, double y,
double width, double height);
void draw();
+ void request_draw();
+
+ // Clone the base layout (font, alignment, ellipsize) for per-item use
+ pango::unique_layout make_layout() const;
+
+ // Fill the background (desktop or black) for a given rectangle on the cairo surface
+ void fill_background(cairo_t* cairo, xcb_rectangle_t const& r);
std::shared_ptr<PollLooper> looper_;
std::unique_ptr<Animator> animator_;
@@ -109,6 +121,7 @@ private:
xcb_window_t desktop_window_;
xcb_pixmap_t desktop_pixmap_;
cairo::unique_surface desktop_surface_;
+ bool draw_requested_;
};