Skip to content

Commit 34a6370

Browse files
committed
Merge branch 'develop-8.1' into merge-develop-8.1-17.9.20
2 parents 30df4d3 + 9b0273e commit 34a6370

File tree

12 files changed

+117
-95
lines changed

12 files changed

+117
-95
lines changed

docs/dictionary/function/specialFolderPath.lcdoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,21 @@ The following <folderIdentifier> values are supported:
172172
* "documents": The folder where application-specific data can be placed
173173
(typically valuable)
174174
* "cache": The folder where transient application-specific data can be
175-
placed (typically not valuable)
175+
placed (typically not valuable)
176+
* "temporary": Same as "cache"
176177
* "engine": The (virtual) folder containing the
177178
<application|application's> LiveCode <engine> and other resources
178179
that were copied into the <application> at build time
179180
* "resources": Same as "engine".
181+
* "external documents": The folder on the primary shared/external
182+
storage device where application-specific data can be placed
183+
* "external cache": The folder on the primary shared/external
184+
storage device where transient application-specific data can be placed
185+
* "external temporary": same as "external cache"
180186

187+
>*Note:* If using any external <folderIdentifier> values, ensure you
188+
> have the 'Write External Storage' permission checked in the
189+
> application standalone settings
181190

182191
**On Linux systems**, the following <folderIdentifier> values
183192
are supported:
@@ -228,4 +237,3 @@ platform (glossary), return (glossary), special folder (glossary),
228237
standalone application (glossary), defaultFolder (property)
229238

230239
Tags: file system
231-

docs/notes/bugfix-20349.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash when deleting the focused object

docs/notes/bugfix-20363.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Update DIB format when image placed on Windows clipboard

docs/notes/bugfix-20413.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Add documentation for android specialFolderPath external prefix

engine/src/control.cpp

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
4747

4848
#include "exec.h"
4949

50-
MCControl *MCControl::focused;
50+
MCControlHandle MCControl::focused;
5151
int2 MCControl::defaultmargin = 4;
5252
int2 MCControl::xoffset;
5353
int2 MCControl::yoffset;
@@ -126,8 +126,8 @@ MCControl::MCControl(const MCControl &cref) : MCObject(cref)
126126

