- work around Win32 bug: refuse paste if mismatched format
- Chinese (simplified) translation (by Mutse)
- updated German translation (Stefan Holtzhauer)
+ - ignore events from non-drawing devices by default (ignore_other_devices)
Version 0.4.7 (July 4, 2012):
- insert image tool (based on patches by Victor Saase and Simon Guest)
ui.cur_path.num_points == 1) {
// Xorg 7.3+ sent core event before XInput event: fix initial point
ui.is_corestroke = FALSE;
+ ui.stroke_device = event->device;
get_pointer_coords((GdkEvent *)event, ui.cur_path.coords);
}
if (ui.cur_item_type != ITEM_NONE) return FALSE; // we're already doing something
is_core = (event->device == gdk_device_get_core_pointer());
if (!ui.use_xinput && !is_core) return FALSE;
if (ui.use_xinput && is_core && !ui.is_corestroke) return FALSE;
+ if (ui.ignore_other_devices && ui.stroke_device!=event->device) return FALSE;
if (!is_core) fix_xinput_coords((GdkEvent *)event);
if (event->button != ui.which_mouse_button &&
}
if (ui.use_xinput && is_core && !ui.is_corestroke) return FALSE;
- if (!is_core) ui.is_corestroke = FALSE;
+ if (!is_core && ui.is_corestroke) {
+ ui.is_corestroke = FALSE;
+ ui.stroke_device = event->device;
+ }
+ if (ui.ignore_other_devices && ui.stroke_device!=event->device) return FALSE;
#ifdef INPUT_DEBUG
printf("DEBUG: MotionNotify (%s) (x,y)=(%.2f,%.2f), modifier %x\n",
- is_core?"core":"xinput", event->x, event->y, event->state);
+ event->device->name, event->x, event->y, event->state);
#endif
looks_wrong = !(event->state & (1<<(7+ui.which_mouse_button)));
if (sel->xo_data!=NULL) g_free(sel->xo_data);
if (sel->text_data!=NULL) g_free(sel->text_data);
- if (sel->image_data!=NULL) gdk_pixbuf_unref(sel->image_data);
+ if (sel->image_data!=NULL) g_object_unref(sel->image_data);
g_free(sel);
}
{ *error = xoj_invalid(); return; }
tmpPage->bg->filename = refstring_ref(tmpbg->filename);
tmpPage->bg->pixbuf = tmpbg->pixbuf;
- if (tmpbg->pixbuf!=NULL) gdk_pixbuf_ref(tmpbg->pixbuf);
+ if (tmpbg->pixbuf!=NULL) g_object_ref(tmpbg->pixbuf);
tmpPage->bg->file_domain = tmpbg->file_domain;
}
else {
if (remnlen == 0) { // make a new bg
pix = gdk_pixbuf_loader_get_pixbuf(loader);
if (pix == NULL) break;
- gdk_pixbuf_ref(pix);
+ g_object_ref(pix);
gdk_pixbuf_loader_close(loader, NULL);
g_object_unref(loader);
loader = NULL;
bgpdf.npages++;
}
bgpg = g_list_nth_data(bgpdf.pages, req->pageno-1);
- if (bgpg->pixbuf!=NULL) gdk_pixbuf_unref(bgpg->pixbuf);
+ if (bgpg->pixbuf!=NULL) g_object_unref(bgpg->pixbuf);
bgpg->pixbuf = pixbuf;
bgpg->dpi = req->dpi;
bgpg->pixel_height = scaled_height;
refstring_unref(bgpdf.filename);
for (list = bgpdf.pages; list != NULL; list = list->next) {
pdfpg = (struct BgPdfPage *)list->data;
- if (pdfpg->pixbuf!=NULL) gdk_pixbuf_unref(pdfpg->pixbuf);
+ if (pdfpg->pixbuf!=NULL) g_object_unref(pdfpg->pixbuf);
g_free(pdfpg);
}
g_list_free(bgpdf.pages);
for (list = journal.pages; list!= NULL; list = list->next) {
pg = (struct Page *)list->data;
if (pg->bg->type == BG_PDF && pg->bg->file_page_seq == pageno) {
- if (pg->bg->pixbuf!=NULL) gdk_pixbuf_unref(pg->bg->pixbuf);
- pg->bg->pixbuf = gdk_pixbuf_ref(bgpg->pixbuf);
+ if (pg->bg->pixbuf!=NULL) g_object_unref(pg->bg->pixbuf);
+ pg->bg->pixbuf = g_object_ref(bgpg->pixbuf);
pg->bg->pixel_width = bgpg->pixel_width;
pg->bg->pixel_height = bgpg->pixel_height;
update_canvas_bg(pg);
ui.view_continuous = TRUE;
ui.allow_xinput = TRUE;
ui.discard_corepointer = FALSE;
+ ui.ignore_other_devices = TRUE;
ui.left_handed = FALSE;
ui.shorten_menus = FALSE;
ui.shorten_menu_items = g_strdup(DEFAULT_SHORTEN_MENUS);
update_keyval("general", "discard_corepointer",
_(" discard Core Pointer events in XInput mode (true/false)"),
g_strdup(ui.discard_corepointer?"true":"false"));
+ update_keyval("general", "ignore_other_devices",
+ _(" ignore events from other devices while drawing (true/false)"),
+ g_strdup(ui.ignore_other_devices?"true":"false"));
update_keyval("general", "use_erasertip",
_(" always map eraser tip to eraser (true/false)"),
g_strdup(ui.use_erasertip?"true":"false"));
parse_keyval_boolean("general", "view_continuous", &ui.view_continuous);
parse_keyval_boolean("general", "use_xinput", &ui.allow_xinput);
parse_keyval_boolean("general", "discard_corepointer", &ui.discard_corepointer);
+ parse_keyval_boolean("general", "ignore_other_devices", &ui.ignore_other_devices);
parse_keyval_boolean("general", "use_erasertip", &ui.use_erasertip);
parse_keyval_boolean("general", "buttons_switch_mappings", &ui.button_switch_mapping);
parse_keyval_boolean("general", "autoload_pdf_xoj", &ui.autoload_pdf_xoj);
pg->bg = (struct Background *)g_memdup(template->bg, sizeof(struct Background));
pg->bg->canvas_item = NULL;
if (pg->bg->type == BG_PIXMAP || pg->bg->type == BG_PDF) {
- gdk_pixbuf_ref(pg->bg->pixbuf);
+ g_object_ref(pg->bg->pixbuf);
refstring_ref(pg->bg->filename);
}
pg->group = (GnomeCanvasGroup *) gnome_canvas_item_new(
else if (redo->type == ITEM_NEW_BG_ONE || redo->type == ITEM_NEW_BG_RESIZE
|| redo->type == ITEM_NEW_DEFAULT_BG) {
if (redo->bg->type == BG_PIXMAP || redo->bg->type == BG_PDF) {
- if (redo->bg->pixbuf!=NULL) gdk_pixbuf_unref(redo->bg->pixbuf);
+ if (redo->bg->pixbuf!=NULL) g_object_unref(redo->bg->pixbuf);
refstring_unref(redo->bg->filename);
}
g_free(redo->bg);
else if (undo->type == ITEM_NEW_BG_ONE || undo->type == ITEM_NEW_BG_RESIZE
|| undo->type == ITEM_NEW_DEFAULT_BG) {
if (undo->bg->type == BG_PIXMAP || undo->bg->type == BG_PDF) {
- if (undo->bg->pixbuf!=NULL) gdk_pixbuf_unref(undo->bg->pixbuf);
+ if (undo->bg->pixbuf!=NULL) g_object_unref(undo->bg->pixbuf);
refstring_unref(undo->bg->filename);
}
g_free(undo->bg);
if (pg->group!=NULL) gtk_object_destroy(GTK_OBJECT(pg->group));
// this also destroys the background's canvas items
if (pg->bg->type == BG_PIXMAP || pg->bg->type == BG_PDF) {
- if (pg->bg->pixbuf != NULL) gdk_pixbuf_unref(pg->bg->pixbuf);
+ if (pg->bg->pixbuf != NULL) g_object_unref(pg->bg->pixbuf);
if (pg->bg->filename != NULL) refstring_unref(pg->bg->filename);
}
g_free(pg->bg);
gboolean is_corestroke; // this stroke is painted with core pointer
gboolean saved_is_corestroke;
GdkDevice *stroke_device; // who's painting this stroke
+ gboolean ignore_other_devices;
int screen_width, screen_height; // initial screen size, for XInput events
double hand_refpt[2];
int hand_scrollto_cx, hand_scrollto_cy;