diff --git a/src/kits/interface/PrintJob.cpp b/src/kits/interface/PrintJob.cpp index 0a5ad29f7c..2c5997551c 100644 --- a/src/kits/interface/PrintJob.cpp +++ b/src/kits/interface/PrintJob.cpp @@ -747,12 +747,22 @@ PrintServerMessenger::~PrintServerMessenger() void PrintServerMessenger::RejectUserInput() { + // TODO: This code is sort of a hack: + // It creates a BAlert then moves it out of the screen to + // block user input. fHiddenApplicationModalWindow = new BAlert("bogus", "app_modal", "OK"); - fHiddenApplicationModalWindow->DefaultButton()->SetEnabled(false); - fHiddenApplicationModalWindow->SetDefaultButton(NULL); + BButton* defaultButton = fHiddenApplicationModalWindow->DefaultButton(); + if (defaultButton != NULL) { + // TODO: Doing this is useless, since BAlert now sets its + // default button on Go(). + defaultButton->SetEnabled(false); + fHiddenApplicationModalWindow->SetDefaultButton(NULL); + } fHiddenApplicationModalWindow->SetFlags(fHiddenApplicationModalWindow->Flags() | B_CLOSE_ON_ESCAPE); - fHiddenApplicationModalWindow->MoveTo(-65000, -65000); fHiddenApplicationModalWindow->Go(NULL); + + // Moved here because now BAlert centers itself on screen in Go(). + fHiddenApplicationModalWindow->MoveTo(-65000, -65000); } @@ -867,7 +877,6 @@ PrintServerMessenger::MessengerThread(void* data) return B_ERROR; } - BMessage reply; if (printServer.SendMessage(request, &reply) != B_OK || reply.what != 'okok' ) {