diff --git a/widget/src/xlib/nsAppShell.cpp b/widget/src/xlib/nsAppShell.cpp index 00b78976957..8625703ce70 100644 --- a/widget/src/xlib/nsAppShell.cpp +++ b/widget/src/xlib/nsAppShell.cpp @@ -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; diff --git a/widget/src/xlib/nsWidget.cpp b/widget/src/xlib/nsWidget.cpp index 84bc5ca232d..527af05cc91 100644 --- a/widget/src/xlib/nsWidget.cpp +++ b/widget/src/xlib/nsWidget.cpp @@ -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; diff --git a/widget/src/xlib/nsWidget.h b/widget/src/xlib/nsWidget.h index 31aa8f782bf..53edeeb63be 100644 --- a/widget/src/xlib/nsWidget.h +++ b/widget/src/xlib/nsWidget.h @@ -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; diff --git a/widget/src/xlib/nsWindow.cpp b/widget/src/xlib/nsWindow.cpp index 1f153c463d8..cdc195e54e8 100644 --- a/widget/src/xlib/nsWindow.cpp +++ b/widget/src/xlib/nsWindow.cpp @@ -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;