mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
programmatic control of minimize/restore state
This commit is contained in:
parent
d906bb1959
commit
03a030532f
@ -1116,7 +1116,13 @@ os_open_window(WindowProperties &req_properties) {
|
|||||||
SetFrontProcess(&psn);
|
SetFrontProcess(&psn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req_properties.has_fullscreen() && req_properties.get_fullscreen()) {
|
bool wants_fullscreen = req_properties.has_fullscreen() && req_properties.get_fullscreen();
|
||||||
|
if (req_properties.get_minimized()) {
|
||||||
|
// A minimized window can't be fullscreen.
|
||||||
|
wants_fullscreen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wants_fullscreen) {
|
||||||
if (osxdisplay_cat.is_debug()) {
|
if (osxdisplay_cat.is_debug()) {
|
||||||
osxdisplay_cat.debug()
|
osxdisplay_cat.debug()
|
||||||
<< "Creating full screen\n";
|
<< "Creating full screen\n";
|
||||||
@ -1157,7 +1163,10 @@ os_open_window(WindowProperties &req_properties) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_properties.set_fullscreen(true);
|
_properties.set_fullscreen(true);
|
||||||
_is_fullscreen =true;
|
_properties.set_minimized(false);
|
||||||
|
_properties.set_foreground(true);
|
||||||
|
|
||||||
|
_is_fullscreen = true;
|
||||||
full_screen_window = this;
|
full_screen_window = this;
|
||||||
req_properties.clear_fullscreen();
|
req_properties.clear_fullscreen();
|
||||||
|
|
||||||
@ -1320,6 +1329,16 @@ os_open_window(WindowProperties &req_properties) {
|
|||||||
_properties.set_undecorated(req_properties.get_undecorated());
|
_properties.set_undecorated(req_properties.get_undecorated());
|
||||||
req_properties.clear_undecorated();
|
req_properties.clear_undecorated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_properties.set_minimized(false);
|
||||||
|
_properties.set_foreground(true);
|
||||||
|
|
||||||
|
if (req_properties.has_minimized()) {
|
||||||
|
CollapseWindow(_osx_window, req_properties.get_minimized());
|
||||||
|
_properties.set_minimized(req_properties.get_minimized());
|
||||||
|
_properties.set_foreground(!req_properties.get_minimized());
|
||||||
|
req_properties.clear_minimized();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now measure the size and placement of the window we
|
// Now measure the size and placement of the window we
|
||||||
@ -1335,8 +1354,6 @@ os_open_window(WindowProperties &req_properties) {
|
|||||||
set_icon_filename(req_properties.get_icon_filename());
|
set_icon_filename(req_properties.get_icon_filename());
|
||||||
}
|
}
|
||||||
|
|
||||||
_properties.set_foreground(true);
|
|
||||||
_properties.set_minimized(false);
|
|
||||||
_properties.set_open(true);
|
_properties.set_open(true);
|
||||||
|
|
||||||
if (_properties.has_size()) {
|
if (_properties.has_size()) {
|
||||||
@ -1951,6 +1968,13 @@ set_properties_now(WindowProperties &properties) {
|
|||||||
need_full_rebuild = true;
|
need_full_rebuild = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are fullscreen and requesting a minimize change
|
||||||
|
if (_properties.get_fullscreen() &&
|
||||||
|
(properties.has_minimized() &&
|
||||||
|
(properties.get_minimized() != _properties.get_minimized()))) {
|
||||||
|
need_full_rebuild = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (need_full_rebuild) {
|
if (need_full_rebuild) {
|
||||||
// Logic here is .. take a union of the properties .. with the
|
// Logic here is .. take a union of the properties .. with the
|
||||||
// new allowed to overwrite the old states. and start a bootstrap
|
// new allowed to overwrite the old states. and start a bootstrap
|
||||||
@ -2010,6 +2034,13 @@ set_properties_now(WindowProperties &properties) {
|
|||||||
properties.clear_cursor_hidden();
|
properties.clear_cursor_hidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (properties.has_minimized()) {
|
||||||
|
if (_properties.get_minimized() != properties.get_minimized()) {
|
||||||
|
CollapseWindow(_osx_window, properties.get_minimized());
|
||||||
|
}
|
||||||
|
properties.clear_minimized();
|
||||||
|
}
|
||||||
|
|
||||||
if (osxdisplay_cat.is_debug()) {
|
if (osxdisplay_cat.is_debug()) {
|
||||||
osxdisplay_cat.debug()
|
osxdisplay_cat.debug()
|
||||||
<< "set_properties_now Out....." << _properties << "\n";
|
<< "set_properties_now Out....." << _properties << "\n";
|
||||||
|
@ -889,7 +889,14 @@ bool TinyOsxGraphicsWindow::OSOpenWindow(WindowProperties &req_properties) {
|
|||||||
SetFrontProcess(&psn);
|
SetFrontProcess(&psn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req_properties.has_fullscreen() && req_properties.get_fullscreen()) {
|
|
||||||
|
bool wants_fullscreen = req_properties.has_fullscreen() && req_properties.get_fullscreen();
|
||||||
|
if (req_properties.get_minimized()) {
|
||||||
|
// A minimized window can't be fullscreen.
|
||||||
|
wants_fullscreen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wants_fullscreen) {
|
||||||
tinydisplay_cat.info() << "Creating full screen\n";
|
tinydisplay_cat.info() << "Creating full screen\n";
|
||||||
|
|
||||||
// capture the main display
|
// capture the main display
|
||||||
@ -916,6 +923,9 @@ bool TinyOsxGraphicsWindow::OSOpenWindow(WindowProperties &req_properties) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_properties.set_fullscreen(true);
|
_properties.set_fullscreen(true);
|
||||||
|
_properties.set_minimized(false);
|
||||||
|
_properties.set_foreground(true);
|
||||||
|
|
||||||
_is_fullscreen = true;
|
_is_fullscreen = true;
|
||||||
FullScreenWindow = this;
|
FullScreenWindow = this;
|
||||||
req_properties.clear_fullscreen();
|
req_properties.clear_fullscreen();
|
||||||
@ -1068,6 +1078,16 @@ bool TinyOsxGraphicsWindow::OSOpenWindow(WindowProperties &req_properties) {
|
|||||||
_properties.set_undecorated(req_properties.get_undecorated());
|
_properties.set_undecorated(req_properties.get_undecorated());
|
||||||
req_properties.clear_undecorated();
|
req_properties.clear_undecorated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_properties.set_minimized(false);
|
||||||
|
_properties.set_foreground(true);
|
||||||
|
|
||||||
|
if (req_properties.has_minimized()) {
|
||||||
|
CollapseWindow(_osx_window, req_properties.get_minimized());
|
||||||
|
_properties.set_minimized(req_properties.get_minimized());
|
||||||
|
_properties.set_foreground(!req_properties.get_minimized());
|
||||||
|
req_properties.clear_minimized();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now measure the size and placement of the window we
|
// Now measure the size and placement of the window we
|
||||||
@ -1084,8 +1104,6 @@ bool TinyOsxGraphicsWindow::OSOpenWindow(WindowProperties &req_properties) {
|
|||||||
set_icon_filename(req_properties.get_icon_filename());
|
set_icon_filename(req_properties.get_icon_filename());
|
||||||
}
|
}
|
||||||
|
|
||||||
_properties.set_foreground(true);
|
|
||||||
_properties.set_minimized(false);
|
|
||||||
_properties.set_open(true);
|
_properties.set_open(true);
|
||||||
|
|
||||||
if (_properties.has_size())
|
if (_properties.has_size())
|
||||||
@ -1681,6 +1699,13 @@ void TinyOsxGraphicsWindow::set_properties_now(WindowProperties &properties) {
|
|||||||
need_full_rebuild = true;
|
need_full_rebuild = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are fullscreen and requesting a minimize change
|
||||||
|
if (_properties.get_fullscreen() &&
|
||||||
|
(properties.has_minimized() &&
|
||||||
|
(properties.get_minimized() != _properties.get_minimized()))) {
|
||||||
|
need_full_rebuild = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (need_full_rebuild) {
|
if (need_full_rebuild) {
|
||||||
// Logic here is .. take a union of the properties .. with the
|
// Logic here is .. take a union of the properties .. with the
|
||||||
// new allowed to overwrite the old states. and start a bootstrap
|
// new allowed to overwrite the old states. and start a bootstrap
|
||||||
@ -1739,6 +1764,13 @@ void TinyOsxGraphicsWindow::set_properties_now(WindowProperties &properties) {
|
|||||||
properties.clear_cursor_hidden();
|
properties.clear_cursor_hidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (properties.has_minimized()) {
|
||||||
|
if (_properties.get_minimized() != properties.get_minimized()) {
|
||||||
|
CollapseWindow(_osx_window, properties.get_minimized());
|
||||||
|
}
|
||||||
|
properties.clear_minimized();
|
||||||
|
}
|
||||||
|
|
||||||
if (tinydisplay_cat.is_debug()) {
|
if (tinydisplay_cat.is_debug()) {
|
||||||
tinydisplay_cat.debug()
|
tinydisplay_cat.debug()
|
||||||
<< "set_properties_now Out....." << _properties << "\n";
|
<< "set_properties_now Out....." << _properties << "\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user