]> git.donarmstrong.com Git - xournal.git/blobdiff - src/xo-paint.c
focus and other patches
[xournal.git] / src / xo-paint.c
index 32e7504ea136707e130185b05b12d012292bcc78..ba6ffffa694ff9140e3e47f0fd9b738a7da96805 100644 (file)
@@ -1086,7 +1086,7 @@ void clipboard_paste(void)
 
 // 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;
@@ -1108,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, 
@@ -1215,13 +1215,10 @@ 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
+  // 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)) {
-    /* 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 
+    /* ask the canvas's leave-notify handler to disable 
        xinput when it's safe to do so... */
     ui.need_emergency_disable_xinput = TRUE;
   }
@@ -1292,9 +1289,8 @@ void end_text(void)
   // 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);
+    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...