5674: temp fix to prevent dialogs from grabbing selection ownership forever. r=mcafee/a=chofmann

git-svn-id: svn://10.0.0.236/trunk@29803 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
akkana%netscape.com 1999-04-29 20:43:37 +00:00
parent 08aa4877d6
commit 80f6a28c08

View File

@ -141,15 +141,26 @@ nsresult nsClipboard::QueryInterface(const nsIID& aIID, void** aInstancePtr)
void nsClipboard::SetTopLevelWidget(GtkWidget* w)
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SetTopLevelWidget\n");
#endif /* DEBUG_CLIPBOARD */
// Don't set up any more event handlers if we're being called twice
// for the same toplevel widget
if (sWidget == w)
return;
if (sWidget != 0 && sWidget->window != 0)
return;
if (w == 0 || w->window == 0)
{
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SetTopLevelWidget: widget passed in is null or has no window!\n");
#endif /* DEBUG_CLIPBOARD */
return;
}
#ifdef DEBUG_CLIPBOARD
printf(" nsClipboard::SetTopLevelWidget\n");
#endif /* DEBUG_CLIPBOARD */
// If we're changing from one widget to another
// (shouldn't generally happen), clear the old event handlers:
if (sWidget &&