Skip to content

Commit f4145d1

Browse files
committed
WindowModes: Switch x11GraphicsWindow to use window_mode instead of fullscreen and undecorated
1 parent 8def7f4 commit f4145d1

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

panda/src/x11display/x11GraphicsWindow.cxx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ set_properties_now(WindowProperties &properties) {
485485

486486
// We're either going into or out of fullscreen, or are in fullscreen and
487487
// are changing the resolution.
488-
bool is_fullscreen = _properties.has_fullscreen() && _properties.get_fullscreen();
489-
bool want_fullscreen = properties.has_fullscreen() ? properties.get_fullscreen() : is_fullscreen;
488+
bool is_fullscreen = _properties.has_window_mode() && _properties.get_window_mode() == WindowProperties::W_fullscreen;
489+
bool want_fullscreen = properties.has_window_mode() ? properties.get_window_mode() == WindowProperties::W_fullscreen : is_fullscreen;
490490

491491
if (is_fullscreen != want_fullscreen || (is_fullscreen && properties.has_size())) {
492492
if (want_fullscreen) {
@@ -588,10 +588,10 @@ set_properties_now(WindowProperties &properties) {
588588
properties.clear_title();
589589
}
590590

591-
// Same for fullscreen.
592-
if (properties.has_fullscreen()) {
593-
_properties.set_fullscreen(properties.get_fullscreen());
594-
properties.clear_fullscreen();
591+
// Assume we've dealt with window_mode in set_wm_properties()
592+
if (properties.has_window_mode()) {
593+
_properties.set_window_mode(properties.get_window_mode());
594+
properties.clear_window_mode();
595595
}
596596

597597
// The size and position of an already-open window are changed via explicit
@@ -601,7 +601,7 @@ set_properties_now(WindowProperties &properties) {
601601
XWindowChanges changes;
602602
int value_mask = 0;
603603

604-
if (_properties.get_fullscreen()) {
604+
if (_properties.get_window_mode() == WindowProperties::W_fullscreen) {
605605
changes.x = 0;
606606
changes.y = 0;
607607
value_mask |= CWX | CWY;
@@ -861,7 +861,7 @@ open_window() {
861861
_properties.set_size(100, 100);
862862
}
863863

864-
if (_properties.get_fullscreen() && x11_pipe->_have_xrandr) {
864+
if (_properties.get_window_mode() == WindowProperties::W_fullscreen && x11_pipe->_have_xrandr) {
865865
XRRScreenConfiguration* conf = _XRRGetScreenInfo(_display, x11_pipe->get_root());
866866
if (_orig_size_id == (SizeID) -1) {
867867
_orig_size_id = x11_pipe->_XRRConfigCurrentConfiguration(conf, &_orig_rotation);
@@ -1027,7 +1027,7 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
10271027
size_hints_p = XAllocSizeHints();
10281028
if (size_hints_p != (XSizeHints *)NULL) {
10291029
if (properties.has_origin()) {
1030-
if (_properties.get_fullscreen()) {
1030+
if (_properties.get_window_mode() == WindowProperties::W_fullscreen) {
10311031
size_hints_p->x = 0;
10321032
size_hints_p->y = 0;
10331033
} else {
@@ -1088,8 +1088,8 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
10881088
SetAction set_data[max_set_data];
10891089
int next_set_data = 0;
10901090

1091-
if (properties.has_fullscreen()) {
1092-
if (properties.get_fullscreen()) {
1091+
if (properties.has_window_mode()) {
1092+
if (properties.get_window_mode() == WindowProperties::W_fullscreen) {
10931093
// For a "fullscreen" request, we pass this through, hoping the window
10941094
// manager will support EWMH.
10951095
type_data[next_type_data++] = x11_pipe->_net_wm_window_type_fullscreen;
@@ -1123,12 +1123,15 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
11231123
class_hints_p->res_name = (char*) x_wm_class_name.c_str();
11241124
}
11251125

1126-
} else if (properties.get_undecorated() || properties.get_fullscreen()) {
1126+
} else if (properties.get_window_mode() == WindowProperties::W_undecorated ||
1127+
properties.get_window_mode() == WindowProperties::W_fullscreen)
1128+
{
11271129
class_hints_p = XAllocClassHint();
11281130
class_hints_p->res_class = (char*) "Undecorated";
11291131
}
11301132

1131-
if (properties.get_undecorated() && !properties.get_fullscreen()) {
1133+
if (properties.get_window_mode() == WindowProperties::W_undecorated)
1134+
{
11321135
type_data[next_type_data++] = x11_pipe->_net_wm_window_type_splash;
11331136
}
11341137

@@ -1226,6 +1229,7 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) {
12261229

12271230
XSetWMProtocols(_display, _xwindow, protocols,
12281231
sizeof(protocols) / sizeof(Atom));
1232+
12291233
}
12301234

12311235
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy