This patch adds mouse behaviour settings for GTK+.

Tested with for example double click time that renders me unable to double 
click and works even without a restart.
Note that unlike the Windows code, I put the SetMouseSettings directly after 
the block because I find it non-obvious at the bottom (and it took me a 
re-compile because I didn't notice the need to do that).

ciao,
    Christian
From dca0604c80e6c9f06c878321b8717a3b13a2d74a Mon Sep 17 00:00:00 2001
From: Christian Dywan <christ...@lanedo.com>
Date: Thu, 28 Apr 2011 14:32:16 +0200
Subject: [PATCH] Set GTK+ native mouse behaviour settings

---
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 1f82b3a..9a81fd7 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3495,6 +3495,22 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
     else
         aStyleSet.SetCursorBlinkTime( STYLE_CURSOR_NOBLINKTIME );
 
+    MouseSettings aMouseSettings = rSettings.GetMouseSettings();
+    int iDoubleClickTime, iDoubleClickDistance, iDragThreshold, iMenuPopupDelay;
+    g_object_get( pSettings,
+                  "gtk-double-click-time", &iDoubleClickTime,
+                  "gtk-double-click-distance", &iDoubleClickDistance,
+                  "gtk-dnd-drag-threshold", &iDragThreshold,
+                  "gtk-menu-popup-delay", &iMenuPopupDelay,
+                  (char *)NULL );
+    aMouseSettings.SetDoubleClickTime( iDoubleClickTime );
+    aMouseSettings.SetDoubleClickWidth( iDoubleClickDistance );
+    aMouseSettings.SetDoubleClickHeight( iDoubleClickDistance );
+    aMouseSettings.SetStartDragWidth( iDragThreshold );
+    aMouseSettings.SetStartDragHeight( iDragThreshold );
+    aMouseSettings.SetMenuDelay( iMenuPopupDelay );
+    rSettings.SetMouseSettings( aMouseSettings );
+
     gboolean showmenuicons = true;
     pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gImageMenuItem );
     g_object_get( pSettings, "gtk-menu-images", &showmenuicons, (char *)NULL );
-- 
1.7.1

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to