mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
make sure to set the border pixel for created windows to avoid bad_match errors. patch from Tim Rowley <tor@cs.brown.edu>.
This commit is contained in:
parent
334455c2f7
commit
026327ef2b
@ -54,6 +54,8 @@ nsWidget::nsWidget() : nsBaseWidget()
|
||||
mBaseWindow = 0;
|
||||
bg_rgb = NS_RGB(192,192,192);
|
||||
bg_pixel = xlib_rgb_xpixel_from_rgb(bg_rgb);
|
||||
border_rgb = NS_RGB(192,192,192);
|
||||
border_pixel = xlib_rgb_xpixel_from_rgb(border_rgb);
|
||||
mGC = 0;
|
||||
parentWidget = nsnull;
|
||||
name = "unnamed";
|
||||
@ -339,12 +341,13 @@ void nsWidget::CreateNative(Window aParent, nsRect aRect)
|
||||
attr.bit_gravity = NorthWestGravity;
|
||||
// make sure that we listen for events
|
||||
attr.event_mask = SubstructureNotifyMask | StructureNotifyMask | ExposureMask;
|
||||
// set the default background color to that awful gray
|
||||
// set the default background color and border to that awful gray
|
||||
attr.background_pixel = bg_pixel;
|
||||
attr.border_pixel = border_pixel;
|
||||
// set the colormap
|
||||
attr.colormap = xlib_rgb_get_cmap();
|
||||
// here's what's in the struct
|
||||
attr_mask = CWBitGravity | CWEventMask | CWBackPixel;
|
||||
attr_mask = CWBitGravity | CWEventMask | CWBackPixel | CWBorderPixel;
|
||||
// check to see if there was actually a colormap.
|
||||
if (attr.colormap)
|
||||
attr_mask |= CWColormap;
|
||||
|
@ -118,6 +118,8 @@ protected:
|
||||
Window mBaseWindow;
|
||||
PRUint32 bg_rgb;
|
||||
unsigned long bg_pixel;
|
||||
PRUint32 border_rgb;
|
||||
unsigned long border_pixel;
|
||||
GC mGC; // until we get gc pooling working...
|
||||
const char *name; // name of the type of widget
|
||||
};
|
||||
|
@ -54,12 +54,13 @@ nsWindow::CreateNative(Window aParent, nsRect aRect)
|
||||
attr.bit_gravity = NorthWestGravity;
|
||||
// make sure that we listen for events
|
||||
attr.event_mask = SubstructureNotifyMask | StructureNotifyMask | ExposureMask;
|
||||
// set the default background color to that awful gray
|
||||
// set the default background color and border to that awful gray
|
||||
attr.background_pixel = bg_pixel;
|
||||
attr.border_pixel = border_pixel;
|
||||
// set the colormap
|
||||
attr.colormap = xlib_rgb_get_cmap();
|
||||
// here's what's in the struct
|
||||
attr_mask = CWBitGravity | CWEventMask | CWBackPixel;
|
||||
attr_mask = CWBitGravity | CWEventMask | CWBackPixel | CWBorderPixel;
|
||||
// check to see if there was actually a colormap.
|
||||
if (attr.colormap)
|
||||
attr_mask |= CWColormap;
|
||||
|
Loading…
x
Reference in New Issue
Block a user