! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
tooltip does not change when the wheel mouse is scrolled
Status:
RESOLVED: FIXED
Product:
Xfce4-xkb-plugin
Component:
General

Comments

Description cquike 2012-09-11 14:31:16 CEST
Created attachment 4621 
Patch to update the tooltip when scrolling the mouse wheel. Option 1: changexkb_config_next/prev_group()

If one hovers the mouse over the xkb-plugin icon, a tooltip appears with the name of the keyboard layout. If then you scroll the mouse wheel up or down, the next available keyboard layout will be selected, however the tooltip does not change, it stays with the older layout (unless you move the pointer). If later on you scroll the mouse wheel again, the tooltip changes to the previous layout. So to say, the tooltip is always one layout behind.
 
 I digged into the code and I saw that the xkb_config_next_group() function doesn't update the config->current_group variable. It expects the callback function xkb_config_xkl_state_changed() to do it. However, the tooltip callback function xkb_plugin_set_tooltip() is called before xkb_config_xkl_state_changed(), and therefore uses the value of config->current_group before it is updated.

 I attach a simple patch that fixes the problem updating config->current_group within xkb_config_next/prev_group() functions.

 I also found other way to fix it: call gtk_tooltip_trigger_tooltip_query() function in xkb_refresh_gui() (which is called by the xkb_config_xkl_state_changed() callback). 

 Which of the two fixes is better i don't know. I am not an expert on gtk, but it looks to me that the second patch is more intrusive (it affects all the windows in the display, right?).

 Regards,
 Enrique
Comment 1 cquike 2012-09-11 14:33:03 CEST
Created attachment 4622 
Patch to update the tooltip when scrolling the mouse wheel. Option 2: change xkb_refresh_gui()
Comment 2 cquike 2012-09-11 14:34:43 CEST
 Both patches are against a fresh git checkout as of 6th September.
Comment 3 Igor Slepchin editbugs 2012-09-19 01:12:13 CEST
The second patch is pushed to master - thanks for reporting!

Bug #9286

Reported by:
cquike
Reported on: 2012-09-11
Last modified on: 2012-09-19

People

Assignee:
Igor Slepchin
CC List:
2 users

Version

Attachments

Additional information