Hello. I have a viewer of raster data written on gtkmm2. Data is arranged in tiles which are produced slowly in a separate thread, cached, and put on Gtk::DrawingArea on expose_event handler. I am trying to switch it to gtkmm3 (3.24.1) (idea of using Cairo surfaces everywhere looks very good for me!). There are two questions:
Previously, Gdk::Window::scroll method produced expose_event with only changed area (two small rectangles for small shifts). Now it invalidates the whole window. I tried also Gdk::Window::move_region with same effect. (I am getting the rectangles using Cairo::Context::copy_clip_rectangle_list. If I cover my window with another one and open a small portion, I get correct rectangles which have to be redrawn ). What is a problem with Gdk::Window::scroll()?
In my viewer I also draw some marks attached to the cursor which are updated on motion_notify_event, button_press_event, etc. Previously it was done in a natural way: I was just continue drawing on the window. I used XOR operator do draw on top of existing data and then erase marks. How can I do it with gtk3? I tried to use Gdk::Window::begin_draw_frame, obtain Gdk context, extract Cairo context from it, draw, and then do end_draw_frame. This does not work: the Cairo context does not contain old data; window is not updated after end_draw_frame, it waits until some areas will be invalidated and draw signal emitted. What is correct way to do this kind of drawing? How can I get access to the old buffer (where to get cairo context?) and how can I redraw the modified buffer on the screen without firing draw signal?