diff --git a/src/preferences/fonts/MainWindow.cpp b/src/preferences/fonts/MainWindow.cpp index d45b62f83d..52335a2e1e 100644 --- a/src/preferences/fonts/MainWindow.cpp +++ b/src/preferences/fonts/MainWindow.cpp @@ -36,8 +36,7 @@ static const uint32 kMsgCheckFonts = 'chkf'; MainWindow::MainWindow() : BWindow(BRect(0, 0, 1, 1), "Fonts", B_TITLED_WINDOW, - B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS), - fCentered(false) + B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS) { fDefaultsButton = new BButton("defaults", "Defaults", new BMessage(kMsgSetDefaults), B_WILL_DRAW); @@ -77,19 +76,14 @@ MainWindow::MainWindow() if (fSettings.WindowCorner() == BPoint(-1, -1)) { // center window on screen - fCentered = true; + CenterOnScreen(); } else { MoveTo(fSettings.WindowCorner()); // make sure window is on screen BScreen screen(this); if (!screen.Frame().InsetByCopy(10, 10).Intersects(Frame())) - fCentered = true; - } - - if (fCentered) { - // draw offscreen to avoid flashing windows - MoveTo(BPoint(-1000, -1000)); + CenterOnScreen(); } fRunner = new BMessageRunner(this, new BMessage(kMsgCheckFonts), 3000000); @@ -99,16 +93,6 @@ MainWindow::MainWindow() } -void -MainWindow::Show() -{ - BWindow::Show(); - - if (fCentered) - _Center(); -} - - MainWindow::~MainWindow() { delete fRunner; diff --git a/src/preferences/fonts/MainWindow.h b/src/preferences/fonts/MainWindow.h index c14a9b8c89..8fb1ada1ab 100644 --- a/src/preferences/fonts/MainWindow.h +++ b/src/preferences/fonts/MainWindow.h @@ -27,14 +27,11 @@ public: virtual bool QuitRequested(); virtual void MessageReceived(BMessage *message); - virtual void Show(); private: void _Center(); - bool fCentered; - BMessageRunner* fRunner; FontView* fFontsView; BButton* fDefaultsButton;