--- \dll\iup\a\src\iup_layoutdlg.c	2020-01-17 19:13:03.000000000 -0300
+++ iup_layoutdlg.c	2020-02-14 14:34:46.174247900 -0300
@@ -1973,13 +1973,14 @@
 
 static int iLayoutContextMenuPasteInsertBrother_CB(Ihandle* menu)
 {
-  Ihandle* new_ih, *ret_ih = NULL;
+  Ihandle* ret_ih = NULL;
   iLayoutDialog* layoutdlg = (iLayoutDialog*)iupAttribGetInherit(menu, "_IUP_LAYOUTDIALOG");
   Ihandle* ref_elem = (Ihandle*)iupAttribGetInherit(menu, "_IUP_LAYOUTCONTEXTELEMENT");
   int ref_id = IupTreeGetId(layoutdlg->tree, ref_elem);
 
   if (layoutdlg->copy_elem)
   {
+	Ihandle* new_ih;
     new_ih = IupCreate(layoutdlg->copy_elem->iclass->name);
     IupCopyClassAttributes(layoutdlg->copy_elem, new_ih);
 
@@ -2026,13 +2027,13 @@
 
 static int iLayoutContextMenuPasteInsertChild_CB(Ihandle* menu)
 {
-  Ihandle* new_ih;
   iLayoutDialog* layoutdlg = (iLayoutDialog*)iupAttribGetInherit(menu, "_IUP_LAYOUTDIALOG");
   Ihandle* ref_elem = (Ihandle*)iupAttribGetInherit(menu, "_IUP_LAYOUTCONTEXTELEMENT");
   int ref_id = IupTreeGetId(layoutdlg->tree, ref_elem);
 
   if (layoutdlg->copy_elem)
   {
+    Ihandle* new_ih;
     new_ih = IupCreate(layoutdlg->copy_elem->iclass->name);
     IupCopyClassAttributes(layoutdlg->copy_elem, new_ih);
 
@@ -2073,13 +2074,13 @@
 
 static int iLayoutContextMenuPasteAppendChild_CB(Ihandle* menu)
 {
-  Ihandle* new_ih;
   iLayoutDialog* layoutdlg = (iLayoutDialog*)iupAttribGetInherit(menu, "_IUP_LAYOUTDIALOG");
   Ihandle* ref_elem = (Ihandle*)iupAttribGetInherit(menu, "_IUP_LAYOUTCONTEXTELEMENT");
   int ref_id = IupTreeGetId(layoutdlg->tree, ref_elem);
 
   if (layoutdlg->copy_elem)
   {
+    Ihandle* new_ih;
     new_ih = IupCreate(layoutdlg->copy_elem->iclass->name);
     IupCopyClassAttributes(layoutdlg->copy_elem, new_ih);
 
@@ -2120,14 +2121,15 @@
 
 static int iLayoutContextMenuPasteCursor_CB(Ihandle* menu)
 {
-  Ihandle* new_ih, *ret_ih = NULL;
+  Ihandle* ret_ih = NULL;
   iLayoutDialog* layoutdlg = (iLayoutDialog*)iupAttribGetInherit(menu, "_IUP_LAYOUTDIALOG");
   Ihandle* container = (Ihandle*)iupAttribGetInherit(menu, "INSERTCURSOR"); /* the container */
   Ihandle* ref_elem = (Ihandle*)iupAttribGetInherit(menu, "INSERTCURSOR_ELEMENT");
-  int ref_id;
 
   if (layoutdlg->copy_elem)
   {
+    Ihandle* new_ih;
+    int ref_id;
     new_ih = IupCreate(layoutdlg->copy_elem->iclass->name);
     IupCopyClassAttributes(layoutdlg->copy_elem, new_ih);
 
@@ -2402,9 +2404,6 @@
 
 static Ihandle* iLayoutGetElementByPos(Ihandle* ih, int native_parent_x, int native_parent_y, int x, int y, int showhidden, int dlgvisible, int shownotmapped)
 {
-  Ihandle *child, *elem;
-  int dx, dy;
-
   if ((showhidden || iLayoutElementIsVisible(ih, dlgvisible)) &&
       (shownotmapped || ih->handle))
   {
@@ -2414,11 +2413,13 @@
         x < ih->x + native_parent_x + ih->currentwidth &&
         y < ih->y + native_parent_y + ih->currentheight)
     {
+      Ihandle *child, *elem;
       if (ih->iclass->childtype != IUP_CHILDNONE)
       {
         /* if ih is a native parent, then update the offset */
         if (ih->iclass->nativetype != IUP_TYPEVOID)
         {
+          int dx, dy;
           dx = 0, dy = 0;
           IupGetIntInt(ih, "CLIENTOFFSET", &dx, &dy);
           native_parent_x += ih->x + dx;
