X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fxo-paint.c;h=ba6ffffa694ff9140e3e47f0fd9b738a7da96805;hb=881e9a45693f4d724512fdc5297ba312d447851b;hp=47fd6137b2c074b597677a628929a93789324f5f;hpb=21fbb1d7ed23de67f3a8237139ff154d5da16b08;p=xournal.git diff --git a/src/xo-paint.c b/src/xo-paint.c index 47fd613..ba6ffff 100644 --- a/src/xo-paint.c +++ b/src/xo-paint.c @@ -1077,11 +1077,16 @@ void clipboard_paste(void) gtk_selection_data_free(sel_data); update_copy_paste_enabled(); + update_color_menu(); + update_thickness_buttons(); + update_color_buttons(); + update_font_button(); + update_cursor(); // FIXME: can't know if pointer is within selection! } // modify the color or thickness of pen strokes in a selection -void recolor_selection(int color) +void recolor_selection(int color_no, guint color_rgba) { GList *itemlist; struct Item *item; @@ -1103,8 +1108,8 @@ void recolor_selection(int color) g_memmove(brush, &(item->brush), sizeof(struct Brush)); undo->auxlist = g_list_append(undo->auxlist, brush); // repaint the stroke - item->brush.color_no = color; - item->brush.color_rgba = predef_colors_rgba[color]; + item->brush.color_no = color_no; + item->brush.color_rgba = color_rgba; if (item->canvas_item!=NULL) { if (!item->brush.variable_width) gnome_canvas_item_set(item->canvas_item, @@ -1210,6 +1215,14 @@ void start_text(GdkEvent *event, struct Item *item) get_pointer_coords(event, pt); ui.cur_item_type = ITEM_TEXT; + // HACK TO BYPASS GTK+ 2.17 issue: crash if move text within selection + // also bypass: non-responsiveness of clicks in text box with 2.17 & 2.18 + if (!gtk_check_version(2, 17, 0)) { + /* ask the canvas's leave-notify handler to disable + xinput when it's safe to do so... */ + ui.need_emergency_disable_xinput = TRUE; + } + if (item==NULL) { item = g_new(struct Item, 1); item->text = NULL; @@ -1272,6 +1285,13 @@ void end_text(void) GnomeCanvasItem *tmpitem; if (ui.cur_item_type!=ITEM_TEXT) return; // nothing for us to do! + + // HACK TO BYPASS GTK+ 2.17 issues + if (!gtk_check_version(2, 17, 0)) { + // re-enable XInput if needed (we disabled it during text edition) + gtk_widget_set_extension_events(GTK_WIDGET (canvas), + ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE); + } // finalize the text that's been edited... buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(ui.cur_item->widget));