зеркало из https://github.com/mozilla/pjs.git
fix some background color settings, remove something from the event mask
This commit is contained in:
Родитель
5c2933b1c2
Коммит
559b2d4b39
|
@ -119,6 +119,7 @@ NS_METHOD nsAppShell::Create(int* argc, char ** argv)
|
|||
argv[0], XDisplayName(NULL));
|
||||
exit(1);
|
||||
}
|
||||
_Xdebug = 1;
|
||||
gScreenNum = DefaultScreen(gDisplay);
|
||||
gScreen = DefaultScreenOfDisplay(gDisplay);
|
||||
// init the rgb layer. this will provide
|
||||
|
@ -304,7 +305,6 @@ nsAppShell::DispatchEvent(XEvent *event)
|
|||
// switch on the type of event
|
||||
switch (event->type) {
|
||||
case Expose:
|
||||
printf("Handling expose event for window %ld\n", event->xany.window);
|
||||
HandleExposeEvent(event, widget);
|
||||
break;
|
||||
default:
|
||||
|
@ -317,6 +317,8 @@ nsAppShell::DispatchEvent(XEvent *event)
|
|||
void
|
||||
nsAppShell::HandleExposeEvent(XEvent *event, nsWidget *aWidget)
|
||||
{
|
||||
printf("Expose event for window %ld %d %d %d %d\n", event->xany.window,
|
||||
event->xexpose.x, event->xexpose.y, event->xexpose.width, event->xexpose.height);
|
||||
nsPaintEvent pevent;
|
||||
pevent.message = NS_PAINT;
|
||||
pevent.widget = aWidget;
|
||||
|
|
|
@ -52,8 +52,8 @@ nsWidget::nsWidget() : nsBaseWidget()
|
|||
mPreferredWidth = 0;
|
||||
mPreferredHeight = 0;
|
||||
mBaseWindow = 0;
|
||||
bg_rgb = NS_RGB(192,192,192);
|
||||
bg_pixel = xlib_rgb_xpixel_from_rgb(bg_rgb);
|
||||
mBackground = NS_RGB(192,192,192);
|
||||
bg_pixel = xlib_rgb_xpixel_from_rgb(mBackground);
|
||||
border_rgb = NS_RGB(192,192,192);
|
||||
border_pixel = xlib_rgb_xpixel_from_rgb(border_rgb);
|
||||
mGC = 0;
|
||||
|
@ -289,10 +289,8 @@ NS_IMETHODIMP nsWidget::Update()
|
|||
NS_IMETHODIMP nsWidget::SetBackgroundColor(const nscolor &aColor)
|
||||
{
|
||||
printf("nsWidget::SetBackgroundColor()\n");
|
||||
bg_rgb = NS_RGB(NS_GET_R(aColor),
|
||||
NS_GET_G(aColor),
|
||||
NS_GET_B(aColor));
|
||||
bg_pixel = xlib_rgb_xpixel_from_rgb(bg_rgb);
|
||||
nsBaseWidget::SetBackgroundColor(aColor);
|
||||
bg_pixel = xlib_rgb_xpixel_from_rgb(mBackground);
|
||||
// set the window attrib
|
||||
XSetWindowBackground(gDisplay, mBaseWindow, bg_pixel);
|
||||
return NS_OK;
|
||||
|
@ -340,7 +338,7 @@ void nsWidget::CreateNative(Window aParent, nsRect aRect)
|
|||
// be discarded...
|
||||
attr.bit_gravity = NorthWestGravity;
|
||||
// make sure that we listen for events
|
||||
attr.event_mask = SubstructureNotifyMask | StructureNotifyMask | ExposureMask;
|
||||
attr.event_mask = StructureNotifyMask | ExposureMask;
|
||||
// set the default background color and border to that awful gray
|
||||
attr.background_pixel = bg_pixel;
|
||||
attr.border_pixel = border_pixel;
|
||||
|
|
|
@ -116,7 +116,6 @@ protected:
|
|||
|
||||
// All widgets have at least these items.
|
||||
Window mBaseWindow;
|
||||
PRUint32 bg_rgb;
|
||||
unsigned long bg_pixel;
|
||||
PRUint32 border_rgb;
|
||||
unsigned long border_pixel;
|
||||
|
|
|
@ -53,7 +53,7 @@ nsWindow::CreateNative(Window aParent, nsRect aRect)
|
|||
// be discarded...
|
||||
attr.bit_gravity = NorthWestGravity;
|
||||
// make sure that we listen for events
|
||||
attr.event_mask = SubstructureNotifyMask | StructureNotifyMask | ExposureMask;
|
||||
attr.event_mask = StructureNotifyMask | ExposureMask;
|
||||
// set the default background color and border to that awful gray
|
||||
attr.background_pixel = bg_pixel;
|
||||
attr.border_pixel = border_pixel;
|
||||
|
|
Загрузка…
Ссылка в новой задаче