mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Changes to help support focus and window embeding in parent
This commit is contained in:
parent
80d18524aa
commit
6b968ee0ee
@ -1852,8 +1852,6 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
|||||||
// on may be lost.
|
// on may be lost.
|
||||||
_lost_keypresses = true;
|
_lost_keypresses = true;
|
||||||
}
|
}
|
||||||
properties.set_foreground(false);
|
|
||||||
system_changed_properties(properties);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
@ -1881,9 +1879,30 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
|
|||||||
windisplay_cat.debug()
|
windisplay_cat.debug()
|
||||||
<< "setfocus\n";
|
<< "setfocus\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_lost_keypresses) {
|
||||||
|
resend_lost_keypresses();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case PM_ACTIVE:
|
||||||
|
if (windisplay_cat.is_debug()) {
|
||||||
|
windisplay_cat.debug()
|
||||||
|
<< "PM_ACTIVE\n";
|
||||||
|
}
|
||||||
properties.set_foreground(true);
|
properties.set_foreground(true);
|
||||||
system_changed_properties(properties);
|
system_changed_properties(properties);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PM_INACTIVE:
|
||||||
|
if (windisplay_cat.is_debug()) {
|
||||||
|
windisplay_cat.debug()
|
||||||
|
<< "PM_INACTIVE\n";
|
||||||
|
}
|
||||||
|
properties.set_foreground(false);
|
||||||
|
system_changed_properties(properties);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefWindowProc(hwnd, msg, wparam, lparam);
|
return DefWindowProc(hwnd, msg, wparam, lparam);
|
||||||
@ -1976,7 +1995,15 @@ resend_lost_keypresses() {
|
|||||||
<< "key has gone down: " << i << " (" << lookup_key(i) << ")\n";
|
<< "key has gone down: " << i << " (" << lookup_key(i) << ")\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_keyresume(lookup_key(i), message_time);
|
// Roger
|
||||||
|
//handle_keyresume(lookup_key(i), message_time);
|
||||||
|
// resume does not seem to work and sending the pointer position seems to
|
||||||
|
// weird ot some cursor controls
|
||||||
|
ButtonHandle key = lookup_key(i);
|
||||||
|
if (key != ButtonHandle::none())
|
||||||
|
_input_devices[0].button_down(key, message_time);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// The key is now released.
|
// The key is now released.
|
||||||
if (windisplay_cat.is_debug()) {
|
if (windisplay_cat.is_debug()) {
|
||||||
|
@ -26,6 +26,10 @@
|
|||||||
|
|
||||||
class WinGraphicsPipe;
|
class WinGraphicsPipe;
|
||||||
|
|
||||||
|
#define PM_ACTIVE (WM_APP+123)
|
||||||
|
#define PM_INACTIVE (WM_APP+124)
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Class : WinGraphicsWindow
|
// Class : WinGraphicsWindow
|
||||||
// Description : An abstract base class for glGraphicsWindow and
|
// Description : An abstract base class for glGraphicsWindow and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user