gboolean tray_button_press_event_cb (GtkStatusIcon *status_icon, GdkEventButton * event, gpointer userdata) { switch (event->button) { case 1: if (event->state & GDK_SHIFT_MASK) inmd_switch_popup_handler(NULL, (GdkEvent *)event); else toggle_im_enabled(); break; case 2: #if 0 inmd_switch_popup_handler(NULL, (GdkEvent *)event); #else kbm_toggle(); dbg("win_kbm_on %d\n", win_kbm_on); update_item_active_all(); #endif break; case 3: if (!tray_menu) tray_menu = create_tray_menu(mitems); gtk_menu_popup(GTK_MENU(tray_menu), NULL, NULL, gtk_status_icon_position_menu, tray_icon, event->button, event->time); break; } return TRUE; }
void show_inmd_menu() { GdkEventButton eve; eve.type = GDK_BUTTON_PRESS; eve.button = 1; eve.time = gtk_get_current_event_time (); inmd_switch_popup_handler(NULL, (GdkEvent *)&eve); }
static void mouse_button_callback( GtkWidget *widget,GdkEventButton *event, gpointer data) { // dbg("mouse_button_callback %d\n", event->button); switch (event->button) { case 1: toggle_win_sym(); break; case 2: inmd_switch_popup_handler(widget, (GdkEvent *)event); break; case 3: exec_gcin_setup(); break; } }