зеркало из https://github.com/mozilla/gecko-dev.git
patch for bug #49364. initialize key values during a drag. this should fix mail/news copying instead of moving messages on linux. r=pavlov,pinkerton a=brendan
This commit is contained in:
Родитель
47973a74f3
Коммит
7ba0c56b16
|
@ -3014,6 +3014,22 @@ void nsWindow::StoreProperty(char *property, unsigned char *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are all of our drag and drop operations
|
// These are all of our drag and drop operations
|
||||||
|
|
||||||
|
void
|
||||||
|
nsWindow::InitDragEvent (nsMouseEvent &aEvent)
|
||||||
|
{
|
||||||
|
// set everything to zero
|
||||||
|
memset(&aEvent, 0, sizeof(nsMouseEvent));
|
||||||
|
// set the keyboard modifiers
|
||||||
|
gint x, y;
|
||||||
|
GdkModifierType state = (GdkModifierType)0;
|
||||||
|
gdk_window_get_pointer(NULL, &x, &y, &state);
|
||||||
|
aEvent.isShift = (state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;
|
||||||
|
aEvent.isControl = (state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;
|
||||||
|
aEvent.isAlt = (state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;
|
||||||
|
aEvent.isMeta = PR_FALSE; // GTK+ doesn't support the meta key
|
||||||
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
gint
|
gint
|
||||||
nsWindow::DragMotionSignal (GtkWidget * aWidget,
|
nsWindow::DragMotionSignal (GtkWidget * aWidget,
|
||||||
|
@ -3091,6 +3107,8 @@ gint nsWindow::OnDragMotionSignal (GtkWidget * aWidget,
|
||||||
|
|
||||||
nsMouseEvent event;
|
nsMouseEvent event;
|
||||||
|
|
||||||
|
InitDragEvent(event);
|
||||||
|
|
||||||
event.message = NS_DRAGDROP_OVER;
|
event.message = NS_DRAGDROP_OVER;
|
||||||
event.eventStructType = NS_DRAGDROP_EVENT;
|
event.eventStructType = NS_DRAGDROP_EVENT;
|
||||||
|
|
||||||
|
@ -3224,6 +3242,8 @@ nsWindow::OnDragDropSignal (GtkWidget *aWidget,
|
||||||
|
|
||||||
nsMouseEvent event;
|
nsMouseEvent event;
|
||||||
|
|
||||||
|
InitDragEvent(event);
|
||||||
|
|
||||||
event.message = NS_DRAGDROP_OVER;
|
event.message = NS_DRAGDROP_OVER;
|
||||||
event.eventStructType = NS_DRAGDROP_EVENT;
|
event.eventStructType = NS_DRAGDROP_EVENT;
|
||||||
event.widget = innerMostWidget;
|
event.widget = innerMostWidget;
|
||||||
|
@ -3232,6 +3252,8 @@ nsWindow::OnDragDropSignal (GtkWidget *aWidget,
|
||||||
|
|
||||||
innerMostWidget->DispatchMouseEvent(event);
|
innerMostWidget->DispatchMouseEvent(event);
|
||||||
|
|
||||||
|
InitDragEvent(event);
|
||||||
|
|
||||||
event.message = NS_DRAGDROP_DROP;
|
event.message = NS_DRAGDROP_DROP;
|
||||||
event.eventStructType = NS_DRAGDROP_EVENT;
|
event.eventStructType = NS_DRAGDROP_EVENT;
|
||||||
event.widget = innerMostWidget;
|
event.widget = innerMostWidget;
|
||||||
|
|
|
@ -221,6 +221,8 @@ protected:
|
||||||
static nsWindow *mLastDragMotionWindow;
|
static nsWindow *mLastDragMotionWindow;
|
||||||
static nsWindow *mLastLeaveWindow;
|
static nsWindow *mLastLeaveWindow;
|
||||||
|
|
||||||
|
void InitDragEvent(nsMouseEvent &aEvent);
|
||||||
|
|
||||||
// DragBegin not needed ?
|
// DragBegin not needed ?
|
||||||
// always returns TRUE
|
// always returns TRUE
|
||||||
static gint DragMotionSignal (GtkWidget * aWidget,
|
static gint DragMotionSignal (GtkWidget * aWidget,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче