aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-02-23 02:05:55 +0000
committernyamatongwe <unknown>2003-02-23 02:05:55 +0000
commit647c273bc7f97218914b1b57f9f7a10ad3beb715 (patch)
tree0dfb714062262b4ce1d68b9c349c7b6beda63de1
parent3de2de75f4d65a528089c9e28037974b44632ab9 (diff)
downloadscintilla-mirror-647c273bc7f97218914b1b57f9f7a10ad3beb715.tar.gz
Patch from Jakub Vrana to avoid mouse debouncing on Windows where assigning
a key to double click can result in two mouse clicks arriving with the same time.
-rw-r--r--gtk/PlatGTK.cxx4
-rw-r--r--include/Platform.h1
-rw-r--r--src/Editor.cxx2
-rw-r--r--win32/PlatWin.cxx4
4 files changed, 10 insertions, 1 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 8afe2bcba..0a84f46a1 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1686,6 +1686,10 @@ unsigned int Platform::DoubleClickTime() {
return 500; // Half a second
}
+bool Platform::MouseButtonBounce() {
+ return true;
+}
+
void Platform::DebugDisplay(const char *s) {
printf("%s", s);
}
diff --git a/include/Platform.h b/include/Platform.h
index eacf2302d..ee6e07c34 100644
--- a/include/Platform.h
+++ b/include/Platform.h
@@ -440,6 +440,7 @@ public:
static const char *DefaultFont();
static int DefaultFontSize();
static unsigned int DoubleClickTime();
+ static bool MouseButtonBounce();
static void DebugDisplay(const char *s);
static bool IsKeyDown(int key);
static long SendScintilla(
diff --git a/src/Editor.cxx b/src/Editor.cxx
index b156dd3ec..5f3020fc0 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -4338,7 +4338,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
SetEmptySelection(newPos);
bool doubleClick = false;
// Stop mouse button bounce changing selection type
- if (curTime != lastClickTime) {
+ if (!Platform::MouseButtonBounce() || curTime != lastClickTime) {
if (selectionType == selChar) {
selectionType = selWord;
doubleClick = true;
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index dbcc3c940..80a2e8557 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -1281,6 +1281,10 @@ unsigned int Platform::DoubleClickTime() {
return ::GetDoubleClickTime();
}
+bool Platform::MouseButtonBounce() {
+ return false;
+}
+
void Platform::DebugDisplay(const char *s) {
::OutputDebugString(s);
}