pidgin/gtkconv.c

changeset 38712
ea49cd76cf47
parent 38709
6c80734ca3b4
child 38748
17f8a2a8ccba
equal deleted inserted replaced
38711:76aea257b1c6 38712:ea49cd76cf47
1846 conv, who, event->button)); 1846 conv, who, event->button));
1847 if (plugin_return) 1847 if (plugin_return)
1848 goto handled; 1848 goto handled;
1849 } 1849 }
1850 1850
1851 if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) { 1851 if (event->button == GDK_BUTTON_PRIMARY && event->type == GDK_2BUTTON_PRESS) {
1852 chat_do_im(gtkconv, who); 1852 chat_do_im(gtkconv, who);
1853 } else if (event->button == 2 && event->type == GDK_BUTTON_PRESS) { 1853 } else if (event->button == GDK_BUTTON_MIDDLE && event->type == GDK_BUTTON_PRESS) {
1854 /* Move to user's anchor */ 1854 /* Move to user's anchor */
1855 WebKitDOMNode *node = get_mark_for_user(gtkconv, who); 1855 WebKitDOMNode *node = get_mark_for_user(gtkconv, who);
1856 1856
1857 if (node != NULL) 1857 if (node != NULL)
1858 webkit_dom_element_scroll_into_view(WEBKIT_DOM_ELEMENT(node), TRUE); 1858 webkit_dom_element_scroll_into_view(WEBKIT_DOM_ELEMENT(node), TRUE);
2284 * GtkTextView, but I'm not ready to point any fingers yet. 2284 * GtkTextView, but I'm not ready to point any fingers yet.
2285 */ 2285 */
2286 static gboolean 2286 static gboolean
2287 entry_stop_rclick_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) 2287 entry_stop_rclick_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
2288 { 2288 {
2289 if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { 2289 if (event->button == GDK_BUTTON_SECONDARY && event->type == GDK_BUTTON_PRESS) {
2290 /* Right single click */ 2290 /* Right single click */
2291 g_signal_stop_emission_by_name(G_OBJECT(widget), "button_press_event"); 2291 g_signal_stop_emission_by_name(G_OBJECT(widget), "button_press_event");
2292 2292
2293 return TRUE; 2293 return TRUE;
2294 } 2294 }
2957 { 2957 {
2958 static GtkWidget *menu = NULL; 2958 static GtkWidget *menu = NULL;
2959 PurpleConversation *conv; 2959 PurpleConversation *conv;
2960 PurpleBuddy *buddy; 2960 PurpleBuddy *buddy;
2961 2961
2962 if (e->button == 1 && e->type == GDK_BUTTON_PRESS) { 2962 if (e->button == GDK_BUTTON_PRIMARY && e->type == GDK_BUTTON_PRESS) {
2963 change_size_cb(NULL, gtkconv); 2963 change_size_cb(NULL, gtkconv);
2964 return TRUE; 2964 return TRUE;
2965 } 2965 }
2966 2966
2967 if (!gdk_event_triggers_context_menu((GdkEvent *)e)) { 2967 if (!gdk_event_triggers_context_menu((GdkEvent *)e)) {
5878 { 5878 {
5879 /* A click on the pane is propagated to the notebook containing the pane. 5879 /* A click on the pane is propagated to the notebook containing the pane.
5880 * So if Stu accidentally aims high and middle clicks on the pane-handle, 5880 * So if Stu accidentally aims high and middle clicks on the pane-handle,
5881 * it causes a conversation tab to close. Let's stop that from happening. 5881 * it causes a conversation tab to close. Let's stop that from happening.
5882 */ 5882 */
5883 if (e->button == 2 && e->type == GDK_BUTTON_PRESS) 5883 if (e->button == GDK_BUTTON_MIDDLE && e->type == GDK_BUTTON_PRESS)
5884 return TRUE; 5884 return TRUE;
5885 return FALSE; 5885 return FALSE;
5886 } 5886 }
5887 5887
5888 static void set_typing_font(GtkWidget *widget, PidginConversation *gtkconv) 5888 static void set_typing_font(GtkWidget *widget, PidginConversation *gtkconv)
6241 g_free(name); 6241 g_free(name);
6242 return TRUE; 6242 return TRUE;
6243 } 6243 }
6244 } 6244 }
6245 6245
6246 if (btn_event->button == 1 && event->type == GDK_2BUTTON_PRESS) { 6246 if (btn_event->button == GDK_BUTTON_PRIMARY && event->type == GDK_2BUTTON_PRESS) {
6247 chat_do_im(PIDGIN_CONVERSATION(conv), buddyname); 6247 chat_do_im(PIDGIN_CONVERSATION(conv), buddyname);
6248 g_free(name); 6248 g_free(name);
6249 6249
6250 return TRUE; 6250 return TRUE;
6251 } else if (btn_event->button == 2 && event->type == GDK_2BUTTON_PRESS) { 6251 } else if (btn_event->button == GDK_BUTTON_MIDDLE && event->type == GDK_2BUTTON_PRESS) {
6252 chat_do_info(PIDGIN_CONVERSATION(conv), buddyname); 6252 chat_do_info(PIDGIN_CONVERSATION(conv), buddyname);
6253 g_free(name); 6253 g_free(name);
6254 6254
6255 return TRUE; 6255 return TRUE;
6256 } else if (gdk_event_triggers_context_menu(event)) { 6256 } else if (gdk_event_triggers_context_menu(event)) {
9348 */ 9348 */
9349 9349
9350 static gboolean 9350 static gboolean
9351 infopane_press_cb(GtkWidget *widget, GdkEventButton *e, PidginConversation *gtkconv) 9351 infopane_press_cb(GtkWidget *widget, GdkEventButton *e, PidginConversation *gtkconv)
9352 { 9352 {
9353 if (e->type == GDK_2BUTTON_PRESS && e->button == 1) { 9353 if (e->type == GDK_2BUTTON_PRESS && e->button == GDK_BUTTON_PRIMARY) {
9354 if (infopane_entry_activate(gtkconv)) 9354 if (infopane_entry_activate(gtkconv))
9355 return TRUE; 9355 return TRUE;
9356 } 9356 }
9357 9357
9358 if (e->type != GDK_BUTTON_PRESS) 9358 if (e->type != GDK_BUTTON_PRESS)
9359 return FALSE; 9359 return FALSE;
9360 9360
9361 if (e->button == 1) { 9361 if (e->button == GDK_BUTTON_PRIMARY) {
9362 int nb_x, nb_y; 9362 int nb_x, nb_y;
9363 GtkAllocation allocation; 9363 GtkAllocation allocation;
9364 9364
9365 gtk_widget_get_allocation(gtkconv->infopane_hbox, &allocation); 9365 gtk_widget_get_allocation(gtkconv->infopane_hbox, &allocation);
9366 9366
9417 int tab_clicked; 9417 int tab_clicked;
9418 GtkWidget *page; 9418 GtkWidget *page;
9419 GtkWidget *tab; 9419 GtkWidget *tab;
9420 GtkAllocation allocation; 9420 GtkAllocation allocation;
9421 9421
9422 if (e->button == 2 && e->type == GDK_BUTTON_PRESS) { 9422 if (e->button == GDK_BUTTON_MIDDLE && e->type == GDK_BUTTON_PRESS) {
9423 PidginConversation *gtkconv; 9423 PidginConversation *gtkconv;
9424 tab_clicked = pidgin_conv_get_tab_at_xy(win, e->x_root, e->y_root, NULL); 9424 tab_clicked = pidgin_conv_get_tab_at_xy(win, e->x_root, e->y_root, NULL);
9425 9425
9426 if (tab_clicked == -1) 9426 if (tab_clicked == -1)
9427 return FALSE; 9427 return FALSE;
9430 close_conv_cb(NULL, gtkconv); 9430 close_conv_cb(NULL, gtkconv);
9431 return TRUE; 9431 return TRUE;
9432 } 9432 }
9433 9433
9434 9434
9435 if (e->button != 1 || e->type != GDK_BUTTON_PRESS) 9435 if (e->button != GDK_BUTTON_PRIMARY || e->type != GDK_BUTTON_PRESS)
9436 return FALSE; 9436 return FALSE;
9437 9437
9438 9438
9439 if (win->in_drag) { 9439 if (win->in_drag) {
9440 purple_debug(PURPLE_DEBUG_WARNING, "gtkconv", 9440 purple_debug(PURPLE_DEBUG_WARNING, "gtkconv",
9513 /* 9513 /*
9514 * Don't check to make sure that the event's window matches the 9514 * Don't check to make sure that the event's window matches the
9515 * widget's, because we may be getting an event passed on from the 9515 * widget's, because we may be getting an event passed on from the
9516 * close button. 9516 * close button.
9517 */ 9517 */
9518 if (e->button != 1 && e->type != GDK_BUTTON_RELEASE) 9518 if (e->button != GDK_BUTTON_PRIMARY && e->type != GDK_BUTTON_RELEASE)
9519 return FALSE; 9519 return FALSE;
9520 9520
9521 device = gdk_event_get_device((GdkEvent *)e); 9521 device = gdk_event_get_device((GdkEvent *)e);
9522 if (gdk_display_device_is_grabbed(gdk_device_get_display(device), device)) { 9522 if (gdk_display_device_is_grabbed(gdk_device_get_display(device), device)) {
9523 gdk_device_ungrab(device, gdk_event_get_time((GdkEvent *)e)); 9523 gdk_device_ungrab(device, gdk_event_get_time((GdkEvent *)e));

mercurial