GNOME Bugzilla – Bug 125894
GtkHScale: thumb is moved to wrong direction by key-pressing on BiDi locale
Last modified: 2004-12-22 21:47:04 UTC
Overview Description: On the BiDi local, the Up (Ctrl-Up, PgUp) and Down (Ctrl-Down, PgDown) keys move thumb of rtl GtkHScale in the wrong direction Steps to Reproduce: 1. Run testgtk program in ./gtk+-2.2.x/tests on a BiDi locale (e.g. he_IL) 2. Press `range controls' button. 3. Set focus on GtkHScale widget. 4. Change value of GtkHScale using one of Up/Down keys. The thumb moves to reverse direction. <-- Problem!! Actual Results: Thumb of GtkHScale is moved to the left with *Up keys and to the right with *Down keys Expected Results: Thumb of GtkHScale should be moved in the direction of Home with *Up keys. It should be move in the direction of End with *Down keys. When GtkHScale has rtl direction, Home is from the right and End is from the left. Additional Information: We think the following steps would fix this issue. 1. Open gtk/gtkrange.c and see gtk_range_scroll(). 2. When GtkScrollType is GTK_SCROLL_STEP_UP, GTK_SCROLL_STEP_DOWN, GTK_SCROLL_PAGE_UP or GTK_SCROLL_PAGE_DOWN, Delete the following code: | if (should_invert(range)) | call_something() | else However, after the above-mentioned steps are applied, PageUp/PageDown keys cannot move the thumb. The reason why they can't do is that they are interpreted twice. (On non-Bidi locale, the thumbs moves every other places.) PageUp: GTK_SCROLL_PAGE_LEFT and GTK_SCROLL_PAGE_UP scroll types PageDown: GTK_SCROLL_PAGE_RIGHT and GTK_SCROLL_PAGE_DOWN scroll types If this double handling itself is designed behavior, we suppose the value of the last argument of add_slider_binding() for PageUp/Down should be replaced at gtk_scale_class_init() in gtkscale.c: PageUp: GTK_SCROLL_PAGE_LEFT --> GTK_SCROLL_PAGE_BACKWARD PageDown: GTK_SCROLL_PAGE_RIGHT --> GTK_SCROLL_PAGE_FORWARD
We prepared a patch for this issue. Could you please look at it? http://www-124.ibm.com/developerworks/oss/linux/patches/?patch_id=1206 Thank you,
Sorry. I forgot to clarify which version the patch is effective for. We created the patch based on CVS tree on 2003/Nov/19. Thanks,
Created attachment 21879 [details] [review] Proposed patch (based on CVS 2003/Nov/19)
I'd like to attach a patch here. It is the same one as the patch at the above-mentioned URL. Thanks
This is behaving as designed. There are visual and logical keybindings on GtkRange. left, right, up, down are all visual, up==left and down==right home, end, +, - are logical keybindings which change direction with the text direction
I can't agree here. In case of horizontal range up==left and down==right only for ltr direction. Up and down should be logical. Question about PgUp and PgDown remains open. If double moving of thumb is designed?