зеркало из https://github.com/mozilla/pjs.git
fix bug #14131. popup windows on modal dialogs should work now.
This commit is contained in:
Родитель
e8cb5d3991
Коммит
fa38f78ee9
|
@ -843,6 +843,9 @@ handle_gdk_event (GdkEvent *event, gpointer data)
|
|||
|
||||
nsWindow *window = (nsWindow *)gtk_object_get_data (object, "nsWindow");
|
||||
GtkWidget *current_grab = gtk_grab_get_current();
|
||||
if (window->GrabInProgress()) {
|
||||
goto handle_as_superwin;
|
||||
}
|
||||
|
||||
if (current_grab) {
|
||||
// walk up the list of our parents looking for the widget.
|
||||
|
|
|
@ -59,6 +59,8 @@ gint handle_toplevel_focus_out(
|
|||
|
||||
// this is the nsWindow with the focus
|
||||
nsWindow *nsWindow::focusWindow = NULL;
|
||||
// are we grabbing?
|
||||
PRBool nsWindow::mIsGrabbing = PR_FALSE;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -390,11 +392,12 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener,
|
|||
}
|
||||
else
|
||||
{
|
||||
int ret = gdk_pointer_grab (GDK_SUPERWIN(mSuperWin)->bin_window, PR_TRUE,(GdkEventMask)
|
||||
(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
|
||||
GDK_POINTER_MOTION_MASK),
|
||||
(GdkWindow*)NULL, cursor, GDK_CURRENT_TIME);
|
||||
mIsGrabbing = PR_TRUE;
|
||||
int ret = gdk_pointer_grab (GDK_SUPERWIN(mSuperWin)->bin_window, PR_TRUE,(GdkEventMask)
|
||||
(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
|
||||
GDK_POINTER_MOTION_MASK),
|
||||
(GdkWindow*)NULL, cursor, GDK_CURRENT_TIME);
|
||||
#ifdef DEBUG_pavlov
|
||||
printf("pointer grab returned %i\n", ret);
|
||||
#endif
|
||||
|
@ -406,6 +409,7 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener,
|
|||
#ifdef DEBUG_pavlov
|
||||
printf("ungrabbing widget\n");
|
||||
#endif
|
||||
mIsGrabbing = PR_FALSE;
|
||||
gdk_pointer_ungrab(GDK_CURRENT_TIME);
|
||||
// gtk_grab_remove(grabWidget);
|
||||
}
|
||||
|
@ -1775,7 +1779,7 @@ NS_IMETHODIMP nsWindow::Show(PRBool bState)
|
|||
{
|
||||
gtk_widget_hide(mShell);
|
||||
gtk_widget_hide(mMozArea);
|
||||
gtk_widget_unmap(mShell);
|
||||
//gtk_widget_unmap(mShell);
|
||||
}
|
||||
|
||||
// For some strange reason, gtk_widget_hide() does not seem to
|
||||
|
@ -1783,8 +1787,6 @@ NS_IMETHODIMP nsWindow::Show(PRBool bState)
|
|||
// gtk_widget_unmap(mWidget);
|
||||
}
|
||||
|
||||
mShown = bState;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2497,6 +2499,11 @@ nsWindow::GetMozArea()
|
|||
return (GtkWidget *)mMozAreaClosestParent;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsWindow::GrabInProgress(void)
|
||||
{
|
||||
return nsWindow::mIsGrabbing;
|
||||
}
|
||||
|
||||
/* virtual */ GdkWindow *
|
||||
nsWindow::GetRenderWindow(GtkObject * aGtkObject)
|
||||
|
|
|
@ -135,6 +135,9 @@ public:
|
|||
|
||||
// Return the Gdk window used for rendering
|
||||
virtual GdkWindow * GetRenderWindow(GtkObject * aGtkWidget);
|
||||
|
||||
// grab in progress
|
||||
PRBool GrabInProgress(void);
|
||||
// XXX Chris - fix these
|
||||
// virtual void OnButtonPressSignal(GdkEventButton * aGdkButtonEvent);
|
||||
|
||||
|
@ -187,6 +190,8 @@ protected:
|
|||
GtkWidget *mMozAreaClosestParent;
|
||||
|
||||
nsIMenuBar *mMenuBar;
|
||||
// are we doing a grab?
|
||||
static PRBool mIsGrabbing;
|
||||
private:
|
||||
nsresult SetIcon(GdkPixmap *window_pixmap,
|
||||
GdkBitmap *window_mask);
|
||||
|
|
Загрузка…
Ссылка в новой задаче