X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fxo-paint.c;h=32e7504ea136707e130185b05b12d012292bcc78;hb=13d7457867c57ac5ac826df4d6b478fee795c0a4;hp=8f6f609ef439f62966a7a179407b1b9a8a07f11f;hpb=e648cece76b671b5b0e165acc6d14178e8de1000;p=xournal.git diff --git a/src/xo-paint.c b/src/xo-paint.c index 8f6f609..32e7504 100644 --- a/src/xo-paint.c +++ b/src/xo-paint.c @@ -1215,6 +1215,17 @@ 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 issues + if (!gtk_check_version(2, 17, 0)) { + /* first we make *all* canvas subwindows become XInput aware, + so that it'll be safe to disable XInput later on... (!!!) */ + gtk_widget_set_extension_events(GTK_WIDGET (canvas), + ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE); + /* then we 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; @@ -1277,6 +1288,14 @@ 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) + gdk_input_set_extension_events(GTK_WIDGET(canvas)->window, + GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK, + 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));