}
#endif
+#if defined HAVE_GTK3 && !defined HAVE_PGTK
+static void
+xg_scroll_bar_size_allocate_cb (GtkWidget *widget,
+ GdkRectangle *allocation,
+ gpointer user_data)
+{
+ GdkEvent *event = gtk_get_current_event ();
+ GdkEvent dummy;
+
+ if (event && event->any.type == GDK_CONFIGURE)
+ x_scroll_bar_configure (event);
+ else
+ {
+ /* These are the only fields used by x_scroll_bar_configure. */
+ dummy.configure.send_event = FALSE;
+ dummy.configure.x = allocation->x;
+ dummy.configure.y = allocation->y;
+ dummy.configure.width = allocation->width;
+ dummy.configure.height = allocation->height;
+ dummy.configure.window = gtk_widget_get_window (widget);
+
+ x_scroll_bar_configure (&dummy);
+ }
+}
+#endif
+
static void
xg_finish_scroll_bar_creation (struct frame *f,
GtkWidget *wscroll,
#ifndef HAVE_GTK3
gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS);
#endif
- g_object_set_data (G_OBJECT (wscroll), XG_FRAME_DATA, (gpointer)f);
+ g_object_set_data (G_OBJECT (wscroll), XG_FRAME_DATA, (gpointer) f);
+
+#if defined HAVE_GTK3 && !defined HAVE_PGTK
+ g_signal_connect (G_OBJECT (webox), "size-allocate",
+ G_CALLBACK (xg_scroll_bar_size_allocate_cb),
+ NULL);
+#endif
#if defined HAVE_PGTK || !defined HAVE_GTK3
ptrdiff_t scroll_id = xg_store_widget_in_map (wscroll);
gtk_widget_show_all (webox);
#elif defined HAVE_GTK3
bar->x_window = GTK_WIDGET_TO_X_WIN (webox);
+ gtk_widget_show_all (webox);
#else
GTK_WIDGET_TO_X_WIN (webox);
#endif
#ifndef HAVE_PGTK
gtk_widget_add_events (webox, GDK_STRUCTURE_MASK);
+ gtk_widget_set_double_buffered (wscroll, FALSE);
#endif
#endif
{
GtkWidget *wfixed = f->output_data.xp->edit_widget;
GtkWidget *wparent = gtk_widget_get_parent (wscroll);
+#if !defined HAVE_PGTK && defined HAVE_GTK3
+ GdkWindow *wdesc = gtk_widget_get_window (wparent);
+#endif
gint msl;
int scale = xg_get_scale (f);
{
gtk_widget_show_all (wparent);
gtk_widget_set_size_request (wscroll, width, height);
+
+#if !defined HAVE_PGTK && defined HAVE_GTK3
+ if (wdesc)
+ {
+ gdk_window_move_resize (wdesc, left, top, width, height);
+ gtk_widget_queue_allocate (wparent);
+ }
+#endif
}
if (oldx != -1 && oldw > 0 && oldh > 0)
{
GtkWidget *wfixed = f->output_data.xp->edit_widget;
GtkWidget *wparent = gtk_widget_get_parent (wscroll);
+#if !defined HAVE_PGTK && defined HAVE_GTK3
+ GdkWindow *wdesc = gtk_widget_get_window (wparent);
+#endif
gint msl;
int scale = xg_get_scale (f);
{
gtk_widget_show_all (wparent);
gtk_widget_set_size_request (wscroll, width, height);
+
+#if !defined HAVE_PGTK && defined HAVE_GTK3
+ if (wdesc)
+ {
+ gdk_window_move_resize (wdesc, left, top, width, height);
+ gtk_widget_queue_allocate (wparent);
+ }
+#endif
}
if (oldx != -1 && oldw > 0 && oldh > 0)
/* Clear under old scroll bar position. */
unblock_input ();
}
+#ifdef HAVE_GTK3
+void
+x_scroll_bar_configure (GdkEvent *event)
+{
+ XEvent configure;
+ GdkDisplay *gdpy;
+ Display *dpy;
+
+ configure.xconfigure.type = ConfigureNotify;
+ configure.xconfigure.serial = 0;
+ configure.xconfigure.send_event = event->configure.send_event;
+ configure.xconfigure.x = event->configure.x;
+ configure.xconfigure.y = event->configure.y;
+ configure.xconfigure.width = event->configure.width;
+ configure.xconfigure.height = event->configure.height;
+ configure.xconfigure.border_width = 0;
+ configure.xconfigure.event = GDK_WINDOW_XID (event->configure.window);
+ configure.xconfigure.window = GDK_WINDOW_XID (event->configure.window);
+ configure.xconfigure.above = None;
+ configure.xconfigure.override_redirect = False;
+
+ gdpy = gdk_window_get_display (event->configure.window);
+ dpy = gdk_x11_display_get_xdisplay (gdpy);
+
+ x_dispatch_event (&configure, dpy);
+}
+#endif
+
/**
mouse_or_wdesc_frame: When not dropping and the mouse was grabbed
for DPYINFO, return the frame where the mouse was seen last. If
if (configureEvent.xconfigure.width != max (bar->width, 1)
|| configureEvent.xconfigure.height != max (bar->height, 1))
- XResizeWindow (dpyinfo->display, bar->x_window,
- max (bar->width, 1), max (bar->height, 1));
+ {
+ XResizeWindow (dpyinfo->display, bar->x_window,
+ max (bar->width, 1), max (bar->height, 1));
+ x_flush (WINDOW_XFRAME (XWINDOW (bar->window)));
+ }
if (f && FRAME_X_DOUBLE_BUFFERED_P (f))
x_drop_xrender_surfaces (f);