Skip to content

Commit

Permalink
Fixed|Window Manager: Incorrectly changing away from maximized window
Browse files Browse the repository at this point in the history
The 'maximized' flag is now cleared when changing the window's
attributes (x, y, width, height). This fixes a problem where the
window would stay in the maximized size when changing the window's
resolution while the window was maximized.
  • Loading branch information
skyjake committed Mar 31, 2013
1 parent 824cb1f commit c878531
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doomsday/client/src/ui/window.cpp
Expand Up @@ -480,10 +480,12 @@ struct ddwindow_s
if(set)
{
flags |= flag;
if(flag & DDWF_MAXIMIZED) LOG_DEBUG("Setting DDWF_MAXIMIZED");
}
else
{
flags &= ~flag;
if(flag & DDWF_MAXIMIZED) LOG_DEBUG("Clearing DDWF_MAXIMIZED");
if(flag & DDWF_CENTERED) LOG_DEBUG("Clearing DDWF_CENTERED");
}
}
Expand All @@ -504,13 +506,15 @@ struct ddwindow_s
if(x() != attribs[i])
{
normalGeometry.origin.x = attribs[i];
setFlag(DDWF_MAXIMIZED, false);
changed = true;
}
break;
case DDWA_Y:
if(y() != attribs[i])
{
normalGeometry.origin.y = attribs[i];
setFlag(DDWF_MAXIMIZED, false);
changed = true;
}
break;
Expand All @@ -520,6 +524,7 @@ struct ddwindow_s
if(attribs[i] < WINDOW_MIN_WIDTH) return false;
normalGeometry.size.width = geometry.size.width = attribs[i];
DEBUG_Message(("ngw=%i [B]\n", normalGeometry.size.width));
setFlag(DDWF_MAXIMIZED, false);
changed = true;
}
break;
Expand All @@ -528,6 +533,7 @@ struct ddwindow_s
{
if(attribs[i] < WINDOW_MIN_HEIGHT) return false;
normalGeometry.size.height = geometry.size.height = attribs[i];
setFlag(DDWF_MAXIMIZED, false);
changed = true;
}
break;
Expand All @@ -554,6 +560,7 @@ struct ddwindow_s
return false;
}
setFlag(DDWF_FULLSCREEN, attribs[i]);
setFlag(DDWF_MAXIMIZED, false);
changed = true;
}
break;
Expand Down

0 comments on commit c878531

Please sign in to comment.