diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-11-21 10:22:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-11-21 10:24:02 +0000 |
commit | 351751557b0e50816866381904be907745d918c4 (patch) | |
tree | c99548bc6d305eec5aab60cb0bf83e40e02b1a95 /vcl/unx | |
parent | c7a9c704892b9db0a3de65d5d20c02f2ed2215d0 (diff) |
Resolves: rhbz#1396827 update geom on mouse click as well as motion
Change-Id: Ia361aa316fe3f5ecdd672d42de9bea7fcf142554
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 196114c0c42e..82af6fb380e4 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; |