зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug #72313. Focus problems on linux. This adds a flag to nsIWidget::SetFocus() that says to raise the window. We only raise the window from one place, window.focus(). This builds and runs on at least linux and the mac. r=jst,brendan,hyatt a=leaf
This commit is contained in:
Родитель
ffc6a23c5a
Коммит
ef1092aba4
|
@ -1647,7 +1647,8 @@ NS_IMETHODIMP GlobalWindowImpl::Focus()
|
|||
nsCOMPtr<nsIWidget> widget;
|
||||
vm->GetWidget(getter_AddRefs(widget));
|
||||
if (widget)
|
||||
result = widget->SetFocus();
|
||||
// raise the window since this was a focus call on the window.
|
||||
result = widget->SetFocus(PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ class nsIWidget : public nsISupports {
|
|||
/**
|
||||
* Give focus to this widget.
|
||||
*/
|
||||
NS_IMETHOD SetFocus(void) = 0;
|
||||
NS_IMETHOD SetFocus(PRBool aRaise = PR_FALSE) = 0;
|
||||
|
||||
/**
|
||||
* Get this widget's outside dimensions relative to its parent widget
|
||||
|
|
|
@ -1048,7 +1048,7 @@ NS_METHOD nsWindow::Enable(PRBool bState)
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::SetFocus(void)
|
||||
NS_METHOD nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
//
|
||||
// Switch to the "main gui thread" if necessary... This method must
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
PRInt32 aHeight,
|
||||
PRBool aRepaint);
|
||||
NS_IMETHOD Enable(PRBool bState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetBounds(nsRect &aRect);
|
||||
NS_IMETHOD GetClientBounds(nsRect &aRect);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
|
|
|
@ -689,7 +689,7 @@ NS_IMETHODIMP nsWidget::Enable(PRBool bState)
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsWidget::SetFocus(void)
|
||||
NS_IMETHODIMP nsWidget::SetFocus(PRBool aRaise)
|
||||
{
|
||||
// call this so that any cleanup will happen that needs to...
|
||||
LoseFocus();
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
PRInt32 aHeight, PRBool aRepaint);
|
||||
|
||||
NS_IMETHOD Enable(PRBool aState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
|
||||
virtual void LoseFocus(void);
|
||||
|
||||
|
|
|
@ -1075,7 +1075,7 @@ NS_IMETHODIMP nsWindow::SetCursor(nsCursor aCursor)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::SetFocus(void)
|
||||
nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
PRBool sendActivate = gJustGotActivate;
|
||||
gJustGotActivate = PR_FALSE;
|
||||
|
@ -1090,7 +1090,7 @@ nsWindow::SetFocus(void)
|
|||
toplevel = gtk_widget_get_toplevel(top_mozarea);
|
||||
|
||||
// map the window if the pref says to
|
||||
if (gRaiseWindows)
|
||||
if (gRaiseWindows && aRaise)
|
||||
GetAttention();
|
||||
|
||||
#ifdef DEBUG_FOCUS
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
NS_IMETHOD InvalidateRegion(const nsIRegion* aRegion, PRBool aIsSynchronous);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetAttention(void);
|
||||
NS_IMETHOD Destroy();
|
||||
|
||||
|
|
|
@ -522,7 +522,7 @@ static Boolean we_are_front_process()
|
|||
// Set the focus on this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsWindow::SetFocus(void)
|
||||
NS_IMETHODIMP nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
gEventDispatchHandler.SetFocus(this);
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY,PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);
|
||||
|
||||
NS_IMETHOD Enable(PRBool bState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD SetBounds(const nsRect &aRect);
|
||||
NS_IMETHOD GetBounds(nsRect &aRect);
|
||||
|
||||
|
|
|
@ -679,7 +679,7 @@ NS_METHOD nsWindow::Enable(PRBool bState)
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::SetFocus(void)
|
||||
NS_METHOD nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
// Go get the parent of all widget's to determine which widget
|
||||
// tree to use to set the focus.
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
PRInt32 aHeight,
|
||||
PRBool aRepaint);
|
||||
NS_IMETHOD Enable(PRBool bState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetBounds(nsRect &aRect);
|
||||
virtual nscolor GetForegroundColor(void);
|
||||
NS_IMETHOD SetForegroundColor(const nscolor &aColor);
|
||||
|
|
|
@ -1251,7 +1251,7 @@ NS_METHOD nsWindow::Enable(PRBool bState)
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::SetFocus(void)
|
||||
NS_METHOD nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
//
|
||||
// Switch to the "main gui thread" if necessary... This method must
|
||||
|
|
|
@ -102,7 +102,7 @@ class nsWindow : public nsBaseWidget,
|
|||
NS_IMETHOD GetClientBounds( nsRect &aRect);
|
||||
NS_IMETHOD GetBorderSize( PRInt32 &aWidth, PRInt32 &aHeight);
|
||||
NS_IMETHOD Enable( PRBool bState);
|
||||
NS_IMETHOD SetFocus();
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD IsVisible( PRBool &aState);
|
||||
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);
|
||||
|
||||
|
|
|
@ -491,7 +491,7 @@ NS_METHOD nsWidget::Enable( PRBool bState ) {
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWidget::SetFocus( void ) {
|
||||
NS_METHOD nsWidget::SetFocus(PRBool aRaise) {
|
||||
|
||||
// call this so that any cleanup will happen that needs to...
|
||||
LooseFocus();
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
PRInt32 aHeight, PRBool aRepaint);
|
||||
|
||||
NS_IMETHOD Enable(PRBool aState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
|
||||
virtual void LooseFocus(void);
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ NS_IMETHODIMP nsWindow::SetBackgroundColor( const nscolor &aColor ) {
|
|||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsWindow::SetFocus( void ) {
|
||||
NS_IMETHODIMP nsWindow::SetFocus(PRBool aRaise) {
|
||||
return nsWidget::SetFocus();
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD InvalidateRegion(const nsIRegion* aRegion, PRBool aIsSynchronous);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetAttention(void);
|
||||
|
||||
NS_IMETHOD Update(void);
|
||||
|
|
|
@ -538,7 +538,7 @@ NS_METHOD nsWidget::Enable(PRBool bState)
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWidget::SetFocus(void)
|
||||
NS_METHOD nsWidget::SetFocus(PRBool aRaise)
|
||||
{
|
||||
PR_LOG(QtWidgetsLM,
|
||||
PR_LOG_DEBUG,
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
PRBool aRepaint);
|
||||
|
||||
NS_IMETHOD Enable(PRBool aState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
|
||||
PRBool OnResize(nsSizeEvent event);
|
||||
virtual PRBool OnResize(nsRect &aRect);
|
||||
|
|
|
@ -152,7 +152,7 @@ NS_METHOD nsWindow::RemoveTooltips()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsWindow::SetFocus()
|
||||
NS_METHOD nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
PR_LOG(QtWidgetsLM,
|
||||
PR_LOG_DEBUG,
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
NS_IMETHOD BeginResizingChildren(void);
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
|
||||
virtual PRBool IsChild() const;
|
||||
virtual PRBool IsPopup() const { return mIsPopup; };
|
||||
|
|
|
@ -1634,7 +1634,7 @@ NS_METHOD nsWindow::Enable(PRBool bState)
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::SetFocus(void)
|
||||
NS_METHOD nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
//
|
||||
// Switch to the "main gui thread" if necessary... This method must
|
||||
|
|
|
@ -236,7 +236,7 @@ public:
|
|||
PRInt32 aHeight,
|
||||
PRBool aRepaint);
|
||||
NS_IMETHOD Enable(PRBool bState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetBounds(nsRect &aRect);
|
||||
NS_IMETHOD GetClientBounds(nsRect &aRect);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
|
|
|
@ -516,7 +516,7 @@ NS_IMETHODIMP nsWidget::Enable(PRBool bState)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWidget::SetFocus(void)
|
||||
NS_IMETHODIMP nsWidget::SetFocus(PRBool aRaise)
|
||||
{
|
||||
|
||||
if (mBaseWindow) {
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
PRBool aRepaint);
|
||||
|
||||
NS_IMETHOD Enable(PRBool bState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD SetName(const char * aName);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
virtual nsIFontMetrics* GetFont(void);
|
||||
|
|
|
@ -322,7 +322,7 @@ NS_IMETHODIMP nsWindow::InvalidateRegion(const nsIRegion* aRegion, PRBool aIsSyn
|
|||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsWindow::SetFocus(void)
|
||||
NS_IMETHODIMP nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
nsEventStatus status;
|
||||
nsGUIEvent event;
|
||||
|
|
|
@ -94,7 +94,7 @@ class nsWindow : public nsWidget
|
|||
PRBool aRepaint);
|
||||
|
||||
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
virtual PRBool OnExpose(nsPaintEvent &event);
|
||||
NS_IMETHOD GetAttention(void);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче