aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2004-05-03 15:27:48 +0000
committerJan Djärv2004-05-03 15:27:48 +0000
commitab2d724b88a1bb120cf6ea2664f1af1ad31c4457 (patch)
tree36958ef140f599bbe2c441ba4c9585941413a1b2 /src
parentef2887a290f52844163e33662d7c0180d2b3cbbe (diff)
downloademacs-ab2d724b88a1bb120cf6ea2664f1af1ad31c4457.tar.gz
emacs-ab2d724b88a1bb120cf6ea2664f1af1ad31c4457.zip
* gtkutil.c (xg_update_scrollbar_pos): Call XClearWindow to clear
"under" scroll bar when size/position changes.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/gtkutil.c73
2 files changed, 13 insertions, 65 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 07a247e2fd9..f3aa96bb1e5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12004-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (xg_update_scrollbar_pos): Call XClearWindow to clear
4 "under" scroll bar when size/position changes.
5
12004-05-03 Jason Rumney <jasonr@gnu.org> 62004-05-03 Jason Rumney <jasonr@gnu.org>
2 7
3 * makefile.nt: Remove. 8 * makefile.nt: Remove.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4d0b50573f7..82d5135d2bc 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2760,18 +2760,16 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height,
2760 if (wscroll) 2760 if (wscroll)
2761 { 2761 {
2762 GtkWidget *wfixed = f->output_data.x->edit_widget; 2762 GtkWidget *wfixed = f->output_data.x->edit_widget;
2763 int winextra = canon_width > width ? (canon_width - width) / 2 : 0;
2764 int bottom = top + height;
2765 2763
2766 gint slider_width; 2764 gtk_container_set_reallocate_redraws (GTK_CONTAINER (wfixed), TRUE);
2767 int oldtop, oldleft, oldbottom;
2768 GtkRequisition req;
2769 2765
2770 /* Get old values. */ 2766 /* Move and resize to new values. */
2771 xg_find_top_left_in_fixed (wscroll, wfixed, &oldleft, &oldtop); 2767 gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top);
2772 gtk_widget_size_request (wscroll, &req); 2768 gtk_widget_set_size_request (wscroll, width, height);
2773 oldbottom = oldtop + req.height;
2774 2769
2770 /* Must force out update so changed scroll bars gets redrawn. */
2771 gdk_window_process_all_updates ();
2772
2775 /* Scroll bars in GTK has a fixed width, so if we say width 16, it 2773 /* Scroll bars in GTK has a fixed width, so if we say width 16, it
2776 will only be its fixed width (14 is default) anyway, the rest is 2774 will only be its fixed width (14 is default) anyway, the rest is
2777 blank. We are drawing the mode line across scroll bars when 2775 blank. We are drawing the mode line across scroll bars when
@@ -2799,62 +2797,7 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height,
2799 the scroll bar and the edge of the window and between the scroll 2797 the scroll bar and the edge of the window and between the scroll
2800 bar and the fringe. */ 2798 bar and the fringe. */
2801 2799
2802 if (oldtop != -1 && oldleft != -1) 2800 XClearWindow (FRAME_X_DISPLAY (f), GTK_WIDGET_TO_X_WIN (wscroll));
2803 {
2804 int gtkextral, gtkextrah;
2805 int xl, xr, wbl, wbr;
2806 int bottomdiff, topdiff;
2807
2808 gtk_widget_style_get (wscroll, "slider_width", &slider_width, NULL);
2809 gtkextral = width > slider_width ? (width - slider_width) / 2 : 0;
2810 gtkextrah = gtkextral ? (width - slider_width - gtkextral) : 0;
2811
2812 xl = real_left;
2813 wbl = gtkextral + winextra;
2814 wbr = gtkextrah + winextra;
2815 xr = left + gtkextral + slider_width;
2816 bottomdiff = abs (oldbottom - bottom);
2817 topdiff = abs (oldtop - top);
2818
2819 if (oldleft != left)
2820 {
2821 gdk_window_clear_area (wfixed->window, xl, top, wbl, height);
2822 gdk_window_clear_area (wfixed->window, xr, top, wbr, height);
2823 }
2824
2825 if (oldtop > top)
2826 {
2827 gdk_window_clear_area (wfixed->window, xl, top, wbl, topdiff);
2828 gdk_window_clear_area (wfixed->window, xr, top, wbr, topdiff);
2829 }
2830 else if (oldtop < top)
2831 {
2832 gdk_window_clear_area (wfixed->window, xl, oldtop, wbl, topdiff);
2833 gdk_window_clear_area (wfixed->window, xr, oldtop, wbr, topdiff);
2834 }
2835
2836 if (oldbottom > bottom)
2837 {
2838 gdk_window_clear_area (wfixed->window, xl, bottom, wbl,
2839 bottomdiff);
2840 gdk_window_clear_area (wfixed->window, xr, bottom, wbr,
2841 bottomdiff);
2842 }
2843 else if (oldbottom < bottom)
2844 {
2845 gdk_window_clear_area (wfixed->window, xl, oldbottom, wbl,
2846 bottomdiff);
2847 gdk_window_clear_area (wfixed->window, xr, oldbottom, wbr,
2848 bottomdiff);
2849 }
2850 }
2851
2852 /* Move and resize to new values. */
2853 gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top);
2854 gtk_widget_set_size_request (wscroll, width, height);
2855
2856 /* Must force out update so changed scroll bars gets redrawn. */
2857 gdk_window_process_all_updates ();
2858 2801
2859 SET_FRAME_GARBAGED (f); 2802 SET_FRAME_GARBAGED (f);
2860 cancel_mouse_face (f); 2803 cancel_mouse_face (f);