From 587397f49165f739c0ff164cbb15aabfc00eb44e Mon Sep 17 00:00:00 2001 From: ozmikepittman Date: Fri, 28 Mar 2008 00:35:36 +0000 Subject: [PATCH] Applying fix from LP #183646 --- src/libgdl/gdl-dock-master.c | 17 ++++++++++++++- src/libgdl/gdl-win32.c | 42 ++++++++++++++++++++++++++++++++++++ src/libgdl/gdl-win32.h | 30 ++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 src/libgdl/gdl-win32.c create mode 100644 src/libgdl/gdl-win32.h diff --git a/src/libgdl/gdl-dock-master.c b/src/libgdl/gdl-dock-master.c index 205900702..1c362ed16 100644 --- a/src/libgdl/gdl-dock-master.c +++ b/src/libgdl/gdl-dock-master.c @@ -33,6 +33,9 @@ #include "gdl-dock-item.h" #include "libgdlmarshal.h" #include "libgdltypebuiltins.h" +#ifdef WIN32 +#include "gdl-win32.h" +#endif /* ----- Private prototypes ----- */ @@ -645,8 +648,20 @@ gdl_dock_master_xor_rect (GdlDockMaster *master) window, &values, GDK_GC_FUNCTION | GDK_GC_SUBWINDOW); }; +#ifdef WIN32 + GdkLineStyle lineStyle = GDK_LINE_ON_OFF_DASH; + if (is_os_vista()) + { + // On Vista the dash-line is increadibly slow to draw, it takes several minutes to draw the tracking lines + // With GDK_LINE_SOLID it is parts of a second + // No performance issue on WinXP + lineStyle = GDK_LINE_SOLID; + } +#else + GdkLineStyle lineStyle = GDK_LINE_ON_OFF_DASH; +#endif gdk_gc_set_line_attributes (master->_priv->root_xor_gc, 1, - GDK_LINE_ON_OFF_DASH, + lineStyle, GDK_CAP_NOT_LAST, GDK_JOIN_BEVEL); diff --git a/src/libgdl/gdl-win32.c b/src/libgdl/gdl-win32.c new file mode 100644 index 000000000..044befedf --- /dev/null +++ b/src/libgdl/gdl-win32.c @@ -0,0 +1,42 @@ +/* + * Windows stuff + * + * Author: + * Albin Sunnanbo + * Based on code by Lauris Kaplinski (/src/extension/internal/win32.cpp) + * + * This code is in public domain + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "gdl-win32.h" + +/* Platform detection */ +gboolean +is_os_vista() +{ + static gboolean initialized = FALSE; + static gboolean is_vista = FALSE; + static OSVERSIONINFOA osver; + + if ( !initialized ) + { + BOOL result; + + initialized = TRUE; + + memset (&osver, 0, sizeof(OSVERSIONINFOA)); + osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); + result = GetVersionExA (&osver); + if (result) + { + if (osver.dwMajorVersion == WIN32_MAJORVERSION_VISTA) + is_vista = TRUE; + } + } + + return is_vista; +} diff --git a/src/libgdl/gdl-win32.h b/src/libgdl/gdl-win32.h new file mode 100644 index 000000000..8fa0800ed --- /dev/null +++ b/src/libgdl/gdl-win32.h @@ -0,0 +1,30 @@ +#ifndef __INKSCAPE_GDL_WIN32_H__ +#define __INKSCAPE_GDL_WIN32_H__ + +/* + * Windows stuff + * + * Author: + * Albin Sunnanbo + * + * This code is in public domain + */ + + + +#define WIN32_MAJORVERSION_VISTA 0x0006 + + + +#include +#include +#include + +#ifndef WIN32 +#error "This file is only usable for Windows" +#endif + +/* Platform detection */ +gboolean is_os_vista(); + +#endif /* __INKSCAPE_GDL_WIN32_H__ */ -- 2.30.2