CtrlCore: Caret fixed in GTK mode for older GTK versions

git-svn-id: svn://ultimatepp.org/upp/trunk@6863 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-02-04 07:43:13 +00:00
parent 5929a13660
commit da1000cb15
4 changed files with 6 additions and 5 deletions

View file

@ -71,7 +71,7 @@ public:
bool CanSetSurface() { return true; }
static void Flush() {} // TODO?
SystemDraw(cairo_t *cr, GdkDrawable *dw = NULL) : cr(cr), drawable(dw) {}
SystemDraw(cairo_t *cr, GdkDrawable *dw/* = NULL*/) : cr(cr), drawable(dw) {}
};
class ImageDraw : public SystemDraw {

View file

@ -126,9 +126,10 @@ void SystemDraw::DrawRectOp(int x, int y, int cx, int cy, Color color)
if(drawable) {
GdkGC *gc = gdk_gc_new(drawable);
gdk_gc_set_function(gc, GDK_INVERT);
gdk_draw_drawable(drawable, gc, drawable, x, y, x, y, cx, cy);
Point o = GetOffset();
gdk_draw_drawable(drawable, gc, drawable, x + o.x, y + o.y, x + o.x, y + o.y, cx, cy);
gdk_gc_set_function(gc, GDK_COPY);
gdk_gc_destroy(drawable);
gdk_gc_destroy(gc);
}
#endif
}

View file

@ -103,7 +103,7 @@ gboolean Ctrl::GtkEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data)
#endif
p->fullrefresh = false;
GdkEventExpose *e = (GdkEventExpose *)event;
SystemDraw w(gdk_cairo_create(p->gdk()));
SystemDraw w(gdk_cairo_create(p->gdk()), p->gdk());
painting = true;
Rect r = RectC(e->area.x, e->area.y, e->area.width, e->area.height);
w.Clip(r);

View file

@ -144,7 +144,7 @@ Image GetGTK(GtkWidget *widget, int state, int shadow, const char *detail, int t
#ifdef GUI_GTK
GdkPixmap *pixmap = gdk_pixmap_new(gdk_get_default_root_window(), isz.cx, isz.cy, -1);
cairo_t *cairo = gdk_cairo_create(pixmap);
SystemDraw sw(cairo);
SystemDraw sw(cairo, NULL);
sw.DrawRect(isz, back);
cairo_destroy(cairo);
#else