fix bug #14131. popup windows on modal dialogs should work now.

This commit is contained in:
blizzard%redhat.com 1999-11-23 20:55:57 +00:00
Родитель e8cb5d3991
Коммит fa38f78ee9
3 изменённых файлов: 23 добавлений и 8 удалений

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

@ -843,6 +843,9 @@ handle_gdk_event (GdkEvent *event, gpointer data)
nsWindow *window = (nsWindow *)gtk_object_get_data (object, "nsWindow"); nsWindow *window = (nsWindow *)gtk_object_get_data (object, "nsWindow");
GtkWidget *current_grab = gtk_grab_get_current(); GtkWidget *current_grab = gtk_grab_get_current();
if (window->GrabInProgress()) {
goto handle_as_superwin;
}
if (current_grab) { if (current_grab) {
// walk up the list of our parents looking for the widget. // 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 // this is the nsWindow with the focus
nsWindow *nsWindow::focusWindow = NULL; nsWindow *nsWindow::focusWindow = NULL;
// are we grabbing?
PRBool nsWindow::mIsGrabbing = PR_FALSE;
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// //
@ -390,11 +392,12 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener,
} }
else else
{ {
int ret = gdk_pointer_grab (GDK_SUPERWIN(mSuperWin)->bin_window, PR_TRUE,(GdkEventMask) mIsGrabbing = PR_TRUE;
(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | int ret = gdk_pointer_grab (GDK_SUPERWIN(mSuperWin)->bin_window, PR_TRUE,(GdkEventMask)
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK), GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
(GdkWindow*)NULL, cursor, GDK_CURRENT_TIME); GDK_POINTER_MOTION_MASK),
(GdkWindow*)NULL, cursor, GDK_CURRENT_TIME);
#ifdef DEBUG_pavlov #ifdef DEBUG_pavlov
printf("pointer grab returned %i\n", ret); printf("pointer grab returned %i\n", ret);
#endif #endif
@ -406,6 +409,7 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener,
#ifdef DEBUG_pavlov #ifdef DEBUG_pavlov
printf("ungrabbing widget\n"); printf("ungrabbing widget\n");
#endif #endif
mIsGrabbing = PR_FALSE;
gdk_pointer_ungrab(GDK_CURRENT_TIME); gdk_pointer_ungrab(GDK_CURRENT_TIME);
// gtk_grab_remove(grabWidget); // gtk_grab_remove(grabWidget);
} }
@ -1775,7 +1779,7 @@ NS_IMETHODIMP nsWindow::Show(PRBool bState)
{ {
gtk_widget_hide(mShell); gtk_widget_hide(mShell);
gtk_widget_hide(mMozArea); gtk_widget_hide(mMozArea);
gtk_widget_unmap(mShell); //gtk_widget_unmap(mShell);
} }
// For some strange reason, gtk_widget_hide() does not seem to // 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); // gtk_widget_unmap(mWidget);
} }
mShown = bState;
return NS_OK; return NS_OK;
} }
@ -2497,6 +2499,11 @@ nsWindow::GetMozArea()
return (GtkWidget *)mMozAreaClosestParent; return (GtkWidget *)mMozAreaClosestParent;
} }
PRBool
nsWindow::GrabInProgress(void)
{
return nsWindow::mIsGrabbing;
}
/* virtual */ GdkWindow * /* virtual */ GdkWindow *
nsWindow::GetRenderWindow(GtkObject * aGtkObject) nsWindow::GetRenderWindow(GtkObject * aGtkObject)

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

@ -135,6 +135,9 @@ public:
// Return the Gdk window used for rendering // Return the Gdk window used for rendering
virtual GdkWindow * GetRenderWindow(GtkObject * aGtkWidget); virtual GdkWindow * GetRenderWindow(GtkObject * aGtkWidget);
// grab in progress
PRBool GrabInProgress(void);
// XXX Chris - fix these // XXX Chris - fix these
// virtual void OnButtonPressSignal(GdkEventButton * aGdkButtonEvent); // virtual void OnButtonPressSignal(GdkEventButton * aGdkButtonEvent);
@ -187,6 +190,8 @@ protected:
GtkWidget *mMozAreaClosestParent; GtkWidget *mMozAreaClosestParent;
nsIMenuBar *mMenuBar; nsIMenuBar *mMenuBar;
// are we doing a grab?
static PRBool mIsGrabbing;
private: private:
nsresult SetIcon(GdkPixmap *window_pixmap, nsresult SetIcon(GdkPixmap *window_pixmap,
GdkBitmap *window_mask); GdkBitmap *window_mask);