зеркало из https://github.com/mozilla/pjs.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:
Родитель
23bee250d9
Коммит
5759cf74a6
|
@ -3014,6 +3014,22 @@ void nsWindow::StoreProperty(char *property, unsigned char *data)
|
|||
}
|
||||
|
||||
// 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 */
|
||||
gint
|
||||
nsWindow::DragMotionSignal (GtkWidget * aWidget,
|
||||
|
@ -3091,6 +3107,8 @@ gint nsWindow::OnDragMotionSignal (GtkWidget * aWidget,
|
|||
|
||||
nsMouseEvent event;
|
||||
|
||||
InitDragEvent(event);
|
||||
|
||||
event.message = NS_DRAGDROP_OVER;
|
||||
event.eventStructType = NS_DRAGDROP_EVENT;
|
||||
|
||||
|
@ -3224,6 +3242,8 @@ nsWindow::OnDragDropSignal (GtkWidget *aWidget,
|
|||
|
||||
nsMouseEvent event;
|
||||
|
||||
InitDragEvent(event);
|
||||
|
||||
event.message = NS_DRAGDROP_OVER;
|
||||
event.eventStructType = NS_DRAGDROP_EVENT;
|
||||
event.widget = innerMostWidget;
|
||||
|
@ -3232,6 +3252,8 @@ nsWindow::OnDragDropSignal (GtkWidget *aWidget,
|
|||
|
||||
innerMostWidget->DispatchMouseEvent(event);
|
||||
|
||||
InitDragEvent(event);
|
||||
|
||||
event.message = NS_DRAGDROP_DROP;
|
||||
event.eventStructType = NS_DRAGDROP_EVENT;
|
||||
event.widget = innerMostWidget;
|
||||
|
|
|
@ -221,6 +221,8 @@ protected:
|
|||
static nsWindow *mLastDragMotionWindow;
|
||||
static nsWindow *mLastLeaveWindow;
|
||||
|
||||
void InitDragEvent(nsMouseEvent &aEvent);
|
||||
|
||||
// DragBegin not needed ?
|
||||
// always returns TRUE
|
||||
static gint DragMotionSignal (GtkWidget * aWidget,
|
||||
|
|
Загрузка…
Ссылка в новой задаче