- WXPixmap new_mask = NULL;
-#if 0
- if (!m_currentClippingRegion.IsNull())
- {
- GdkColor col;
- new_mask = gdk_pixmap_new( wxGetRootWindow()->window, ww, hh, 1 );
- GdkGC *gc = gdk_gc_new( new_mask );
- col.pixel = 0;
- gdk_gc_set_foreground( gc, &col );
- gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, ww, hh );
- col.pixel = 0;
- gdk_gc_set_background( gc, &col );
- col.pixel = 1;
- gdk_gc_set_foreground( gc, &col );
- gdk_gc_set_clip_region( gc, m_currentClippingRegion.GetRegion() );
- gdk_gc_set_clip_origin( gc, -xx, -yy );
- gdk_gc_set_fill( gc, GDK_OPAQUE_STIPPLED );
- gdk_gc_set_stipple( gc, mask );
- gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, ww, hh );
- gdk_gc_unref( gc );
- }
-#endif
- if (is_mono)
- {
- if (new_mask)
- XSetClipMask( (Display*) m_display, (GC) m_textGC, (Pixmap) new_mask );
- else
- XSetClipMask( (Display*) m_display, (GC) m_textGC, (Pixmap) mask );
- XSetClipOrigin( (Display*) m_display, (GC) m_textGC, xx, yy );
- }
- else
+ // clipping necessary => create new_pixmap
+ Display *xdisplay = (Display*) m_display;
+ int xscreen = DefaultScreen( xdisplay );
+ Window xroot = RootWindow( xdisplay, xscreen );
+
+ new_pixmap = XCreatePixmap( xdisplay, xroot, ww, hh, 1 );
+ GC gc = XCreateGC( xdisplay, new_pixmap, 0, NULL );
+
+ XSetForeground( xdisplay, gc, BlackPixel(xdisplay,xscreen) );
+
+ XSetFillStyle( xdisplay, gc, FillSolid );
+ XFillRectangle( xdisplay, new_pixmap, gc, 0, 0, ww, hh );
+
+ XSetForeground( xdisplay, gc, WhitePixel(xdisplay,xscreen) );
+
+ if (useMask && mask)