Bug 1212733, cache dnd window state instead of using gtk_window_get_type_hint, r=karlt

This commit is contained in:
Neil Deakin 2015-11-17 07:13:22 -05:00
Родитель a22ff2640a
Коммит 4f9e89b42d
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -423,6 +423,7 @@ nsWindow::nsWindow()
#if GTK_CHECK_VERSION(3,4,0)
mHandleTouchEvent = false;
#endif
mIsDragPopup = false;
mContainer = nullptr;
mGdkWindow = nullptr;
@ -1895,16 +1896,11 @@ nsWindow::CaptureRollupEvents(nsIRollupListener *aListener,
if (aDoCapture) {
gRollupListener = aListener;
// real grab is only done when there is no dragging
if (!nsWindow::DragInProgress()) {
// Maybe the dnd flag is not yet set at this point, but dnd has already started
// so let's be extra careful and skip this operation for dnd popup panels always
// (panels with type="drag").
GdkWindowTypeHint gdkTypeHint = gtk_window_get_type_hint(GTK_WINDOW(mShell));
if (gdkTypeHint != GDK_WINDOW_TYPE_HINT_DND) {
gtk_grab_add(GTK_WIDGET(mContainer));
GrabPointer(GetLastUserInputTime());
}
// Don't add a grab if a drag is in progress, or if the widget is a drag
// feedback popup. (panels with type="drag").
if (!mIsDragPopup && !nsWindow::DragInProgress()) {
gtk_grab_add(GTK_WIDGET(mContainer));
GrabPointer(GetLastUserInputTime());
}
}
else {
@ -3670,6 +3666,7 @@ nsWindow::Create(nsIWidget *aParent,
GdkWindowTypeHint gtkTypeHint;
if (aInitData->mIsDragPopup) {
gtkTypeHint = GDK_WINDOW_TYPE_HINT_DND;
mIsDragPopup = true;
}
else {
switch (aInitData->mPopupHint) {

Просмотреть файл

@ -389,6 +389,8 @@ protected:
// whether we handle touch event
bool mHandleTouchEvent;
#endif
// true if this is a drag and drop feedback popup
bool mIsDragPopup;
private:
void DestroyChildWindows();