From 9097dc4f8adafe77fee1fecb1a6353c0b16b4866 Mon Sep 17 00:00:00 2001 From: auroux Date: Sat, 7 Jul 2012 03:24:59 +0000 Subject: [PATCH] more win32 bugfixes --- ChangeLog | 1 + src/xo-clipboard.c | 6 +++++- src/xo-paint.h | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a367f92..f14459d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ This version: - generate cursors from pixbufs (fixes a Win32 bug) + - work around Win32 bug: refuse paste if mismatched format Version 0.4.7 (July 4, 2012): - insert image tool (based on patches by Victor Saase and Simon Guest) diff --git a/src/xo-clipboard.c b/src/xo-clipboard.c index b043c4a..3d6cb41 100644 --- a/src/xo-clipboard.c +++ b/src/xo-clipboard.c @@ -334,7 +334,7 @@ void clipboard_paste_text(gchar *text) ui.cur_layer->items = g_list_append(ui.cur_layer->items, item); ui.cur_layer->nitems++; item->type = ITEM_TEXT; - g_memmove(&(item->brush), ui.cur_brush, sizeof(struct Brush)); + g_memmove(&(item->brush), &(ui.brushes[ui.cur_mapping][TOOL_PEN]), sizeof(struct Brush)); item->text = text; // text was newly allocated, we keep it item->font_name = g_strdup(ui.font_name); item->font_size = ui.font_size; @@ -401,6 +401,10 @@ void clipboard_paste(void) sel_data = gtk_clipboard_wait_for_contents( clipboard, gdk_atom_intern(XOURNAL_TARGET_ATOM, FALSE)); +#ifdef WIN32 // avoid a win32 bug showing images as xournal data + if (gtk_selection_data_get_data_type(sel_data)!=gdk_atom_intern(XOURNAL_TARGET_ATOM, FALSE)) + { gtk_selection_data_free(sel_data); sel_data = NULL; } +#endif ui.cur_item_type = ITEM_NONE; if (sel_data != NULL) { clipboard_paste_from_xournal(sel_data); diff --git a/src/xo-paint.h b/src/xo-paint.h index 153a894..39d2eb9 100644 --- a/src/xo-paint.h +++ b/src/xo-paint.h @@ -29,7 +29,11 @@ void do_hand(GdkEvent *event); /* text functions */ +#ifdef WIN32 +#define DEFAULT_FONT "Arial" +#else #define DEFAULT_FONT "Sans" +#endif #define DEFAULT_FONT_SIZE 12 void start_text(GdkEvent *event, struct Item *item); -- 2.39.2