127127
MCControl::~MCControl()
128128
{
129-
if (focused == this)
130-
focused = NULL;
129+
if (focused.IsBoundTo(this))
130+
focused = nullptr;
131131

132132
MCscreen->stopmove(this, False);
133133

@@ -155,9 +155,10 @@ void MCControl::open()
155155
void MCControl::close()
156156
{
157157
// MW-2008-01-09: [[ Bug 5739 ]] Changing group layer cancels mousedown
158-
if (opened == 1)
159-
if (focused == this)
160-
focused = NULL;
158+
if (opened == 1 && focused.IsBoundTo(this))
159+
{
160+
focused = nullptr;
161+
}
161162
MCObject::close();
162163
}
163164

@@ -263,7 +264,7 @@ Boolean MCControl::mfocus(int2 x, int2 y)
263264

264265
if (is || state & CS_MFOCUSED)
265266
{
266-
if (focused == this || getstack() -> gettool(this) == T_POINTER)
267+
if (focused.IsBoundTo(this) || getstack() -> gettool(this) == T_POINTER)
267268
{
268269
if (MCdispatcher -> isdragtarget())
269270
message_with_args(MCM_drag_move, x, y);
@@ -300,7 +301,7 @@ Boolean MCControl::mfocus(int2 x, int2 y)
300301

301302
void MCControl::munfocus()
302303
{
303-
if (focused == this)
304+
if (focused.IsBoundTo(this))
304305
{
305306
if (state & CS_MFOCUSED)
306307
{
@@ -1358,8 +1359,11 @@ void MCControl::newmessage()
13581359

13591360
void MCControl::enter()
13601361
{
1361-
if (focused != NULL && focused != this)
1362-
leave();
1362+
if (focused.IsValid() && !focused.IsBoundTo(this))
1363+
{
1364+
leave();
1365+
}
1366+
13631367
if (MCdispatcher -> isdragtarget())
13641368
{
13651369
MCdragaction = DRAG_ACTION_NONE;
@@ -1392,27 +1396,33 @@ void MCControl::enter()
13921396

13931397
void MCControl::leave()
13941398
{
1395-
MCControl *oldfocused = focused;
1399+
MCControlHandle oldfocused = focused;
13961400
if (MCdispatcher -> isdragtarget())
13971401
{
13981402
// MW-2013-08-08: [[ Bug 10655 ]] If oldfocused is a field and has dragText set,
13991403
// then make sure we unset it (otherwise the caret will continue moving around
14001404
// on mouseMove).
1401-
if (oldfocused->gettype() == CT_FIELD
1405+
if (oldfocused.IsValid())
1406+
{
1407+
if (oldfocused->gettype() == CT_FIELD
14021408
&& oldfocused -> getstate(CS_DRAG_TEXT))
1403-
{
1404-
MCField *fptr = (MCField *)oldfocused;
1405-
fptr->removecursor();
1406-
getstack()->clearibeam();
1407-
oldfocused->state &= ~(CS_DRAG_TEXT | CS_IBEAM);
1408-
}
1409-
oldfocused->message(MCM_drag_leave);
1409+
{
1410+
MCField *fptr = oldfocused.GetAs<MCField>();
1411+
fptr->removecursor();
1412+
getstack()->clearibeam();
1413+
oldfocused->state &= ~(CS_DRAG_TEXT | CS_IBEAM);
1414+
}
1415+
oldfocused->message(MCM_drag_leave);
1416+
}
14101417
MCdragaction = DRAG_ACTION_NONE;
14111418
MCdragdest = nil;
14121419
}
1413-
else
1420+
else if (oldfocused.IsValid())
1421+
{
14141422
oldfocused->message(MCM_mouse_leave);
1415-
focused = NULL;
1423+
}
1424+
1425+
focused = nullptr;
14161426
}
14171427

14181428
Boolean MCControl::sbfocus(int2 x, int2 y, MCScrollbar *hsb, MCScrollbar *vsb)

engine/src/deploy_macosx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2747,7 +2747,7 @@ template<typename T> static bool MCDeployExtractArchCallbackBody(MCDeployExtract
27472747
t_section = nil;
27482748
for(uint32_t i = 0; i < t_header . ncmds; i++)
27492749
{
2750-
if (t_commands[i] -> cmd != LC_SEGMENT)
2750+
if (t_commands[i] -> cmd != T::seg_load_command)
27512751
continue;
27522752

27532753
typename T::segment_command *t_segment;

engine/src/exec-interface-control.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void MCControl::SetToolTip(MCExecContext& ctxt, MCStringRef p_tooltip)
274274

275275
MCValueAssign(tooltip, p_tooltip);
276276

277-
if (focused == this)
277+
if (focused.IsBoundTo(this))
278278
MCtooltip->settip(tooltip);
279279
}
280280

engine/src/fields.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ void MCField::setparagraphs(MCParagraph *newpgptr, uint4 parid, findex_t p_start
446446

447447
uint4 oldstate = state;
448448
bool t_refocus;
449-
if (focused == this)
449+
if (focused.IsBoundTo(this))
450450
t_refocus = true;
451451
else
452452
t_refocus = false;

engine/src/ifile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void MCImage::reopen(bool p_newfile, bool p_lock_size)
347347
return;
348348
uint4 oldstate = state & (CS_NO_MESSAGES | CS_SELECTED
349349
| CS_MFOCUSED | CS_KFOCUSED);
350-
MCControl *oldfocused = focused;
350+
MCControlHandle oldfocused = focused;
351351

352352
state &= ~CS_SELECTED;
353353
uint2 opencount = opened;
@@ -380,7 +380,7 @@ void MCImage::reopen(bool p_newfile, bool p_lock_size)
380380

381381
state |= oldstate;
382382

383-
if (oldfocused == this)
383+
if (oldfocused.IsBoundTo(this))
384384
focused = this;
385385

386386
// MW-2011-08-17: [[ Layers ]] Notify of the change in rect and invalidate.

engine/src/mccontrol.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class MCControl : public MCObject, public MCMixinObjectHandle<MCControl>
9494
static int2 defaultmargin;
9595
static int2 xoffset;
9696
static int2 yoffset;
97-
static MCControl *focused;
97+
static MCControlHandle focused;
9898
static double aspect;
9999

100100
static MCPropertyInfo kProperties[];
@@ -265,7 +265,11 @@ class MCControl : public MCObject, public MCMixinObjectHandle<MCControl>
265265

266266
static MCControl *getfocused()
267267
{
268-
return focused;
268+
if (focused.IsValid())
269+
{
270+
return focused;
271+
}
272+
return nullptr;
269273
}
270274

271275
uint32_t getstyle()

0 commit comments

Comments
 (0)