diff options
| author | Jan Djärv | 2009-12-12 12:29:15 +0000 |
|---|---|---|
| committer | Jan Djärv | 2009-12-12 12:29:15 +0000 |
| commit | e8d7886a67ea5605276be6be01e5733758f467f3 (patch) | |
| tree | 87de60eaf135d0af52bc85cc036a0414bade0fe9 | |
| parent | 4a9b5bf5e0f4a825c8f55627aeeda2b9359cbaf3 (diff) | |
| download | emacs-e8d7886a67ea5605276be6be01e5733758f467f3.tar.gz emacs-e8d7886a67ea5605276be6be01e5733758f467f3.zip | |
gtkutil.c: Scroll bar thumb not updated properly (bug #5177).
(scroll_end_callback): New function (bug #5177)
(xg_create_scroll_bar): Call scroll_end_callback on button release
event (bug #5177).
(xg_event_is_for_scrollbar): != replaced with ==.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/gtkutil.c | 21 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6f13fe12611..63338b0880e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-12-12 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * gtkutil.c (scroll_end_callback): New function (bug #5177) | ||
| 4 | (xg_create_scroll_bar): Call scroll_end_callback on button release | ||
| 5 | event (bug #5177). | ||
| 6 | (xg_event_is_for_scrollbar): != replaced with ==. | ||
| 7 | |||
| 1 | 2009-12-12 Kenichi Handa <handa@m17n.org> | 8 | 2009-12-12 Kenichi Handa <handa@m17n.org> |
| 2 | 9 | ||
| 3 | * ftfont.c (struct ftfont_info): New member matrix. | 10 | * ftfont.c (struct ftfont_info): New member matrix. |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 8e5814c3ef8..8c12f04991a 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -3093,6 +3093,18 @@ xg_gtk_scroll_destroy (widget, data) | |||
| 3093 | xg_remove_widget_from_map (id); | 3093 | xg_remove_widget_from_map (id); |
| 3094 | } | 3094 | } |
| 3095 | 3095 | ||
| 3096 | /* Callback for button release. Sets dragging to Qnil when dragging is done. */ | ||
| 3097 | |||
| 3098 | static gboolean | ||
| 3099 | scroll_end_callback (GtkWidget *widget, | ||
| 3100 | GdkEventButton *event, | ||
| 3101 | gpointer user_data) | ||
| 3102 | { | ||
| 3103 | struct scroll_bar *bar = (struct scroll_bar *) user_data; | ||
| 3104 | bar->dragging = Qnil; | ||
| 3105 | return FALSE; | ||
| 3106 | } | ||
| 3107 | |||
| 3096 | /* Create a scroll bar widget for frame F. Store the scroll bar | 3108 | /* Create a scroll bar widget for frame F. Store the scroll bar |
| 3097 | in BAR. | 3109 | in BAR. |
| 3098 | SCROLL_CALLBACK is the callback to invoke when the value of the | 3110 | SCROLL_CALLBACK is the callback to invoke when the value of the |
| @@ -3134,6 +3146,11 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) | |||
| 3134 | G_CALLBACK (xg_gtk_scroll_destroy), | 3146 | G_CALLBACK (xg_gtk_scroll_destroy), |
| 3135 | (gpointer) (EMACS_INT) scroll_id); | 3147 | (gpointer) (EMACS_INT) scroll_id); |
| 3136 | 3148 | ||
| 3149 | g_signal_connect (G_OBJECT (wscroll), | ||
| 3150 | "button-release-event", | ||
| 3151 | G_CALLBACK (scroll_end_callback), | ||
| 3152 | (gpointer) bar); | ||
| 3153 | |||
| 3137 | /* The scroll bar widget does not draw on a window of its own. Instead | 3154 | /* The scroll bar widget does not draw on a window of its own. Instead |
| 3138 | it draws on the parent window, in this case the edit widget. So | 3155 | it draws on the parent window, in this case the edit widget. So |
| 3139 | whenever the edit widget is cleared, the scroll bar needs to redraw | 3156 | whenever the edit widget is cleared, the scroll bar needs to redraw |
| @@ -3317,13 +3334,13 @@ xg_event_is_for_scrollbar (f, event) | |||
| 3317 | retval = gdk_display_get_window_at_pointer (gdpy, NULL, NULL) | 3334 | retval = gdk_display_get_window_at_pointer (gdpy, NULL, NULL) |
| 3318 | != f->output_data.x->edit_widget->window; | 3335 | != f->output_data.x->edit_widget->window; |
| 3319 | } | 3336 | } |
| 3320 | else if (f && (event->type != ButtonRelease || event->type != MotionNotify)) | 3337 | else if (f && (event->type == ButtonRelease || event->type == MotionNotify)) |
| 3321 | { | 3338 | { |
| 3322 | /* If we are releasing or moving the scroll bar, it has the grab. */ | 3339 | /* If we are releasing or moving the scroll bar, it has the grab. */ |
| 3323 | retval = gtk_grab_get_current () != 0 | 3340 | retval = gtk_grab_get_current () != 0 |
| 3324 | && gtk_grab_get_current () != f->output_data.x->edit_widget; | 3341 | && gtk_grab_get_current () != f->output_data.x->edit_widget; |
| 3325 | } | 3342 | } |
| 3326 | 3343 | ||
| 3327 | return retval; | 3344 | return retval; |
| 3328 | } | 3345 | } |
| 3329 | 3346 | ||