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 <christian@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
Context
- [Libreoffice] [PATCH] Set GTK+ native mouse behaviour settings · Christian Dywan
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.