mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1149041 - Make nsIWidget::SizeConstraints use LayoutDeviceIntSize instead of unit-less nsIntSize. r=roc
This commit is contained in:
parent
e2ec4cc5dc
commit
bea9838586
@ -669,12 +669,12 @@ void nsContainerFrame::SetSizeConstraints(nsPresContext* aPresContext,
|
||||
const nsSize& aMinSize,
|
||||
const nsSize& aMaxSize)
|
||||
{
|
||||
nsIntSize devMinSize(aPresContext->AppUnitsToDevPixels(aMinSize.width),
|
||||
aPresContext->AppUnitsToDevPixels(aMinSize.height));
|
||||
nsIntSize devMaxSize(aMaxSize.width == NS_INTRINSICSIZE ? NS_MAXSIZE :
|
||||
aPresContext->AppUnitsToDevPixels(aMaxSize.width),
|
||||
aMaxSize.height == NS_INTRINSICSIZE ? NS_MAXSIZE :
|
||||
aPresContext->AppUnitsToDevPixels(aMaxSize.height));
|
||||
LayoutDeviceIntSize devMinSize(aPresContext->AppUnitsToDevPixels(aMinSize.width),
|
||||
aPresContext->AppUnitsToDevPixels(aMinSize.height));
|
||||
LayoutDeviceIntSize devMaxSize(aMaxSize.width == NS_INTRINSICSIZE ? NS_MAXSIZE :
|
||||
aPresContext->AppUnitsToDevPixels(aMaxSize.width),
|
||||
aMaxSize.height == NS_INTRINSICSIZE ? NS_MAXSIZE :
|
||||
aPresContext->AppUnitsToDevPixels(aMaxSize.height));
|
||||
|
||||
// MinSize has a priority over MaxSize
|
||||
if (devMinSize.width > devMaxSize.width)
|
||||
|
@ -4089,14 +4089,14 @@ nsWindow::SetHasMappedToplevel(bool aState)
|
||||
}
|
||||
}
|
||||
|
||||
nsIntSize
|
||||
nsWindow::GetSafeWindowSize(nsIntSize aSize)
|
||||
LayoutDeviceIntSize
|
||||
nsWindow::GetSafeWindowSize(LayoutDeviceIntSize aSize)
|
||||
{
|
||||
// The X protocol uses CARD32 for window sizes, but the server (1.11.3)
|
||||
// reads it as CARD16. Sizes of pixmaps, used for drawing, are (unsigned)
|
||||
// CARD16 in the protocol, but the server's ProcCreatePixmap returns
|
||||
// BadAlloc if dimensions cannot be represented by signed shorts.
|
||||
nsIntSize result = aSize;
|
||||
LayoutDeviceIntSize result = aSize;
|
||||
const int32_t kInt16Max = 32767;
|
||||
if (result.width > kInt16Max) {
|
||||
result.width = kInt16Max;
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#include "prlog.h"
|
||||
#include "nsTArray.h"
|
||||
#include "Units.h"
|
||||
|
||||
extern PRLogModuleInfo *gWidgetLog;
|
||||
extern PRLogModuleInfo *gWidgetFocusLog;
|
||||
@ -211,7 +212,7 @@ private:
|
||||
|
||||
void NativeShow (bool aAction);
|
||||
void SetHasMappedToplevel(bool aState);
|
||||
nsIntSize GetSafeWindowSize(nsIntSize aSize);
|
||||
mozilla::LayoutDeviceIntSize GetSafeWindowSize(mozilla::LayoutDeviceIntSize aSize);
|
||||
|
||||
void EnsureGrabs (void);
|
||||
void GrabPointer (guint32 aTime);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "Units.h"
|
||||
#include "mozilla/gfx/Point.h"
|
||||
#include "Units.h"
|
||||
|
||||
// forward declarations
|
||||
class nsFontMetrics;
|
||||
@ -545,15 +546,15 @@ struct SizeConstraints {
|
||||
{
|
||||
}
|
||||
|
||||
SizeConstraints(nsIntSize aMinSize,
|
||||
nsIntSize aMaxSize)
|
||||
SizeConstraints(mozilla::LayoutDeviceIntSize aMinSize,
|
||||
mozilla::LayoutDeviceIntSize aMaxSize)
|
||||
: mMinSize(aMinSize),
|
||||
mMaxSize(aMaxSize)
|
||||
{
|
||||
}
|
||||
|
||||
nsIntSize mMinSize;
|
||||
nsIntSize mMaxSize;
|
||||
mozilla::LayoutDeviceIntSize mMinSize;
|
||||
mozilla::LayoutDeviceIntSize mMaxSize;
|
||||
};
|
||||
|
||||
// IMEMessage is shared by IMEStateManager and TextComposition.
|
||||
|
Loading…
Reference in New Issue
Block a user