mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
cocoadisplay: fix unprotected debug/spam prints
This commit is contained in:
parent
2a65f583d0
commit
c85cc8f2e8
@ -230,8 +230,10 @@ begin_frame(FrameMode mode, Thread *current_thread) {
|
|||||||
_context_needs_update = true;
|
_context_needs_update = true;
|
||||||
[cocoagsg->_context setView:_view];
|
[cocoagsg->_context setView:_view];
|
||||||
|
|
||||||
cocoadisplay_cat.spam()
|
if (cocoadisplay_cat.is_spam()) {
|
||||||
<< "Switching context to view " << _view << "\n";
|
cocoadisplay_cat.spam()
|
||||||
|
<< "Switching context to view " << _view << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1070,8 +1072,11 @@ set_properties_now(WindowProperties &properties) {
|
|||||||
frame.origin.x = x;
|
frame.origin.x = x;
|
||||||
frame.origin.y = container.size.height - y - frame.size.height;
|
frame.origin.y = container.size.height - y - frame.size.height;
|
||||||
|
|
||||||
cocoadisplay_cat.debug()
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
<< "Setting window content origin to " << frame.origin.x << ", " << frame.origin.y << "\n";
|
cocoadisplay_cat.debug()
|
||||||
|
<< "Setting window content origin to "
|
||||||
|
<< frame.origin.x << ", " << frame.origin.y << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (_window != nil) {
|
if (_window != nil) {
|
||||||
[_window setFrame:[_window frameRectForContentRect:frame] display:NO];
|
[_window setFrame:[_window frameRectForContentRect:frame] display:NO];
|
||||||
@ -1739,16 +1744,20 @@ handle_close_request() {
|
|||||||
// and process it directly.
|
// and process it directly.
|
||||||
throw_event(close_request_event);
|
throw_event(close_request_event);
|
||||||
|
|
||||||
cocoadisplay_cat.debug()
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
<< "Window requested close. Rejecting, throwing event "
|
cocoadisplay_cat.debug()
|
||||||
<< close_request_event << " instead\n";
|
<< "Window requested close. Rejecting, throwing event "
|
||||||
|
<< close_request_event << " instead\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Prevent the operating system from closing the window.
|
// Prevent the operating system from closing the window.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cocoadisplay_cat.debug()
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
<< "Window requested close, accepting\n";
|
cocoadisplay_cat.debug()
|
||||||
|
<< "Window requested close, accepting\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Let the operating system close the window normally.
|
// Let the operating system close the window normally.
|
||||||
return true;
|
return true;
|
||||||
@ -1759,7 +1768,9 @@ handle_close_request() {
|
|||||||
*/
|
*/
|
||||||
void CocoaGraphicsWindow::
|
void CocoaGraphicsWindow::
|
||||||
handle_close_event() {
|
handle_close_event() {
|
||||||
cocoadisplay_cat.debug() << "Window is about to close\n";
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
|
cocoadisplay_cat.debug() << "Window is about to close\n";
|
||||||
|
}
|
||||||
|
|
||||||
_window = nil;
|
_window = nil;
|
||||||
|
|
||||||
@ -1995,15 +2006,19 @@ handle_mouse_button_event(int button, bool down) {
|
|||||||
_input->button_down(MouseButton::button(button));
|
_input->button_down(MouseButton::button(button));
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
cocoadisplay_cat.spam()
|
if (cocoadisplay_cat.is_spam()) {
|
||||||
<< "Mouse button " << button << " down\n";
|
cocoadisplay_cat.spam()
|
||||||
|
<< "Mouse button " << button << " down\n";
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
_input->button_up(MouseButton::button(button));
|
_input->button_up(MouseButton::button(button));
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
cocoadisplay_cat.spam()
|
if (cocoadisplay_cat.is_spam()) {
|
||||||
<< "Mouse button " << button << " up\n";
|
cocoadisplay_cat.spam()
|
||||||
|
<< "Mouse button " << button << " up\n";
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user