wscroll = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT (vadj));
+#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0)
+ eassert (gdk_window_ensure_native (gtk_widget_get_window (wscroll)));
+#endif
+
xg_finish_scroll_bar_creation (f, wscroll, bar, scroll_callback,
end_callback, scroll_bar_name);
bar->horizontal = 0;
wscroll = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (hadj));
+#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0)
+ eassert (gdk_window_ensure_native (gtk_widget_get_window (wscroll)));
+#endif
+
xg_finish_scroll_bar_creation (f, wscroll, bar, scroll_callback,
end_callback, scroll_bar_name);
bar->horizontal = 1;
block_input ();
{
-#ifdef USE_GTK
- /* Use Gdk routines to draw. This way, we won't draw over scroll bars
- when the scroll bars and the edit widget share the same X window. */
- GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
-#ifdef HAVE_GTK3
-#if GTK_CHECK_VERSION (3, 22, 0)
- cairo_region_t *region = gdk_window_get_visible_region (window);
- GdkDrawingContext *context = gdk_window_begin_draw_frame (window, region);
- cairo_t *cr = gdk_drawing_context_get_cairo_context (context);
-#else
- cairo_t *cr = gdk_cairo_create (window);
-#endif
- cairo_set_source_rgb (cr, 1, 1, 1);
- cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE);
-#define XFillRectangle(d, win, gc, x, y, w, h) \
- do { \
- cairo_rectangle (cr, x, y, w, h); \
- cairo_fill (cr); \
- } \
- while (false)
-#else /* ! HAVE_GTK3 */
- GdkGCValues vals;
- GdkGC *gc;
- vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
- ^ FRAME_BACKGROUND_PIXEL (f));
- vals.function = GDK_XOR;
- gc = gdk_gc_new_with_values (window,
- &vals, GDK_GC_FUNCTION | GDK_GC_FOREGROUND);
-#define XFillRectangle(d, win, gc, x, y, w, h) \
- gdk_draw_rectangle (window, gc, true, x, y, w, h)
-#endif /* ! HAVE_GTK3 */
-#else /* ! USE_GTK */
GC gc;
/* Create a GC that will use the GXxor function to flip foreground
gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
GCFunction | GCForeground, &values);
}
-#endif
{
/* Get the height not including a menu bar widget. */
int height = FRAME_PIXEL_HEIGHT (f);
XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
-
-#ifdef USE_GTK
-#ifdef HAVE_GTK3
-#if GTK_CHECK_VERSION (3, 22, 0)
- gdk_window_end_draw_frame (window, context);
- cairo_region_destroy (region);
-#else
- cairo_destroy (cr);
-#endif
-#else
- g_object_unref (G_OBJECT (gc));
-#endif
-#undef XFillRectangle
-#else
XFreeGC (FRAME_X_DISPLAY (f), gc);
-#endif
x_flush (f);
}
}