Kaydet (Commit) 35175155 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: rhbz#1396827 update geom on mouse click as well as motion

Change-Id: Ia361aa316fe3f5ecdd672d42de9bea7fcf142554
üst c7a9c704
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment