Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 771c324

Browse files
committed
[Bug 16177] boundrect should not adjust the stack size if resizable==false
1 parent bde7ad4 commit 771c324

File tree

11 files changed

+19
-18
lines changed

11 files changed

+19
-18
lines changed

engine/src/desktop-dc.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ bool MCScreenDC::platform_getdisplays(bool p_effective, MCDisplay *& r_displays,
256256
return true;
257257
}
258258

259-
void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode mode)
259+
void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode mode, Boolean resizable)
260260
{
261261
MCRectangle srect;
262262

@@ -299,7 +299,8 @@ void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mod
299299
rect.x = srect . x;
300300
if (rect.x + rect.width > srect.x + srect . width - sr)
301301
{
302-
if (rect.width > srect . width - sw)
302+
// PM-2015-10-12: [[ Bug 16177 ]] Modify stack's rect only if stack is resizable
303+
if (rect.width > srect . width - sw && resizable)
303304
rect.width = srect . width - sw;
304305
rect.x = srect . x + srect . width - rect.width - sr;
305306
}
@@ -308,7 +309,8 @@ void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mod
308309
rect.y = srect.y;
309310
if (rect.y + rect.height > srect . y + srect . height - sb)
310311
{
311-
if (rect.height > srect . height - sh)
312+
// PM-2015-10-12: [[ Bug 16177 ]] Modify stack's rect only if stack is resizable
313+
if (rect.height > srect . height - sh && resizable)
312314
rect.height = srect . height - sh;
313315
rect.y = srect . y + srect . height - rect.height - sb;
314316
}

engine/src/desktop-dc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class MCScreenDC: public MCUIDC
8080
virtual uint16_t platform_getwidth(void);
8181
virtual uint16_t platform_getheight(void);
8282
virtual bool platform_getdisplays(bool p_effective, MCDisplay *&r_displays, uint32_t &r_count);
83-
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m);
83+
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable);
8484

8585
virtual void resetcursors();
8686
virtual void setcursor(Window w, MCCursorRef c);

engine/src/lnxdc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class MCScreenDC : public MCUIDC
252252
virtual uint16_t platform_getheight(void);
253253
virtual bool platform_getdisplays(bool p_effective, MCDisplay *&r_displays, uint32_t &r_count);
254254
virtual bool platform_getwindowgeometry(Window w, MCRectangle &drect);
255-
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m);
255+
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable);
256256
virtual void platform_querymouse(int16_t &r_x, int16_t &r_y);
257257
virtual void platform_setmouse(int16_t p_x, int16_t p_y);
258258

engine/src/lnxdce.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
4949
#define WM_TITLE_HEIGHT 16
5050

5151
// IM-2014-01-29: [[ HiDPI ]] Placeholder method for Linux HiDPI support
52-
void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m)
52+
void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable)
5353
{
5454
device_boundrect(rect, title, m);
5555
}

engine/src/mbldc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ void MCScreenDC::platform_setmouse(int16_t p_x, int16_t p_y)
938938
device_setmouse(t_loc.x, t_loc.y);
939939
}
940940

941-
void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m)
941+
void MCScreenDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable)
942942
{
943943
MCRectangle t_rect;
944944
t_rect = rect;

engine/src/mbldc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class MCScreenDC: public MCUIDC
7575
virtual bool platform_getdisplays(bool p_effective, MCDisplay *&r_displays, uint32_t &r_count);
7676
virtual bool platform_displayinfocacheable(void);
7777
virtual bool platform_getwindowgeometry(Window w, MCRectangle &drect);
78-
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m);
78+
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable);
7979
virtual void platform_querymouse(int16_t &r_x, int16_t &r_y);
8080
virtual void platform_setmouse(int16_t p_x, int16_t p_y);
8181

engine/src/stack2.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,9 +1985,8 @@ Exec_stat MCStack::openrect(const MCRectangle &rel, Window_mode wm, MCStack *par
19851985

19861986
// "bind" the stack's rect... Or in other words, make sure its within the
19871987
// screens (well viewports) working area.
1988-
// PM-2015-10-12: [[ Bug 16177 ]] Make sure we "bind" the stack's rect only if resizable==true
1989-
if (!(flags & F_FORMAT_FOR_PRINTING) && !(state & CS_BEEN_MOVED) && (flags & F_RESIZABLE))
1990-
MCscreen->boundrect(rect, (!(flags & F_DECORATIONS) || decorations & WD_TITLE), mode);
1988+
if (!(flags & F_FORMAT_FOR_PRINTING) && !(state & CS_BEEN_MOVED))
1989+
MCscreen->boundrect(rect, (!(flags & F_DECORATIONS) || decorations & WD_TITLE), mode, getflag(F_RESIZABLE));
19911990

19921991
state |= CS_NO_FOCUS;
19931992
if (flags & F_DYNAMIC_PATHS)

engine/src/uidc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,14 +592,14 @@ bool MCUIDC::platform_getwindowgeometry(Window p_window, MCRectangle &r_rect)
592592
////////////////////////////////////////////////////////////////////////////////
593593

594594
// IM-2014-01-24: [[ HiDPI ]] Change to use logical coordinates - device coordinate conversion no longer needed
595-
void MCUIDC::boundrect(MCRectangle &x_rect, Boolean p_title, Window_mode p_mode)
595+
void MCUIDC::boundrect(MCRectangle &x_rect, Boolean p_title, Window_mode p_mode, Boolean p_resizable)
596596
{
597-
platform_boundrect(x_rect, p_title, p_mode);
597+
platform_boundrect(x_rect, p_title, p_mode, p_resizable);
598598
}
599599

600600
//////////
601601

602-
void MCUIDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m)
602+
void MCUIDC::platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable)
603603
{ }
604604

605605
////////////////////////////////////////////////////////////////////////////////

engine/src/uidc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class MCUIDC
360360

361361
const MCDisplay *getnearestdisplay(const MCRectangle& p_rectangle);
362362
Boolean getwindowgeometry(Window w, MCRectangle &drect);
363-
void boundrect(MCRectangle &rect, Boolean title, Window_mode m);
363+
void boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable);
364364
void querymouse(int2 &x, int2 &y);
365365
void setmouse(int2 x, int2 y);
366366

@@ -375,7 +375,7 @@ class MCUIDC
375375
virtual uint16_t platform_getheight(void);
376376
virtual bool platform_getdisplays(bool p_effective, MCDisplay *&r_displays, uint32_t &r_count);
377377
virtual bool platform_getwindowgeometry(Window w, MCRectangle &drect);
378-
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m);
378+
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable);
379379
virtual void platform_querymouse(int16_t &r_x, int16_t &r_y);
380380
virtual void platform_setmouse(int16_t p_x, int16_t p_y);
381381

engine/src/w32dc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class MCScreenDC : public MCUIDC
216216
virtual bool platform_getdisplays(bool p_effective, MCDisplay *&r_displays, uint32_t &r_count);
217217
virtual bool platform_displayinfocacheable(void);
218218
virtual bool platform_getwindowgeometry(Window w, MCRectangle &drect);
219-
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m);
219+
virtual void platform_boundrect(MCRectangle &rect, Boolean title, Window_mode m, Boolean resizable);
220220
virtual void platform_querymouse(int16_t &r_x, int16_t &r_y);
221221
virtual void platform_setmouse(int16_t p_x, int16_t p_y);
222222
virtual MCStack *platform_getstackatpoint(int32_t x, int32_t y);

0 commit comments

Comments
 (0)