diff options
| author | Mike Pittman <thepittos@yahoo.com.au> | 2008-03-28 00:35:36 +0000 |
|---|---|---|
| committer | ozmikepittman <ozmikepittman@users.sourceforge.net> | 2008-03-28 00:35:36 +0000 |
| commit | 349228fd807cbd6caf1fc57e311a328f9c5c1170 (patch) | |
| tree | eafbe84a995c59c87cd55e8787d25b2a8dd7aaf5 /src | |
| parent | fix broken link to _wspawn prototype (diff) | |
| download | inkscape-349228fd807cbd6caf1fc57e311a328f9c5c1170.tar.gz inkscape-349228fd807cbd6caf1fc57e311a328f9c5c1170.zip | |
Applying fix from LP #183646
(bzr r5214)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libgdl/gdl-dock-master.c | 17 | ||||
| -rw-r--r-- | src/libgdl/gdl-win32.c | 42 | ||||
| -rw-r--r-- | src/libgdl/gdl-win32.h | 30 |
3 files changed, 88 insertions, 1 deletions
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 <lauris@kaplinski.com> (/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 <config.h>
+#include <windows.h>
+#include <gdk/gdk.h>
+
+#ifndef WIN32
+#error "This file is only usable for Windows"
+#endif
+
+/* Platform detection */
+gboolean is_os_vista();
+
+#endif /* __INKSCAPE_GDL_WIN32_H__ */
|
