зеркало из https://github.com/mozilla/gecko-dev.git
checking in patch for Roland Mainz. r=ssu. not part of normal build process
This commit is contained in:
Родитель
6d2c574fa8
Коммит
19b68aa176
|
@ -140,7 +140,7 @@ nsEventStatus PR_CALLBACK nsClipboard::Callback(nsGUIEvent *event) {
|
|||
|
||||
// Get the data from the Transferable
|
||||
|
||||
char *dataFlavor = kUnicodeMime;
|
||||
const char *dataFlavor = kUnicodeMime;
|
||||
nsCOMPtr<nsISupports> genDataWrapper;
|
||||
nsresult rv;
|
||||
PRUint32 dataLength;
|
||||
|
@ -328,7 +328,7 @@ NS_IMETHODIMP nsClipboard::GetData(nsITransferable *aTransferable,
|
|||
// internally, otherwise get the data from the X server
|
||||
|
||||
if (XGetSelectionOwner(sDisplay, XA_PRIMARY) == sWindow) {
|
||||
char *dataFlavor = kUnicodeMime;
|
||||
const char *dataFlavor = kUnicodeMime;
|
||||
nsCOMPtr<nsISupports> genDataWrapper;
|
||||
nsresult rv;
|
||||
PRUint32 dataLength;
|
||||
|
|
|
@ -221,11 +221,16 @@ nsWindow::nsWindow() : nsWidget()
|
|||
mWindowType = eWindowType_child;
|
||||
mBorderStyle = eBorderStyle_default;
|
||||
mIsToplevel = PR_FALSE;
|
||||
|
||||
mScrollGC = nsnull;
|
||||
}
|
||||
|
||||
|
||||
nsWindow::~nsWindow()
|
||||
{
|
||||
if (mScrollGC)
|
||||
XFreeGC(mDisplay, mScrollGC);
|
||||
|
||||
// Release grab
|
||||
if (sGrabWindow == this)
|
||||
{
|
||||
|
@ -399,10 +404,7 @@ NS_IMETHODIMP nsWindow::SetFocus(PRBool aRaise)
|
|||
DispatchEvent(&event, status);
|
||||
Release();
|
||||
|
||||
|
||||
|
||||
event.message = NS_ACTIVATE;
|
||||
|
||||
event.widget = this;
|
||||
event.eventStructType = NS_GUI_EVENT;
|
||||
event.time = 0;
|
||||
|
@ -460,10 +462,11 @@ NS_IMETHODIMP nsWindow::Resize(PRInt32 aWidth,
|
|||
nsWidget::Resize(aWidth, aHeight, aRepaint);
|
||||
|
||||
nsSizeEvent sevent;
|
||||
nsRect sevent_windowSize(0, 0, aWidth, aHeight);
|
||||
sevent.message = NS_SIZE;
|
||||
sevent.widget = this;
|
||||
sevent.eventStructType = NS_SIZE_EVENT;
|
||||
sevent.windowSize = new nsRect (0, 0, aWidth, aHeight);
|
||||
sevent.windowSize = &sevent_windowSize;
|
||||
sevent.point.x = 0;
|
||||
sevent.point.y = 0;
|
||||
sevent.mWinWidth = aWidth;
|
||||
|
@ -472,7 +475,6 @@ NS_IMETHODIMP nsWindow::Resize(PRInt32 aWidth,
|
|||
AddRef();
|
||||
OnResize(sevent);
|
||||
Release();
|
||||
delete sevent.windowSize;
|
||||
|
||||
if (NeedToShow)
|
||||
Show(PR_TRUE);
|
||||
|
@ -499,10 +501,11 @@ NS_IMETHODIMP nsWindow::Resize(PRInt32 aX,
|
|||
nsWidget::Resize(aX, aY, aWidth, aHeight, aRepaint);
|
||||
|
||||
nsSizeEvent sevent;
|
||||
nsRect sevent_windowSize(0, 0, aWidth, aHeight);
|
||||
sevent.message = NS_SIZE;
|
||||
sevent.widget = this;
|
||||
sevent.eventStructType = NS_SIZE_EVENT;
|
||||
sevent.windowSize = new nsRect (0, 0, aWidth, aHeight);
|
||||
sevent.windowSize = &sevent_windowSize;
|
||||
sevent.point.x = 0;
|
||||
sevent.point.y = 0;
|
||||
sevent.mWinWidth = aWidth;
|
||||
|
@ -511,7 +514,6 @@ NS_IMETHODIMP nsWindow::Resize(PRInt32 aX,
|
|||
AddRef();
|
||||
OnResize(sevent);
|
||||
Release();
|
||||
delete sevent.windowSize;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -552,7 +554,6 @@ NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous)
|
|||
else
|
||||
QueueDraw();
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -657,8 +658,10 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
|||
|
||||
PRInt32 srcX = 0, srcY = 0, destX = 0, destY = 0, width = 0, height = 0;
|
||||
nsRect aRect;
|
||||
GC gc;
|
||||
gc = XCreateGC(mDisplay, mBaseWindow, 0, NULL);
|
||||
|
||||
/* only create GC for scolling once ... */
|
||||
if (!mScrollGC)
|
||||
mScrollGC = XCreateGC(mDisplay, mBaseWindow, 0, nsnull);
|
||||
|
||||
if (aDx < 0 || aDy < 0)
|
||||
{
|
||||
|
@ -668,8 +671,8 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
|||
destY = mBounds.y;
|
||||
width = mBounds.width - ABS(aDx);
|
||||
height = mBounds.height - ABS(aDy);
|
||||
} else
|
||||
if (aDx > 0 || aDy > 0)
|
||||
}
|
||||
else if (aDx > 0 || aDy > 0)
|
||||
{
|
||||
srcX = mBounds.x;
|
||||
srcY = mBounds.y;
|
||||
|
@ -679,11 +682,9 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
|||
height = mBounds.height - ABS(aDy);
|
||||
}
|
||||
|
||||
XCopyArea(mDisplay, mBaseWindow, mBaseWindow, gc,
|
||||
XCopyArea(mDisplay, mBaseWindow, mBaseWindow, mScrollGC,
|
||||
srcX, srcY, width, height, destX, destY);
|
||||
|
||||
XFreeGC(mDisplay, gc);
|
||||
|
||||
width = mBounds.width;
|
||||
height = mBounds.height;
|
||||
|
||||
|
|
|
@ -129,6 +129,8 @@ protected:
|
|||
PRBool mBlockFocusEvents;
|
||||
PRBool mIsTooSmall;
|
||||
|
||||
GC mScrollGC; // GC used by nsWindow::Scroll()
|
||||
|
||||
static PRBool sIsGrabbing;
|
||||
static nsWindow *sGrabWindow;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче