XkbCopyKeymap/SrvXkbCopyKeymap: free geom harder, add cheery comments
Unconditionally free geometry when copying the keymap (so we have none on core, oh well), add a couple of heartening comments.
This commit is contained in:
		
							parent
							
								
									4524a2bf6f
								
							
						
					
					
						commit
						629798c73a
					
				| 
						 | 
					@ -324,8 +324,11 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll)
 | 
				
			||||||
	XkbFreeIndicatorMaps(xkb);
 | 
						XkbFreeIndicatorMaps(xkb);
 | 
				
			||||||
    if (which&XkbNamesMask)
 | 
					    if (which&XkbNamesMask)
 | 
				
			||||||
	XkbFreeNames(xkb,XkbAllNamesMask,True);
 | 
						XkbFreeNames(xkb,XkbAllNamesMask,True);
 | 
				
			||||||
    if ((which&XkbGeometryMask) && (xkb->geom!=NULL))
 | 
					    if ((which&XkbGeometryMask) && (xkb->geom!=NULL)) {
 | 
				
			||||||
	XkbFreeGeometry(xkb->geom,XkbGeomAllMask,True);
 | 
						XkbFreeGeometry(xkb->geom,XkbGeomAllMask,True);
 | 
				
			||||||
 | 
					        /* PERHAPS BONGHITS etc */
 | 
				
			||||||
 | 
					        xkb->geom = NULL;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (which&XkbControlsMask)
 | 
					    if (which&XkbControlsMask)
 | 
				
			||||||
	XkbFreeControls(xkb,XkbAllControlsMask,True);
 | 
						XkbFreeControls(xkb,XkbAllControlsMask,True);
 | 
				
			||||||
    if (freeAll)
 | 
					    if (freeAll)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1476,6 +1476,8 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* geometry */
 | 
					    /* geometry */
 | 
				
			||||||
 | 
					    /* not implemented yet because oh god the pain. */
 | 
				
			||||||
 | 
					#if 0
 | 
				
			||||||
    if (src->geom) {
 | 
					    if (src->geom) {
 | 
				
			||||||
        /* properties */
 | 
					        /* properties */
 | 
				
			||||||
        /* colors */
 | 
					        /* colors */
 | 
				
			||||||
| 
						 | 
					@ -1485,9 +1487,13 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies)
 | 
				
			||||||
        /* key aliases */
 | 
					        /* key aliases */
 | 
				
			||||||
        /* font?!? */
 | 
					        /* font?!? */
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
        if (dst->geom) {
 | 
					        if (dst->geom) {
 | 
				
			||||||
 | 
					            /* I LOVE THE DIFFERENT CALL SIGNATURE.  REALLY, I DO. */
 | 
				
			||||||
            XkbFreeGeometry(dst->geom, XkbGeomAllMask, True);
 | 
					            XkbFreeGeometry(dst->geom, XkbGeomAllMask, True);
 | 
				
			||||||
 | 
					            dst->geom = NULL;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1520,7 +1526,8 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            /* send NewKeyboardNotify if the keycode range changed, else
 | 
					            /* send NewKeyboardNotify if the keycode range changed, else
 | 
				
			||||||
             * just MapNotify. */
 | 
					             * just MapNotify.  we also need to send NKN if the geometry
 | 
				
			||||||
 | 
					             * changed (obviously ...). */
 | 
				
			||||||
            if ((src->min_key_code != dst->min_key_code ||
 | 
					            if ((src->min_key_code != dst->min_key_code ||
 | 
				
			||||||
                 src->max_key_code != dst->max_key_code) && sendNotifies) {
 | 
					                 src->max_key_code != dst->max_key_code) && sendNotifies) {
 | 
				
			||||||
                nkn.oldMinKeyCode = dst->min_key_code;
 | 
					                nkn.oldMinKeyCode = dst->min_key_code;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue