[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara
caolanm at redhat.com
Mon Nov 21 10:25:38 UTC 2016
vcl/unx/gtk3/gtk3gtkframe.cxx | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
New commits:
commit 351751557b0e50816866381904be907745d918c4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Nov 21 10:22:27 2016 +0000
Resolves: rhbz#1396827 update geom on mouse click as well as motion
Change-Id: Ia361aa316fe3f5ecdd672d42de9bea7fcf142554
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 196114c..82af6fb 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2595,10 +2595,6 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
case 3: aEvent.mnButton = MOUSE_RIGHT; break;
default: return false;
}
- aEvent.mnTime = pEvent->time;
- aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
- aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
- aEvent.mnCode = GetMouseModCode( pEvent->state );
vcl::DeletionListener aDel( pThis );
@@ -2609,12 +2605,31 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
pThis->closePopup();
}
- // --- RTL --- (mirror mouse pos)
- if( AllSettings::GetLayoutRTL() )
- aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
+ if (!aDel.isDeleted())
+ {
+ int frame_x = (int)(pEvent->x_root - pEvent->x);
+ int frame_y = (int)(pEvent->y_root - pEvent->y);
+ if (frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY)
+ {
+ pThis->maGeometry.nX = frame_x;
+ pThis->maGeometry.nY = frame_y;
+ ImplSVData* pSVData = ImplGetSVData();
+ if (pSVData->maNWFData.mbCanDetermineWindowPosition)
+ pThis->CallCallbackExc(SalEvent::Move, nullptr);
+ }
+ }
if (!aDel.isDeleted())
{
+ aEvent.mnTime = pEvent->time;
+ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
+ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
+ aEvent.mnCode = GetMouseModCode( pEvent->state );
+
+ // --- RTL --- (mirror mouse pos)
+ if( AllSettings::GetLayoutRTL() )
+ aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
+
pThis->CallCallbackExc( nEventType, &aEvent );
}
@@ -2778,7 +2793,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
pThis->CallCallbackExc(SalEvent::Move, nullptr);
}
- if( ! aDel.isDeleted() )
+ if (!aDel.isDeleted())
{
SalMouseEvent aEvent;
aEvent.mnTime = pEvent->time;
@@ -2794,7 +2809,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
pThis->CallCallbackExc( SalEvent::MouseMove, &aEvent );
}
- if( ! aDel.isDeleted() )
+ if (!aDel.isDeleted())
{
// ask for the next hint
gint x, y;
More information about the Libreoffice-commits
mailing list